Vary servo speed between sequences

New here, still working on learning he interface. I want to create a sequence to move a servo from point A to point B fast, then to point C slowly. I cannot figure out the settings for this. Is the channel setting global? I have created a seq,(seq 1) then changed the speed and accel settings for seq 2, but that also changes seq 1. Ideas?
Tnx!
Jim in Sweden

Hello, Jim. What Pololu product do you have? The full name and a link to the product page will let us help you effectively.

If you’re talking about one of our Maestro servo controllers, the answer is that the sequencer feature built into the Maestro Control Center does not record the acceleration or speed of a servo. So if you are just using the sequencer to control servos, you are stuck with one speed and acceleration setting for each servo. This can be set in the Channel Settings tab.

You could copy the sequence to a script and then add commands to the script in the right places to change the speed and acceleration limits of the servo.

–David in Las Vegas

Thanks David,
I have a Maestro 6, and I was trying, as you said to change the parameters in the script and code. Not fully versed in the language there, yet. You did answer my question. On a Saturday, no less! Get a life! :wink:

David Hi. I have the same issue so thought I would Hijack the post.
Im a little disapointed this isnt as straight forward as I would like but hopefully we can work around.
I too would like the servos to change speed throughout their sequence, so to jump to one position, then creep back. I’ve been going through the manual and dont see anything on coding this. Here is my code:

[code]# Dancing Shoes V1
begin

11 get_position # get the value of IR Sensor
512 less_than # test whether Sensor is low or high -> 1 if true, 0 if false
if
500 5641 5631 6273 6334 6575 5647
5856 6272 8000 0 0 frame_0…10 # Frame 0
1500 6304 8172 frame_2_3 # Frame 1
2000 6153 frame_3 # Frame 2
2000 8172 frame_3 # Frame 3
1000 7629 9257 frame_2_3 # Frame 4
2500 6273 frame_3 # Frame 5
1000 6213 frame_2 # Frame 6
500 4646 frame_3 # Frame 7
500 8082 9408 frame_2_3 # Frame 8
500 5279 frame_3 # Frame 9
500 6966 9408 frame_2_3 # Frame 10
500 8654 frame_2 # Frame 11
500 6304 frame_3 # Frame 12
500 4676 frame_2 # Frame 13
1000 6304 frame_2 # Frame 14
1000 4389 5870 4946 frame_5…7 # Frame 15
1000 5632 6272 frame_5_7 # Frame 16
1000 8006 7360 frame_4_6 # Frame 17
1000 4992 4352 frame_4_6 # Frame 18
1000 7232 7680 frame_5_7 # Frame 19
1000 6544 5600 5841 6258 frame_4…7 # Frame 20
1000 9408 3200 frame_2_3 # Frame 21
1000 6304 6243 frame_2_3 # Frame 22
1000 3230 8000 5882 6545 frame_0…3 # Frame 23
1000 7750 4887 frame_0_1 # Frame 24
1000 5550 5475 frame_0_1 # Frame 25

else
1000 delay

endif
repeat

sub frame_0…10
10 servo
9 servo
8 servo
7 servo
6 servo
5 servo
4 servo
3 servo
2 servo
1 servo
0 servo
delay
return

sub frame_2_3
3 servo
2 servo
delay
return

sub frame_3
3 servo
delay
return

sub frame_2
2 servo
delay
return

sub frame_5…7
7 servo
6 servo
5 servo
delay
return

sub frame_5_7
7 servo
5 servo
delay
return

sub frame_4_6
6 servo
4 servo
delay
return

sub frame_4…7
7 servo
6 servo
5 servo
4 servo
delay
return

sub frame_0…3
3 servo
2 servo
1 servo
0 servo
delay
return

sub frame_0_1
1 servo
0 servo
delay
return

[/code]

So its pretty standard, but I’ve added in the if function for an IR trigger.

This language is a little baffling to me, but I can follow how the software has compiled the code into sub frames, and I can see in the bulk of the code how the frame time (in ms) is the first set of numbers, followed by each position for the servos. Then I think it uses sub routens to link those positions to the corresponding servo, only listing those that need to change?
So my question is:

  1. Can you link me to anything that explains how to change the speed and acceleration setting using the script?
  2. Can you give me an example? Say if on Frame 11 I wanted to change the speed of the servo on channel 2 to 20, what would that look like please?

Many thanks in advance!

Hello

Following abit more reading (which now made sense following having written my own explanation of how the coding works) I have cracked this.
Using the command speed and acceleration, as listed in the command reference, the code line would look like:

with 20 being added to the stack first, to become the speed value, and 0 added to the top of the stack, to reference which channel/servo it relates to. You then must add a similar line in before the next command, or at the start or end of the loop to set it back for the next play.

so to answer question 2:

[code]# Dancing Shoes V1
begin

11 get_position # get the value of IR Sensor
512 less_than # test whether Sensor is low or high -> 1 if true, 0 if false
if
0 2 speed #reset to starting speed
500 5641 5631 6273 6334 6575 5647
5856 6272 8000 0 0 frame_0…10 # Frame 0
1500 6304 8172 frame_2_3 # Frame 1
2000 6153 frame_3 # Frame 2
2000 8172 frame_3 # Frame 3
1000 7629 9257 frame_2_3 # Frame 4
2500 6273 frame_3 # Frame 5
1000 6213 frame_2 # Frame 6
500 4646 frame_3 # Frame 7
500 8082 9408 frame_2_3 # Frame 8
500 5279 frame_3 # Frame 9
500 6966 9408 frame_2_3 # Frame 10
20 2 speed #speed changed before servo movement
500 8654 frame_2 # Frame 11
500 6304 frame_3 # Frame 12
500 4676 frame_2 # Frame 13
1000 6304 frame_2 # Frame 14
1000 4389 5870 4946 frame_5…7 # Frame 15
1000 5632 6272 frame_5_7 # Frame 16
1000 8006 7360 frame_4_6 # Frame 17
1000 4992 4352 frame_4_6 # Frame 18
1000 7232 7680 frame_5_7 # Frame 19
1000 6544 5600 5841 6258 frame_4…7 # Frame 20
1000 9408 3200 frame_2_3 # Frame 21
1000 6304 6243 frame_2_3 # Frame 22
1000 3230 8000 5882 6545 frame_0…3 # Frame 23
1000 7750 4887 frame_0_1 # Frame 24
1000 5550 5475 frame_0_1 # Frame 25

else
1000 delay

endif
repeat

sub frame_0…10
10 servo
9 servo
8 servo
7 servo
6 servo
5 servo
4 servo
3 servo
2 servo
1 servo
0 servo
delay
return

sub frame_2_3
3 servo
2 servo
delay
return

sub frame_3
3 servo
delay
return

sub frame_2
2 servo
delay
return

sub frame_5…7
7 servo
6 servo
5 servo
delay
return

sub frame_5_7
7 servo
5 servo
delay
return

sub frame_4_6
6 servo
4 servo
delay
return

sub frame_4…7
7 servo
6 servo
5 servo
4 servo
delay
return

sub frame_0…3
3 servo
2 servo
1 servo
0 servo
delay
return

sub frame_0_1
1 servo
0 servo
delay
return[/code]

If anyone else wanted to know…

Hi, Zakari.

It sounds like you were able to answer your own questions. Thanks for letting us know you figured it out.

-Derrill