Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Store a position and later recall it

I’m hoping the Maestro is the solution I need.
Can the Maestro store a servo position in a buffer and later recall it?

My current solution is to use the Tic and stepper motor. I have a mechanical switch that selects between two potentiometers for positioning. I use one pot to trim “high gear” and the other pot to trim “low gear” and switch between the two “gears” with the SPDT switch.

I’d like to be able to use a servo and buttons now (like a big boy). I know the Maestro can do the trimming with ‘PLUS/MINUS’. But the Maestro would also have to be able to store a position and later recall it with a button press. Possible?

Thanks
Zumo1

Hello.

You could certainly write a Maestro script that does something like that. There are a couple of ways to go about it. For example, you could put the position value on the stack, and leave it there for later, which is generally fine, but can be a little clunky if your script gets more complicated. If you have a spare unused servo channel, another option would be to use that as a dummy channel to hold the desired position value. Then, you can read the position of that channel later when you need it and keep the stack clean.

Please note that these methods wouldn’t save a position value through power cycles; you would not be able to do that through just a Maestro script.

If you try to write a Maestro script that does this and have problems, you can post what you have so far and I’d be happy to take a look.

Brandon

I’m finally getting on with this project.
I’m having trouble with the moving_state command.
Does not work for me. So how does the maestro know that the servo is moving… does the servo need position feedback capability?

I found this:
“Servos do not make their feedback available, so the Maestro has no way of knowing whether a servo actually made it to its target. The only thing the Maestro knows is the last pulse width that it sent the servo. When a channel has a speed or acceleration limit, the Maestro will break the set position into multiple smaller divisions, giving it a reference for the position of the servo. Then, the “Get Moving State” command can be used to check if the Maestro has finished sending all of the intermediate pulses associated with the last target it was given. It will only return a 1 if the last pulse width sent to the servo did not correspond to the actual target position. Without a speed or acceleration limit, the Maestro will send the pulse width corresponding to the target position immediately, so the “Get Moving State” command will always return 0.”

But for some reason not working for me. I’m using a muti-turn servo.
Maybe it is just too slow to react to the smaller division pulses. I’ll try a standard servo to see if the function works.

It sounds like you found the answer to your first question; the Maestro assumes the servo is at the position is it currently sending. So, what GET_MOVING_STATE really does is tell you if the Maestro is currently sending the target position you told it to. Without a speed or acceleration limit, it will always return 0 since it will immediately send the target position. If you set a speed or acceleration limit on that channel, it will return 1 until the current position being sent matches the commanded target position. The speed of your actual servo should not matter since the Maestro does not know where your servo actually is.

In what way is it not working for you (e.g. is it always returning 0)? What did you configure the speed and acceleration limits of that servo channel to? If you continue having problems, can you post your Maestro settings file? You can save your settings file from the “File” drop-down menu of the Maestro Control Center while the controller is connected.

Brandon

I understand that the Mini 24 is limited to 12 analog inputs and 12 digital inputs. I don’t know the difference.

In the “7.b. Attaching Servos and Peripherals” there are only buttons, servos, potentiometer and LED described. Only the potentiometer is noted as analog.

So my question are:
On the Mini24, how many buttons (with appropriate pull-up resistor) can be attached?

On the Mini24, how many of your “Pololu Carrier with Sharp GP2Y0D805Z0F Digital Distance Sensor 5cm” can be attached?

Thanks