Ariel,
If you download 2.37.5 you will be able to use the
[variable]
expression in the rate field (and the min/max too) to get that value from a variable. So if you want to control the rate of channel one put in something like
[channel_1_rate]
and set that variable to the rate that you want to send to the board.
The next question you will have is how to alter that variable at specific times. You'd have to use one of the programming modules like the VBScript module and enter
if GetVariable("servo_1_pos") <> 2500 then
' set the servo position to extreme
SetVariable "servo_1_pos", 2500
SetVariable "channel_1_rate", 5000
SetTimedVariable "channel_1_rate", 2000, 500
SetTimedVariable "channel_1_rate", 100, 1000
end if
which will set the servo position to the max and start out really fast. 1/2 second later (500ms) it will slow to less than 1/2 speed and finally after 1 second (1000ms) it will really slow down till completion.
The trick here is the timing.
IF you have feedback turned on that is can be more automatic.
if GetVariable("end_servo_1_pos") <> 2500 then
' set the servo position to extreme ... this will CHANGE with feedback
SetVariable "servo_1_pos", 2500
SetVariable "end_servo_1_pos", 2500
SetVariable "channel_1_rate", 5000
else
' adjust rate
diff = GetVariable("servo_1_pos") - GetVariable("end_servo_1_pos")
if diff < 0 then diff = - diff
if diff < 1000 then
SetVariable "channel_1_rate", 3000
elseif diff < 500 then
SetVariable "channel_1_rate", 2000
elseif diff < 100 then
SetVariable "channel_1_rate", 100
end if
end if
which will set the rate based on how far the servo has to go. You can play with the actual distance to speed values (or even create a formula which will transform distance into speed) to get the right ones for you.
Hopefully this gets you along the desired path.
STeven.
|
|