We all knew the Propeller could do it, but I hadn't seen anyone actually drive 32 servos with one Propeller chip.
I received a box of servos in the mail Saturday so I thought I'd give good ol' Servo32v7 a workout.
I've noticed nothing brings out a stammer like making a YouTube video. I find I have a hard time talking while keeping the scene framed in the viewfinder. It's a good thing I didn't try to chew gum at the same time.
My aim was to show each servo being controlled independently from the others. I used an oscillating movement with different servos being out of phase with each other. This "out of phase" aspect shows up as a rippling wave motion (I think it also allows one to walk through walls).
While I have these servos attached to these boards, I'd like to make a better demonstration video that shows off what the Propeller can do. I'm hoping for suggestions of what you all would like to see 32 servos be able to do.
Some things I know I can do with these servos are linear oscillating motion with individually settable end points, period of oscillation, the phase within the oscillation,
I also use an algorithm I call "pseudosinusoidal" to give the servo a bouncing motion where it travels slow near the end points while speeding up through the center area. I'd like to come up with some better sinusoidal motion algorithms that can be computed for 32 servos within the servos' 20ms refresh time.
One such motion I'd like to reproduce is that of a pendulum. I'd be happy with the simplified version of pendulum motion. The equation
I'd like to translate to fast Spin code is:
Angle as function of time = theta * cos(squareroot(g/l) * t)
theta is the angle at the pendulum's extreme.
g is acceleration from gravity.
l is the length of the pendulum.
t is time.
Assuming values of g and l aren't going to change, I could pre-compute squareroot(g/l) and use it as a constant. I'd still need to compute a cosine for each servo. Does anyone have a suggestion on the fastest way of computing cosines? I've always used F32 for trig functions but I have a feeling this will likely be too slow for this purpose.
I'll look through the various math objects and time the cosine functions I find. I'm just wondering if someone here as already made these comparisons.
Any other thoughts on what would make a good servo demo?
I figure I should have some sort of follow the leader where all the servos copy the movement of the servo next to it with a bit of time lag to show they aren't moving in unison.
What else should a Propeller servo demo do?