Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Sunday, June 29, 2008

The OZ connection

The software is finally (well...) done. I mean it is totally functional, does what it is supposed to be and it is absolutely beautiful to look at. The design is old-school, meaning lean, efficient and therefore aesthetically perfect on my book. Thanks to Philip for never being satisfied. In fact every day there is some internal change that makes it run faster or adds even more functionality.

I will provide pictures of the UI in full operation as it grabs puppet positions, controls lights, sounds etc. It feels a bit like those old music sequencers which were so intuitive and logical and therefore easy to use, yet produced any result that your imagination demanded. This is the case.

These are some current pics of the UI before anything is loaded. The puppet figure is just a place holder until the cameras, both for tracking and for position display are connected.



This last shot shows the tracking grid. All the application is done modularly so that everything can be customized, such as the resolution of the grid which in this case represents the size of the stage, basically 6x8 meters. Every cell triggers different responses from the Creator based on the performer actions and timing.

Wednesday, April 23, 2008

How to solve it

My apologies to George Pólya for quoting the title of his jewel of a book, but "How to solve it" made an indelible impression on me when I read it decades ago. I wish I had had him as my math teacher instead of the monster that expelled me from his class for having the nerve to record his "lectures" (which I did not understand) in what must have been one of the earliest portable recorders (the size of a worker's box lunch) that my dad, a very forward thinking man gave me as a present so I could use technology to help me in my studies. This wicked teacher foamed (he became redder than he was and I remember his veins bulging in his neck) that my intent was to make money with his awful expositions, when my only intention was to listen to it again at home and review the parts that were unintelligible to me. Remember it was the time (1960's) of slide rulers and solving logarithms, square roots etc. with pen and paper! and teachers which threw solid wooden rulers at students if they failed to pay attention.

In any case, this is how I went about it:

The two control strings for the head (1 and 4) allow it to not only turn left and right, but as I said before to tilt sideways and bow as well. In a traditional marionette these strings are played like an instrument, varying the tension, twisting and plucking.

When the marionette needs to kneel or jump etc. you are not really concerned with this since the entire body, head and all is balanced by your hand, which uses your own personal embedded experience as a subject of gravity to effect movements which prove extremely hard to program convincingly. Imagine for example that you want the character to tilt his head slightly in an inquisitive way while bowing and kneeling at the same time. If you try to break that into individual movements performed by individual muscles of your hand, fingers and arm you will picture the complexity of the apparent simplicity. Don't forget that I said tilt his head in an inquisitive way!

So, in my dream I must have followed some of the principles Pólya suggests to poor souls in distress, like for example:
  • Look for a pattern
  • Draw a picture
  • Solve a simpler problem
  • Use a model
  • Work backward
  • Use a formula
  • Be ingenious
The 'head' strings reach the horn which would turn the head left and right and you would think that is where the strings should end. Then I visualized (and this is what comes from the dream) that the strings at that point corresponded to my left hand fingers twisting them while my right hand controlled the other movements in unison.

So I let the strings continue on to the other 'hand' which would pull or let go to let the gravity do its thing. The combination of these elements (including the most important, gravity) give you a very rich and expressive palette of head "language". This of course I cannot convey simply by pictures, but I will eventually post a video of the movements.

The 'other hand'

I continued raiding my wife's sewing supplies and used this perfect and beautiful spool, which I epoxied to the servo horn (you can still see behind the spool the gray irregular shape of the rock hard Apoxie that I used. Need to refine that.)

There was another problem, which because of its apparent simplicity tends to be forgotten until it is too late. Remember the analogy with a string instrument. So it is that you must tune the strings of your marionette to the perfect tension which allows precise control while at the same time giving gravity and inertia room to infuse the movement with the illusion of life.

Easier said than done. First of all the strings are very thin and usually waxed or Teflon coated to prevent fraying. That makes tying and untying knots practically impossible. Then consider the awkward and tight places where the strings are connected. Finally, size. Things that are very easy at a human scale become wickedly difficult in Lilliput.

Bowl of Sushi by Hiroshige (Edo Period)

