Mini-Maestro 24: Memory rewrite limitation


As part of an ongoing experiment (advanced camera motion control, still…), I am using the Mini-maestro onboard memory to “cache” data, and then use it to control servos.

Here’s the theory:

  • I store 2 potentiometers values every 250ms to the stack, for 12 seconds (I’m limiting it to 12 seconds - or 96 stack entries, so that I have a bit of room left on the stack for overhead)
  • Then, through a bunch of whiles, ifs, dups, peeks and pokes, the servos are controlled according to the stored values.

It all works in theory, and allows to record a 12 seconds manual motion and have it “played” back as many times as wanted.

My question: should I be worried about wearing out the onboard memory by filling/emptying the stack repeatedly? The script itself remains the same, but its execution constantly writes and reads stack values.

I could easily have that working connected to a PC with Python, but having the possibility to have the control arm in standalone mode is quite interesting.

The arm is almost finished (36" aluminium mini-crane, being machined and assembled), so I haven’t tried anything of that yet - but by the end of the week I should be able to enter the practical tests phases (hopefully the servos are gonna be powerful enough; the arm is already quite heavier than expected :smiley: ). I will post progress and results when I get some good stuff going!



Hello, alevesque.

The Maestro stack is stored in RAM, so there is no limit to how many times you can change it.

This sounds like a cool project! I would love to see some videos or pictures of it!


Amazing, thanks David.

I went from having no clue of what a potentiometer was, let alone how a servo works, to (attempting to) programming a PID system with modified servos on a pololu servo controller over the last 2 weeks - so obviously my questions here have been pretty basic. I am so amazed at the possibilities offered by this small board, you guys did an awesome job at packing a bunch of features while keeping things relatively simple and easy to learn.

If only there was a bigger model of the maestro line with more RAM - 126 values on the stack gets filled pretty quickly using it as a storage. But obviously this is not meant to be used like that…

Which makes me think - I was looking at the Logomatic v2 Serial SD Datalogger to store and use data that way… Can it be connected directly to the mini maestro through serial, and exchange data in realtime? It seems like it wouldn’t be a problem to store data on it with the maestro, at first glance, but can it communicate both ways through serial? So that the maestro could also use the stored data on it, to control the servos. Man, that would be awesome… Complex motion files created on a PC, saved on an SD card, and feeding motion data to the maestro…

Hello, alevesque.

The Maestro scripting language has no good way to receive incoming serial bytes, so I don’t think you will be able to connect it to that data logger. You might be able to connect it to an SD card, because the Maestro is capable of doing master SPI, but I would not do that. The Maestro’s scripting language is very limited and intended for simple applications. Instead I recommend getting a more capable processor which can take care of reading your potentiometers, logging data, and then sending serial Set Target commands to the Maestro to control the servos. Our Orangutan SVP-1284 is programmable in C and has 16 KB of memory. The mbed is even more capable, with 64 KB of RAM and a lot of flash memory which can probably be used for data logging.


Hi David,

Yeah, I know I would probably be much better served with a full fledge board, but I feel this is a bit over my head for now… Trying to get as much out of the mini maestro as it is manageable for my - limited - knowledge. I haven’t seen anything about master SPI with the Maestro in the manual, how would that work? Even though it is not advisable, just curious…

Thanks for your answers,


To do master SPI you can set two pins to be digital outputs, and use them as MOSI and SCK. Then you would set another pin as an input as use it as MISO. --David

Hmmm… Just searched about SPI, it actually seems like it could be an interesting avenue; may I ask why it is not advisable?

It could potentially solve my small stack problem, by allowing me to store more data for longer. The arm has only 2 DOF at the moment, but when it is completed it will have 6 DOF, so that would be 6 values to store every 250ms - giving me less than 5 seconds of recording if I go by the stack.

Thanks again for the support,


I would not connect a Maestro to an SD card mainly because I think it would be a lot of work and also because I think the end result will probably be slow; but I don’t know if it will be fast enough for your application.