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

Digital signals are only meant to be interpreted as just one of two states, usually something like 1/0 or on/off. In the case of a button with the Maestro, this would be something like 0V or 5V. Whereas, an analog signal can be interpreted as many states. For example, a potentiometer typically outputs a voltage from 0-5V depending on the position it is in. When read from a Maestro’s analog input pin that can give you up to 1024 unique readings between 0V and 5V.

Please note that the pins on the Maestro that can handle analog inputs can also handle digital inputs, but it does not work the other way around (you cannot use a pin only capable of reading digital inputs to read an analog signal).

With that in mind, since buttons and the Sharp GP2Y0D805Z0F distance sensor both use digital signals, you can use all 24-channels on the 24-channel Mini Maestro to read them.

Brandon

Thanks Brandon.

That is what I thought. But when the “Maestro Comparison Table” broke out the A/D input channel limitations it didn’t make sense to me.

So I can use the digital output of the sensor to a Micro6 input even tho the “Maestro Comparison Table” says the Micro6 has 0 ‘Digital input channels’. Very confusing to me.

Do I still need the pull-up resistor with the digital sensor?
If I already have the resistor installed can I leave it?

You do not need pull-up resistors with the Sharp distance sensors. It should be okay to leave them if you already installed them though.

Brandon

The Maestro inspires me… new project:
All of the programming is working!
But I’m having instability issues and crashing. For this project I have photocells/diode connected to four channels. When the voltage goes low (dim light hitting photocell) Maestro triggers an action. Of course this leaves unstable floating input. What is the way to solve for this? Would a voltage divider at 0.5~1.0v on the signal input cure it?

thanks

You can generally add a pull resistor to bias the reading when the signal would otherwise be floating. In some situations a pull resistor can also help prevent shorts.

A photocell is essentially just a variable resistor, so you can use a pull-down resistor on the signal pin to bias the reading instead of leaving it floating.

In this setup, it will essentially form a voltage divider with the step-down resistor where the reading at the signal pin will be high when the photocell’s resistance is low and as the resistance increases, the voltage on the pin will decrease. The specifics will depend on your photocell, the environment you use it in, and what value resistor you pick for the pull-down. 10kΩ is probably a good starting point for a pull-down resistor, but you will likely want to do some testing in your specific environment to see what kind of variability you get from the photocell, and adjust it as needed.

If you continue to have problems with “instability and crashing”, you can post a copy of your Maestro settings file and pictures of your setup that show all of your connections, and I’d be happy to take a look. You can save a copy of your settings file from the “File” drop-down menu of the Maestro Control Center while the controller is connected

Brandon

I did some testing of the Drop-down resistor. It seems to be a balance of how hard to shut down the signal but then adding noise to the open 5v. I see now that .8v seems standard for low-v. In fact the project is working great without the PDR. It was not the LV that was causing the problems… Subroutine over-runs of course. It is running clean now. So the lesson is, don’t use Subs within Subs. Use labels and the goto command within Subs. Very smooth running now.