Speed-Acceleration

Should I be able to adjust the Speed/Acceleration Frame by Frame? I’m unable to do so. If I change either setting, it takes that setting and applies it to all Frames. Do you have any documentation which explains the use and effects of Speed/Acceleration?

thanks,

Hello,

Our sequences just save positions. However, if you save your sequence to a script, it is pretty easy to add real-time acceleration and speed changes to the script.

Have you read the information about speed an acceleration in the User’s Guide already? Basically, they slow down and smooth out your servo motion; there is not that much to it.

-Paul

I’ve read the User Guide and found the SET SPEED and SET ACCELERATION on pg 40, but what is the syntax? “Set Speed 100” ?? simple as that?

Also, I had a simple 2 frame sequence that move the arm CW then back CCW. I copied the sequence to the script and Maestro put it into a loop. Why is this? I deleted the BEGIN and REPEAT and on the 2nd time through, it error’d out. “The script has stopped because of an error. You must restart the device to continue.” Below is the code as copied from the sequence. Note that I deleted the begin & repeat and the error on “10 servo”

# Blink
begin 'I deleted this
250 5981 0 0 0 0 0
0 0 0 0 0 0 frame_0…11 # Frame 0
250 2432 frame_0 # Frame 1
repeat 'I deleted this

sub frame_0…11
11 servo
10 servo 'it error’d on this line the 2nd time through
9 servo
8 servo
7 servo
6 servo
5 servo
4 servo
3 servo
2 servo
1 servo
0 servo
delay
return

sub frame_0
0 servo
delay
return

Hello,

It sounds like you are getting confused between Serial Commands and Script Commands. Please take some time to read over the introduction to scripts so that you can understand how they work. The speed and acceleration commands are just called SPEED and ACCELERATION, and in general you have to put the arguments before the commands. Like “100 speed”.

“Copy sequence to script” puts it in a loop. That’s just how we designed it, because we thought that would be the way that is most useful to people. If you want to delete the loop, you will need to add a QUIT command at the end, or else there is nothing to stop code execution.

If you encounter further errors, please check the errors tab for details.

-Paul

Where in my code below is “100 speed” suppose to go? I’m really trying to understand this programming but your documentation does not talk or give examples on how to use it these Commands. Is there any documentation, even beyond Pololu, that can give a beginner more information?

# Blink
begin
250 5981 0 0 0 0 0
0 0 0 0 0 0 frame_0…11 # Frame 0
250 2432 frame_0 # Frame 1
repeat

sub frame_0…11
11 servo
10 servo 'it error’d on this line the 2nd time through
9 servo
8 servo
7 servo
6 servo
5 servo
4 servo
3 servo
2 servo
1 servo
0 servo
delay
return

sub frame_0
0 servo
delay
return

Hello,

First of all, sorry, I should have said something like “100 0 speed” to set the speed of servo 0 to a value of 100. You have to specify the servo number.

Anyway, you can put it wherever you want, but the most reasonable place to do it would be before one of the lines that represents a frame. For example, you could do this:

begin
  250 5981 0 0 0 0 0 0 0 0 0 0 0 frame_0..11 # Frame 0
  100 0 speed # set servo 0 to speed 100
  250 2432 frame_0 # Frame 1
repeat

In this example, the speed of servo 0 would start out at the default, get set to 100 right before the first execution of frame 1, then remain at 100 for the rest of time. If you wanted to reset it to, say, 200 at the beginning of each loop, you could do

begin
  200 0 speed # set servo 0 to speed 200
  250 5981 0 0 0 0 0 0 0 0 0 0 0 frame_0..11 # Frame 0
  100 0 speed # set servo 0 to speed 100
  250 2432 frame_0 # Frame 1
repeat

We do not have examples for every single command, but there are examples of how to use speed and acceleration in the example scripts section. I think that once you understand the basic idea of the programming language, you will get it. But feel free to keep posting your attempts here, and we can try to guide you through it.

-Paul

Paul, thanks for that info. I’m getting slightly closer to understanding. I learn from dissecting example code and what confuses me is when I copy the frame to a script, it presents itself in a manner that has no relation to the example code presented in the guide.

Syntax wise -

250 5981 0 0 0 0 0 0 0 0 0 0 0 frame_0…11 # Frame 0
and
4000 0 servo

have no relation to each other. I just need to understand why “250 5981 0 0 0 0 0 0 0 0 0 0 0 frame_0…11 # Frame 0” is there. I don’t find it explained in the guide so I get frustrated and I don’t want to keep asking simple questions. But I guess that’s what I have to do. thanks again for the help - and I can guarantee you’ll hear from me again. dcg

Well, I am not sure what you mean when you say that they have no relation to each other. In both cases, you have a bunch of numbers followed by a command. The difference is that frame_0…11 is a subroutine defined below that sets the positions of all 12 servos and does a delay, while SERVO just sets a single servo. It looks a bit confusing because all of the numbers are right next to each other, which saves a significant amount of memory.

Have you tried stepping through the program and watching the stack to see how it works?

-Paul

Ah, things are becoming clearer. Can you clarify this…

A line from an exported Frame in SCRIPT view looks like this:

250 5981 0 0 0 0 0
0 0 0 0 0 0 frame_0…11 # Frame 0

But your example runs this line together (which makes more sense)

250 5981 0 0 0 0 0 0 0 0 0 0 0 frame_0…11 # Frame 0

Any other other programming I’ve done would have SCREAMED if the line was not complete. How can this happen - what are the rules on this?

thanks

Well, I put them on the same line to make it more clear to you.

I really think you have not read the Maestro Script Language Basics section of our manual. The second section addresses line breaks very explicitly!

-Paul