Showing posts with label analogue. Show all posts
Showing posts with label analogue. Show all posts

11 November 2014

Testing Other Sensors....

After the success of my initial proof of concept for this project in which I used a trio of potentiometers to adjust the rotational attributes of the test object, I started to think about other means by which I could record the motion from my puppet controller.

With some consideration towards the type of motion that would be required to replicate a Muppet style puppet I decided that the best options at this stage were to investigate flex sensors and gyros.

A flex sensor is basically a variable resistor that is adjusted through a bending motion, ideal for use in glove type control applications.... check out the Nintendo Power Glove from 1989, a neat idea but perhaps a bit ahead of it's time it used flex sensors in the fingers.


Gyro's and accelerometers are found in pretty much all smart phones and tablets. These chips enable the device to orient the screen when it's rotated and are used in a lot of games that rely on motion to control the action rather than a traditional control system... take Doodlejump for example.


The following video demonstrates my application of functionality from these two devices through Arduino in a Maya environment.



Applying the data from the gyro and flex sensor was possible without too much adjustment to my original Maya python code. Both of the sensors are great but, despite being calibrated, the gyro can get a bit lost if it's moved about to much which requires the device to be reset on a regular basis.

In light of this test I have ordered a new gyro, the MPU 9150, which has a built in magnetometer, this should combat the "getting lost" syndrome that I have found with the MPU 6050 as it will have a constant directional reference from magnetic north.

5 November 2014

Proof of Concept..

My initial idea was to employ a game pad to drive the animation of a digital puppet in a similar way to the demonstration in the video below.



The problem with this solution is that the controller looks nothing like a Waldo controller and it would have to be dismantled to then be reconfigured in a manner that would suit my objective. While this could potentially work I would rather have a controller that was built for purpose and so I decided to use an Arduino micro-controller as the heart of this project instead of the game pad.

The process to get the analogue inputs speaking with Maya was far more straight forward than I could ever have imagined and was implemented in three stages.
  1. Get my Arduino Uno to listen to analogue inputs and then send the data to my computer via the serial port.
  2. Send the data from the serial port to the command line because Maya 2015 is unable to read the serial port.
  3. Get Maya to read the data from the command line and apply it to the relevant attributes of the demonstration model.
With help from the book "Getting Started With Arduino" and with some tips from various forums, my favourite tip being to read each analogue input twice in order to reduce the likelihood of noisy data, I was able to cobble together the sketch that would read my inputs and send them to the serial port on my computer.

I was able to use a short script written by Eric Pavey which writes serial data to the command line, this took part of the second stage of the process.

The last pat of the puzzle was probably the hardest for me to solve because I needed to find a way to separate the incoming data from the command line and then turn the values into numbers to be used as individual attribute values in Maya. I was eventually able to do this with a little luck and by reading the Python help documentation in Maya.



I'm really pleased with this initial development as it demonstrates the viability of my project. The one drawback is that the Arduino only has 6 analogue inputs and so only has the potential to drive all 3 axis of only 2 joints in Maya which is not really enough for what I have in mind in this project.

There is hope though, a small amount of investigation has brought to light a project from Fluid Forms in which they used digital multiplexing to increase the number of analogue inputs to a potential of 96 which is plenty more than I would ever require for this project.

So I'm pretty excited that this is working and that I have a way to utilise as many inputs as I need. Next step is to grab some multiplex goodness and get that working!!