My love of sushi came to the rescue. Chopsticks! the bamboo sticks have the right diameter, are pleasant to touch and sight (and taste) and its transversal structure provides the friction necessary to prevent the 80 lb. Teflon string from sliding. This was my prototype but although it stopped that string diameter from sliding, my preferred string is .006" Fireline, which is a braided bead thread very strong and resistant to abrasion (it is used to weave the smallest glass beads). This string just went through my tensioner like a water snake.


So I refined my prototype incorporating an opposing path that effectively holds it in place. And what is more important and the reason for this exercise, it is easy to adjust as needed, to tune the strings of the instrument.


Tension is good when needed

Monday, April 21, 2008

Sense and sensibility and the Oneironaut

Visualizing the user interface for servo control

The nervous system is the current step (by step). Working on the sensors and on the beacons has given me a clearer understanding that there is nothing I know. Still very very far from The Docta Ignorantia.


Here is our microprocessor stack composed of two Make boards which were our final choice. The boards are highly integrated, very easy to interface and simply well designed. The only drawback was the limitation of 4 servo ports per board. I decided early on that 8 motors were as many as I wanted to use, both for practical and symbolic reasons. Four is the symbol of man generated by the trilogy which comes from the duality contained in the unity (bear with me, it is a stream of thought). 8 represents the power of the king in chess, and the queen in all her potency and (coming down to earth), I could only afford two Make controllers anyway! So, there. I had to do it with only 8 motors, period.

Then came the IR beacon circuit. That was a lot of fun to build although it took a lot of trial and error to do it with kitchen stuff. DYI instructions stipulate in no uncertain terms that you should use glossy inkjet paper and ONLY print with a laser printer, then iron transfer into the copper plate. Well, after many frustrating trials, botched plates and burnt fingers we (Philip and I) decided to try swhat you are not supposed to do. Went to our local print shop and had the circuit printed on their glossiest color laser paper with their fancy color printers. That worked beautifully. It transfered absolutely perfect the first time around. The entire coating of the paper stuck to the plate, and I am sure more than one has though that was wrong, but after soaking it in warm water the paper peeled off like a decal and left an impecable mask.

So here is Philip, which was the instigator of the whole DYI circuit idea cooking up the circuit with a coctel of muriatic acid mixed with hydrogen peroxide. In a few minutes our circuit was done. As usual he is multitasking with his totally hacked IPhone.




Guess where Philip is from...



Philip in my studio dremelin the circuit holes while Castro look approvingly at our socialist methodology.

He got a kick out of my retro-futuristic glasses. You look awful in them, but they have a variable focus that allows you to magnify minute stuff or read a newspaper across the room.



This section needs proofing and revising...tomorrow, after I give my class and deal with insane bureaucracy.

After dealing with the obvious and easy choices, like the arms (4 motors there) I realized the problem. My monster servo would lower the body, yes. But what about the head?, the shoulder strings? (they allow the marionette to turn the upper part of the body to face in another direction). They had to be lowered at the same time! otherwise I would need many more motors and complex programming to synchronize all these elements.

So the idea of the elevator was born, with all its ancillary problems, weight, friction, balance, stability, randomness, etc. At first I built tracks to guide the (square!) rods up and down. These rods (quads?) support a platform that houses the 3 remaining servos. The problem is that the head has more than one degree of freedom of course. It not only has to turn left and right, it also has to tilt sideways and bow as well. Or pitch, yaw and roll if you will.

All these simple motions are trivial (if difficult to master) in a marionette. Then I had the shoulder controls to turn the body around; how to do all that with 3 servos and control the wanted nuances?

After about two weeks (which is the time I have not posted!) I stumbled upon the solution, where but in a dream!. It is pretty obvious that we work as hard in our oneiric universe as we do in our waking world.

Next morning I skeptically went to examine the contraption with the suspicion that, like many other "great ideas" conceived in la-la land it would turn to be impractical, impossible or just plain turdy. It actually took me a while to connect my ideas with the reality of the mechanics, something was missing which I had apparently forgotten. Then, all of a sudden I saw it! make one of the servos perform double duty.

I cannot even explain how I visualized it. It was so obvious, simple, and yes, elegant. The only bummer is that I feel it did not come from me but from the collective unconscious debris. I just picked up the pieces.

I will post some pictures to explain how it works.