Servo Speed/Acceleration/Smoothness Control

New to playing with the Maestro and this particular type of coding. Using a 12 channel maestro on a robot with servos in hands, arms, and 3 body gears. I am attempting to make various movement sequences like dancing, general movement all with different speeds. Using gobilda torque servos

This is 2 basic movements , very robotic and slow. I know playing with the speed and acceleration helps make the movements smoother, but not sure how to get that into the code successfully to change movement between servos in a frame. The channel speed/acceleration setting seems to apply to all frames/sequences and while acceleration makes it faster, it is jerky. I was playing with the get_while_moving script with some success getting them to move quickly and smoothly , but not sure how to translate that into the script i already have? or if there a better way of going about it ? if you can assign different channel settings to sequences etc. I appreciate any feedback or example of code to play with.

r0xi 1-25.txt (10.1 KB)

Hello.

To set certain speed and acceleration values for each movement, you will need to manually modify your script by adding `SPEED` and `ACCELERATION` commands as needed.

It looks like your sequences are quite long, so to keep it short and simple, I will use the sequence below as an example:

``````# Sequence 0
sub Sequence_0
500 3968 8000 0 0 0 0 frame_0..23 # Frame 1
500 8000 3968 frame_0_1 # Frame 2
return
``````

Letâ€™s say we wanted to change the speed and acceleration of servo 0 to 10 and 5 respectively for the first movement (Frame 1) then to 20 and 50 for the second movement (Frame 2). We can insert the `SPEED` and `ACCELERATION` commands on the line before each frame, like this:

``````# Sequence 0
sub Sequence_0
10 0 speed  #set the speed of channel 0 to 10
5 0 acceleration  #set the acceleration of channel 0 to 5
500 3968 8000 0 0 0 0 frame_0..23 # Frame 1
20 0 speed  #set the speed of channel 0 to 20
50 0 acceleration  #set the acceleration of channel 0 to 50
500 8000 3968 frame_0_1 # Frame 2
return
``````

Please note that when you set a speed or acceleration, it will persist for all subsequent movements until it is changed again or the Maestro is reset.

Brandon