Servo control

sbright33:
What you want is similar to my servo library. It allows a script in the form of an array in memory. It is designed for easing movements which change at least a few times per second. The data is meant to come from animation software, but I have yet to figure out how to export and import properly. How are you coming along?

Eh, this is a long term project, so as for how am I coming along? Very slow. Mainly because I'm doing three things at the same time: designing the various PCBs that go with this project (at least 4 different ones, they all stack), designing the enclosure (it's a pen and tilt light fixture), and writing the software.

Depending on the day, I will pick one of those to work on. This servers as my "anti burn-out" routine.

However, you did mention something there that got my attention. The easing part. I did think of this originally to avoid the sudden jerking but at the time decided on a "not yet" approach - perhaps for a later revision. However, I am still interested in figuring out how to do this. Last night as I was looking at some video of other, commercially available products, I realized I forgot something with my design, and this particular thread as well.

I keep thinking I'll be sending instructions to both servos at the same time, which may or may not be the case. I can certainly see a situation where I will tell one servo to move to a position as a slow rate, and a second later tell the other one to start moving. Basically moving away from my original idea that both will be receiving instructions at the same time. Now, that in itself isn't that big a deal, I can just as easy send an instruction to ignore whatever one of the servos is doing, and just address the other. I just have to adjust my timings for when the MCU comes back for more instructions.

This is where I'm open for suggestions. I suppose one could pre-program sequences which then get called later. For example, pre-program a sweep from 0 to 180 degrees and call it full_sweep_fwd and just call that function later. I think that gets gnarly though, especially if one starts doing arbitrary movements on an open-loop servo.

So yeah, I don't know. I'm just experimenting with ideas here. Thinking I'll just send angle/speed instructions and cross my fingers.