24 ch question

Hello.
My name is Lars and I’m quite new to this, so please forgive any obvious fault I might done…
I have the following code and what I try to achive is after each sequence I “turn off” my servos to avoid servo jitter. I know this might be the wrong way to solve this, but I have a robot for display only, and I need it to be “quiet” in between the sequences.
My problem is that even do I try to set the speed and acc. it is 100% on both after I turned the servos off the first time. To solve this
I added the speed and acc. parameters in the begining of each sequence with out success. Can anyone explain what I doing wrong?

# When the Maestro script is not doing anything else,
# this loop will listen for button presses. When a button
# is pressed it runs the corresponding sequence.
begin
button1 if sequence1 endif
button2 if sequence2 endif
button3 if sequence3 endif
repeat

# These subroutines each return 1 if the corresponding
# button is pressed, and return 0 otherwise.
# Currently button1 is assigned to channel 18, 
# button2 is assigned to channel 17, and
# button3 is assigned to channel 16.
# These channels must be configured as Inputs in the
# Channel Settings tab.
sub button1
22 get_position 500 greater_than
return

sub button2
21 get_position 500 greater_than
return

sub button3
20 get_position 500 greater_than
return

# These subroutines each perform an arbitrary sequence
# of servo movements. You should change these to fit
# your application.
sub sequence1
80 0 acceleration
80 0 speed
80 1 acceleration
80 1 speed
80 2 acceleration
80 2 speed
80 3 acceleration
80 3 speed
#500 delay
5120 0 servo
5120 1 servo
5120 2 servo
5120 3 servo
3000 delay
7680 0 servo
7680 1 servo
7552 2 servo
7680 3 servo
500 delay
0 0 servo
0 1 servo
0 2 servo
0 3 servo
return

sub sequence2
80 0 acceleration
80 0 speed
80 1 acceleration
80 1 speed
80 2 acceleration
80 2 speed
80 3 acceleration
80 3 speed
80 6 acceleration
80 6 speed
80 7 acceleration
80 7 speed
80 8 acceleration
80 8 speed
80 9 acceleration
80 9 speed
80 10 acceleration
80 10 speed
#500 delay
5120 0 servo
200 delay
5120 1 servo
200 delay
5120 2 servo
200 delay
5120 3 servo
350 delay #extra delay between upper panels and side panels
5632 6 servo
200 delay
5120 7 servo
200 delay
4928 8 servo
200 delay
4928 9 servo
200 delay
4928 10 servo
200 delay
500 delay
7104 10 servo
200 delay
7040 9 servo
200 delay
6976 8 servo
200 delay
7040 7 servo
200 delay
7744 6 servo
200 delay
7680 3 servo
200 delay
7552 2 servo
200 delay
7680 1 servo
200 delay
7680 0 servo
500 delay
0 0 servo
0 1 servo
0 2 servo
0 3 servo
0 6 servo
0 7 servo
0 8 servo
0 9 servo
0 10 servo
return

sub sequence3
80 0 acceleration
80 0 speed
80 1 acceleration
80 1 speed
80 2 acceleration
80 2 speed
80 3 acceleration
80 3 speed
80 6 acceleration
80 6 speed
80 7 acceleration
80 7 speed
80 8 acceleration
80 8 speed
80 9 acceleration
80 9 speed
80 10 acceleration
80 10 speed
#500 delay
5120 0 servo
5120 1 servo
5120 2 servo
5120 3 servo
5632 6 servo
5120 7 servo
4928 8 servo
4928 9 servo
4928 10 servo
3000 delay #can be changed to 10000 for 10 seconds delay
7104 10 servo
7040 9 servo
6976 8 servo
7040 7 servo
7744 6 servo
7680 3 servo
7552 2 servo
7680 1 servo
7680 0 servo
500 delay
0 0 servo
0 1 servo
0 2 servo
0 3 servo
0 6 servo
0 7 servo
0 8 servo
0 9 servo
0 10 servo
return

Hello, Lars.

When you turn off the servo by setting its target to zero (e.g. 0 9 servo), the servo can move freely. When you later tell the servo to go to some position, the Maestro has no way to knowing where the servo currently is, so it doesn’t know what the starting point would be for a smooth movement, so it cannot do speed or acceleration limiting.

The solution is to tell the Maestro what position you think the servo is in when it wakes up. Here is the basic idea:

5000 9 servo   # last position in a sequence of servo movements
...
0 9 servo   # turn off servo at position 5000
...
5000 9 servo  # turn on servo!
20 delay
6000 9 servo  # move servo to new position

You would need to write your script so that it somehow knows what position the servos are in whenever it needs to reactivate them.

This sounds like a cool project! Please post a video of it when you have it working correctly!

–David