I am using the 12-channel servo controller via the serial interface. I am trying to set speed before the servos move. However, the speed setting doesn’t take effect until the servo has moved a first time.
So I first send:
0x87, 0x00, 0x10, 0x00 (Compact protocol)
then I send:
0xFF, 0x00, 0x7F (MiniSCC protocol)
The speed setting does not take effect. However if I send:
0xFF, 0x00, 0x7F (Compact protocol)
again, the speed setting has effect.
What is wrong?
When the Maestro first starts up, it has no way of determining what position the servos are in (servos do not make their internal feedback available). The only thing the Maestro knows about the servo positions is the last pulse width that it sent. When a channel has a speed (or acceleration) limit, the Maestro uses the most recent position command and the new position command to break the movement into multiple smaller divisions. Because of this, the first command sent to a servo will not use the speed setting. More information about this, including suggestions of how to get around it, can be found in the last question under the “FAQ” tab of the Maestro product page.
Thank you! I’m going to store the servo positions in an external EEPROM everytime I move them, so I’ll know what they are at startup. The alternative is to set the servos to a pre-defined position at shutdown, but in robotics, a shutdown may not be controlled.
I am glad you found that information helpful. By the way, I am not familiar with your setup, but EEPROM typically has a limited number of erase/write cycles, which might be a concern if you are moving your servos on a regular basis and constantly saving new positions to your EEPROM.
That’s a good point! I was too fast in that reply Flash memory is a good option, right? I am using a Raspberry Pi, so I could store settings in the filesystem, but I like to keep settings away from the hard disk.
Flash memory also has a finite number of erase/write cycles.
What are my options for persistent storage?
Flash memory and EEPROM are the two persistent storage options that I am familiar with. If your system only updates the servos periodically, it might be practical to use one of those. Otherwise, you could try limiting the frequency that you store the values. For example, you could store values only when your system shuts down, which as you pointed out before, is only helpful when the system is purposefully shut down.
There might also be other options you can look into such as SD cards with wear leveling.