November 21, 2024, 10:50:34 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Choreographing Motors :)

Started by ilusion, October 09, 2007, 10:47:28 PM

Previous topic - Next topic

ilusion

Ok, I'm about to undertake writing the code to control a very large prop-- a ~16 foot tall entertainment robot for Maker Faire! The robot will have a number of movable parts (elbow rotation, shoulder rotation, eye movement, lights, smoke machines, sound systems, etc) and I'm trying to figure out the best way to program all the actions so they seem to occur in parallel and not look "pre -programmed" per se. In effect, "choreographing" the motions and effects.

I plan to use the Prop-2, the Motormind C units from Solutions Cubed for the big motors,  Parallax Serial Servo Controller for the servos (eye movement and other small effects), RC4's for light controls and a DC-16 for solenoids and low voltage lighting (LEDs) and a couple of uMP3 modules for music and sound FX.

I've seen how Jon uses DATA statements to hold position and time values, and I've also seen (and done) some "do something then pause x, lather-rinse-repeat" type code approaches. :)  But I wanted to see if anyone had any other approaches to doing this sort of task. I do not plan to use a PC to operate things (i.e. VSA or Vixen) as I prefer the stability and cost effectiveness of the stamp.

So, if anyone has an idea for a flexible framework or method (program-wise) to do this type of complex synchronization, I'd love to hear about it.  :)

Vern
--
"Why are we in this Handbasket? And where are we going?!"

JonnyMac

My DATA table approach is simply a storage-effect way to implement "do-something, pause, and rinse" approach.  The beauty with the BS2 is storage space and the ability of the compiler to resolve table addresses (via their label).  You could in fact create separate movement tables for each element of your prop and blend them together as you desire.  I'm sure you're aware that it will be a lot of work -- still, I think the table driven approach will let you mix-and-match motions with the greatest ease and flexibility.

Hint: Keep a pointer for each independent table; that will let them be of different lengths.
Jon McPhalen
EFX-TEK Hollywood Office

ilusion

Quote from: JonnyMac on October 10, 2007, 08:06:07 AM
My DATA table approach is simply a storage-effect way to implement "do-something, pause, and rinse" approach.

After a bit of experimentation, it would seem that data tables are the way to go for putting together scenes. The issue I'm up against now is that I have limit switches for the arms and shoulders and I need to figure out a way to use data tables to turn on a motor, then wait for a limit switch to hit so I know it has reached its position... Still trying to figure that one out...

Vern
--
"Why are we in this Handbasket? And where are we going?!"

JonnyMac

You might create a timing subroutine to encapsulate PAUSE and check limit switches there.
Jon McPhalen
EFX-TEK Hollywood Office