Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
4
Merge Requests
4
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
32bd1a66
Commit
32bd1a66
authored
Aug 23, 2017
by
Jan-Gerrit Richter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for new continuous arc in old ita
parent
8fc62359
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
29 deletions
+99
-29
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorControlNanotec.m
...ntrol/ClassStuff/itaMotorControl/itaMotorControlNanotec.m
+19
-3
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec.m
...MotorControl/ClassStuff/itaMotorControl/itaMotorNanotec.m
+2
-1
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec_Arm.m
...rControl/ClassStuff/itaMotorControl/itaMotorNanotec_Arm.m
+4
-0
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec_HRTFarc.m
...trol/ClassStuff/itaMotorControl/itaMotorNanotec_HRTFarc.m
+58
-18
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec_Slayer.m
...ntrol/ClassStuff/itaMotorControl/itaMotorNanotec_Slayer.m
+4
-0
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec_Turntable.m
...ol/ClassStuff/itaMotorControl/itaMotorNanotec_Turntable.m
+3
-0
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/test_itaEimarMotorControl.m
...ol/ClassStuff/itaMotorControl/test_itaEimarMotorControl.m
+8
-6
applications/Hardware/ITAMotorControl/itaEimar.m
applications/Hardware/ITAMotorControl/itaEimar.m
+1
-1
No files found.
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorControlNanotec.m
View file @
32bd1a66
...
...
@@ -122,6 +122,7 @@ classdef itaMotorControlNanotec < itaMotorControl
pause
(
this
.
waitForSerialPort
);
end
end
function
moveTo
(
this
,
varargin
)
% if itaCoordinates are given, the position is passed to all
...
...
@@ -178,6 +179,13 @@ classdef itaMotorControlNanotec < itaMotorControl
end
function
freeFromStopButton
(
this
)
for
index
=
1
:
length
(
this
.
motorList
)
this
.
motorList
{
index
}
.
freeFromStopButton
();
end
end
function
reference
(
this
)
this
.
clear_commandlist
;
for
index
=
1
:
length
(
this
.
motorList
)
...
...
@@ -212,12 +220,14 @@ classdef itaMotorControlNanotec < itaMotorControl
% first, do a reference move
ita_verbose_info
(
'Moving to reference'
,
1
)
this
.
reference
ita_verbose_info
(
'Disable reference position'
,
1
)
this
.
motorList
{
1
}
.
disableReference
(
1
);
ita_verbose_info
(
'Moving to pre angle'
,
1
)
this
.
moveTo
(
motorName
,
-
sArgs
.
preAngle
,
'absolut'
,
false
,
'speed'
,
1
)
this
.
moveTo
(
motorName
,
-
sArgs
.
preAngle
,
'absolut'
,
false
,
'speed'
,
2
)
% now prepare the big move but don't start it
this
.
moveTo
(
motorName
,
360
+
sArgs
.
preAngle
+
15
,
'speed'
,
sArgs
.
speed
,
'absolut'
,
fals
e
,
'start'
,
0
,
'limit'
,
0
);
this
.
moveTo
(
motorName
,
360
-
35
,
'speed'
,
sArgs
.
speed
,
'absolut'
,
tru
e
,
'start'
,
0
,
'limit'
,
0
);
this
.
preparedList
=
motorName
;
ita_verbose_info
(
'Finished preparing'
,
2
)
end
...
...
@@ -246,6 +256,8 @@ classdef itaMotorControlNanotec < itaMotorControl
end
this
.
wait4everything
this
.
preparedList
=
[];
ita_verbose_info
(
'Enable reference position'
,
1
)
% this.sendControlSequenceAndPrintResults(':port_in_a=7');
end
function
success
=
add_to_commandlist
(
this
,
string_to_send
)
...
...
@@ -456,7 +468,11 @@ classdef itaMotorControlNanotec < itaMotorControl
ita_verbose_info
(
'Position reached'
,
1
);
else
ita_verbose_info
(
'Position NOT reached! - Check for errors!'
,
0
);
this
.
send_commandlist
(
this
.
failed_command_repititions
);
% mpo: bugfix: send_commandlist needs argument
%assuming stop button clicked
%call freefrombutton function
% this.freeFromStopButton
% this.send_commandlist(this.failed_command_repititions); % mpo: bugfix: send_commandlist needs argument
% this.isReferenced = false;
end
this
.
clear_receivedlist
;
...
...
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec.m
View file @
32bd1a66
...
...
@@ -29,7 +29,8 @@ classdef itaMotorNanotec < itaHandle
% basic moves: requires execution to halt while something is moving
this
=
moveToReferencePosition
(
this
);
this
=
startMoveToPosition
(
this
);
disableReference
(
this
,
value
);
% this = freeFromStopButton(this);
ret
=
prepareMove
(
this
,
position
,
varargin
);
end
end
\ No newline at end of file
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec_Arm.m
View file @
32bd1a66
...
...
@@ -81,6 +81,10 @@ classdef itaMotorNanotec_Arm < itaMotorNanotec
name
=
this
.
motorName
;
end
function
disableReference
(
this
,
value
)
end
function
sendConfiguration
(
this
)
motorControl
=
this
.
mMotorControl
;
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:port_in_a7\r'
,
this
.
motorID
));
...
...
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec_HRTFarc.m
View file @
32bd1a66
...
...
@@ -23,8 +23,8 @@ classdef itaMotorNanotec_HRTFarc < itaMotorNanotec
'continuous'
,
false
,
...
'absolut'
,
true
,
...
'closed_loop'
,
false
,
...
'acceleration_ramp'
,
1
0
,
...
'gear_ratio'
,
5
,
...
'acceleration_ramp'
,
80
0
,
...
'gear_ratio'
,
80
,
...
'current'
,
100
,
...
'ramp_mode'
,
2
,
...
'P'
,
400
,
...
...
...
@@ -44,14 +44,21 @@ classdef itaMotorNanotec_HRTFarc < itaMotorNanotec
this
.
motorID
=
8
;
this
.
motorName
=
'HRTFArc'
;
this
.
motorLimits
=
[
-
20
380
];
% the motor can do a whole rotation + ~15 deg to both sides
this
.
motorLimits
=
[
-
45
330
];
% the motor can do a whole rotation + ~15 deg to both sides
end
function
this
=
init
(
this
)
end
function
disableReference
(
this
,
value
)
if
value
this
.
mMotorControl
.
sendControlSequenceAndPrintResults
(
':port_in_a=0'
);
else
this
.
mMotorControl
.
sendControlSequenceAndPrintResults
(
':port_in_a=7'
);
end
end
function
stop
(
this
)
% DO NOT ASK - JUST STOP ALL MOTORS!
for
i
=
1
:
5
% repeat several times to ensure that every motor stops!
...
...
@@ -63,6 +70,22 @@ classdef itaMotorNanotec_HRTFarc < itaMotorNanotec
end
end
% function freeFromStopButton(this)
% res = motorControl.sendControlSequenceAndPrintResults('Zd');
% resp = res{end};
% direction = str2double(resp(end));
%
% if direction == 0
% direction = -1;
% else
% direction = 1;
% end
% this.allowMoveOverRefButton(1);
% this.prepareMove(direction*20,'absolut',false,'speed',10);
% this.startMoveToPosition();
% this.allowMoveOverRefButton(0);
% end
function
getStatus
(
this
)
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d$\r'
,
this
.
motorID
));
...
...
@@ -88,6 +111,7 @@ classdef itaMotorNanotec_HRTFarc < itaMotorNanotec
function
sendConfiguration
(
this
)
% Set Input 1 as external Referenceswitch
motorControl
=
this
.
mMotorControl
;
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:port_in_a=7\r'
,
this
.
motorID
));
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:port_in_b=7\r'
,
this
.
motorID
));
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:port_out_a=1\r'
,
this
.
motorID
));
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:port_out_a=2\r'
,
this
.
motorID
));
...
...
@@ -105,8 +129,8 @@ classdef itaMotorNanotec_HRTFarc < itaMotorNanotec
% endschalterverhalten: the ref manual is not very clear. bit 0
% is the most important bit. all not listed bits are 0
% defValue bin2dec('0100010000100010') = 17442
% motorControl.add_to_commandlist(sprintf('#%dl%d\r' , this.motorID, 5154)
);
this
.
allowMoveOverRefButton
(
0
);
% set lower speed to 1 Hz/sec (lowest value)
motorControl
.
add_to_commandlist
(
sprintf
(
'#%du3\r'
,
this
.
motorID
));
...
...
@@ -117,22 +141,23 @@ classdef itaMotorNanotec_HRTFarc < itaMotorNanotec
motorControl
=
this
.
mMotorControl
;
% Turn + some degrees in case we are already at the end of the
% reference switch or already passed it:
this
.
prepareMove
(
10
,
'absolut'
,
false
,
'speed'
,
1
);
this
.
startMoveToPosition
();
if
this
.
mMotorControl
.
send_commandlist
(
5
);
ita_verbose_info
(
'HRTFarc started move...'
,
2
);
end
tmpWait
=
motorControl
.
wait
;
motorControl
.
wait
=
true
;
motorControl
.
wait4everything
;
motorControl
.
wait
=
tmpWait
;
% this.prepareMove(20,'absolut',false,'speed',10);
% this.startMoveToPosition();
% if this.mMotorControl.send_commandlist(5);
% ita_verbose_info('HRTFarc started move...',2);
% end
% tmpWait = motorControl.wait;
% motorControl.wait = true;
% motorControl.wait4everything;
% motorControl.wait = tmpWait;
this
.
disableReference
(
0
);
% Call Reference-Mode:
motorControl
.
add_to_commandlist
(
sprintf
(
'#%dp=4\r'
,
this
.
motorID
));
% Set direction:
motorControl
.
add_to_commandlist
(
sprintf
(
'#%dd=1\r'
,
this
.
motorID
));
% Calculate and set lower speed:
%
stepspersecond = round(this.sArgs_default_motor.speed/0.9*this.sArgs_default_motor.gear_ratio);
motorControl
.
add_to_commandlist
(
sprintf
(
'#%du=%d\r'
,
this
.
motorID
,
1
));
stepspersecond
=
round
(
this
.
sArgs_default_motor
.
speed
/
0.9
*
this
.
sArgs_default_motor
.
gear_ratio
);
motorControl
.
add_to_commandlist
(
sprintf
(
'#%du=%d\r'
,
this
.
motorID
,
stepspersecond
));
% Calculate and set upper speed:
stepspersecond
=
round
(
this
.
sArgs_default_motor
.
speed
/
0.9
*
this
.
sArgs_default_motor
.
gear_ratio
);
motorControl
.
add_to_commandlist
(
sprintf
(
'#%do=%d\r'
,
this
.
motorID
,
stepspersecond
));
...
...
@@ -192,6 +217,21 @@ classdef itaMotorNanotec_HRTFarc < itaMotorNanotec
methods
(
Hidden
=
true
)
function
this
=
allowMoveOverRefButton
(
this
,
value
)
motorControl
=
this
.
mMotorControl
;
if
value
motorControl
.
sendControlSequenceAndPrintResults
(
'l17442'
);
else
motorControl
.
sendControlSequenceAndPrintResults
(
'l5154'
);
end
% Frei rckwrts
% 5154
% Stop
% 9250
end
function
ret
=
prepare_move
(
this
,
angle
,
varargin
)
% This function prepares the moves of the turntable, counterclockwise for a negative
% angle and clockwise for a positive angle.
...
...
@@ -297,7 +337,7 @@ classdef itaMotorNanotec_HRTFarc < itaMotorNanotec
% Choose ramp mode: (0=trapez, 1=sinus-ramp, 2=jerkfree-ramp):
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:ramp_mode=%d\r'
,
this
.
motorID
,
this
.
sArgs_motor
.
ramp_mode
));
% % Set maximum acceleration jerk:
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:b=
2
0\r'
,
this
.
motorID
));
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:b=
8
0\r'
,
this
.
motorID
));
% % Use acceleration jerk as braking jerk:
motorControl
.
add_to_commandlist
(
sprintf
(
'#%d:B=20\r'
,
this
.
motorID
));
% Closed_loop?
...
...
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec_Slayer.m
View file @
32bd1a66
...
...
@@ -99,6 +99,10 @@ classdef itaMotorNanotec_Slayer < itaMotorNanotec
end
function
disableReference
(
this
,
value
)
end
function
this
=
moveToReferencePosition
(
this
)
% Prepare reference move (arm)
...
...
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/itaMotorNanotec_Turntable.m
View file @
32bd1a66
...
...
@@ -136,6 +136,9 @@ classdef itaMotorNanotec_Turntable < itaMotorNanotec
this
.
mMotorControl
.
add_to_commandlist
(
sprintf
(
'#%dA\r'
,
this
.
motorID
));
end
function
disableReference
(
this
,
value
)
end
function
started
=
prepareMove
(
this
,
position
,
varargin
)
...
...
applications/Hardware/ITAMotorControl/ClassStuff/itaMotorControl/test_itaEimarMotorControl.m
View file @
32bd1a66
...
...
@@ -209,12 +209,14 @@ classdef test_itaEimarMotorControl < itaMeasurementTasksScan
speed
=
360
/(
numRepetitions
*
timePerRepetition
);
% preangletime
preAngle
Time
=
2
/
64
*
numRepetitions
;
% it takes 2 seconds to start recording
preAngle
=
preAngleTime
*
speed
;
preAngle
=
45
;
preAngle
Time
=
preAngle
/
speed
;
% it takes 2 seconds to start recording
preAngle
=
min
(
preAngle
,
20
);
preAngle
=
max
(
preAngle
,
20
);
numTotalRepetitions
=
numRepetitions
+
ceil
(
preAngleTime
/(
timePerRepetition
))
+
9
;
postAngle
=
10
;
postAngleTime
=
postAngle
/
speed
;
additionalReps
=
ceil
((
postAngleTime
+
preAngleTime
+
1
)/
timePerRepetition
);
numTotalRepetitions
=
numRepetitions
+
additionalReps
;
this
.
measurementSetup
.
repetitions
=
numTotalRepetitions
;
%prepare motors for continuous measurement
...
...
@@ -236,7 +238,7 @@ classdef test_itaEimarMotorControl < itaMeasurementTasksScan
function
[
result
,
result_raw
]
=
runContinuousMeasurement
(
this
)
this
.
mMotorControl
.
setWait
(
false
);
this
.
mMotorControl
.
startContinuousMoveNow
;
pause
(
1
);
pause
(
0.
1
);
result_raw
=
this
.
measurementSetup
.
run_raw_imc
;
result
=
this
.
measurementSetup
.
deconvolve
(
result_raw
);
% this.stop;
...
...
applications/Hardware/ITAMotorControl/itaEimar.m
View file @
32bd1a66
...
...
@@ -151,7 +151,7 @@ classdef itaEimar < itaMeasurementTasksScan
sArgs
_
default
_
turntable
=
struct
(
...
'
wait
',
true
,
...
'
speed
',
5
,
...
'
speed
',
2
,
...
'
VST
',
'
adaptiv
',
...
'
limit
',
false
,
...
'
continuous
',
false
,
...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment