Servo Motors and Transistors
I've been spending a lot of time today trying to figure out how best to connect the Servo motor we bought the other day. Unfortunately there isn't a NYU phys comp tutorial on driving servo motors with high voltages, which would have been ideal. I've had to learn a few new things, from a mixture of sources, and I'll pull the results together here.
The difference between standard geared motors and servo motors
So the first thing to understand is that a geared DC motor like the ones we used in the last couple of posts is quite dumb. It is directly controlled by the DC current you supply it via it's two inputs. You can only really tell it to start or stop. That's it.
You can vary the speed using PWM - but PWM is a kind of microcontroller 'hack' in a sense. What's really happening there is that you are very quickly turning it on and off, and varying the delay between those on and off commands. The motor itself doesn't have any control in that process - it just spins when it receives voltage in one of it's inputs.
If you wanted to be able to tell the motor to turn to a specific angle, you'd have to attach a sensor (i.e. a potentiometer) to the shaft. This could report the current angle of the shaft back to the microcontroller. You could use this information to figure out when to switch off the current to the motor to have it arrive at your desired destination on time.
And this is exactly what a servo motor does, except rather than reporting the position back to the microcontroller and you having to work it out, you just send the position you would like it to achieve, and it does all the working out for you. For this reason, unlike the standard geared DC motors, it has three inputs - one for ground, one for V+, and one to send your control signal.
When to use a H-Bridge and when to use a TIP120?
Tobias, and my Physical Computing book all seem to suggest I need a TIP120, not an L293 H-Bridge (which is what I used when connecting the motors in the previous posts). The question is, why?
| L293 H-Bridge |
First off, what is a H-Bridge? And what is a TIP120? Going back to the beginning of the chapter (page 97), I get a brief explanation that of what a relay is and what a transistor is. It explains that a relay is an electromagnet that flicks a switch for you whenever you send a control current to it (i.e. it's a switch that doesn't need to be flicked by a person, you can flick it automatically in your microcontroller code). It then just says that a transistor does the same thing but doesn't have any moving parts, and so is quicker - but will only work with DC.
With some googling I find that the TIP120 and the L293 have something in common. The L293 H-Bridge contains transistors, and the TIP120 is a transistor. So it seems that driving powerful loads is all about transistors - using a control current to switch on and off a powerful current.
| TIP120 Transistor |
So this is the information I need to really make it make sense. Both components only allow you to switch higher-load circuits on or off. A standard geared DC motor is spun one way or another by alternating the direction of DC current through it's two connections. This is what an L293 H-Bridge is useful for, as it gives you two output legs to the motor, through which you can send HIGH to one and LOW to the other and vice versa.
However a servo motor only requires a a high voltage to give it some power to work with. The control signal can then be used as an enable pin, and then instead of blindly increasing and decreasing speed through PWM, you vary the speed and direction by using a second control signal that goes straight to the motor. The motor does the dirty work for you, and as a result you get a direct correlation between the value you send it and the location the shaft turns to - no wonder they are more expensive. So for this, a single transistor is required - like the TIP120.
It took a lot of effort to piece that together! Tomorrow hopefully I can actually build the circuit.
- Tags:
- Motor
- Jaaga Residency
- Jaaga
- Arduino
- Jaaga Residency (17)
- Jaaga (15)
- I-Park Residency (12)
- Process (12)
- V4W (10)
- Personal Development (10)
- Installation (10)
- VVVV (9)
- Field Research (8)
- Freemote Threshold (7)
- SuperCollider (7)
- Long (7)
- Freemote (7)
- Reflections (6)
- Audio / Visual (6)
- CAC Residency (6)
- Arduino (5)
- Tutorial (5)
- Influence (5)
- Max/MSP (5)
- Jaaga Sound and Lights (4)
- openFrameworks (4)
- Motor (4)
- Kinect (4)
- Projection Mapping (4)
- Portable Projection (4)
- Gravity (4)
- michael fairfax (3)
- Roman Moshensky (3)
- Rocks (3)
- Jee Soo Shin (3)
- Land Art (3)
- Picture This (2)
- Phenomenology (2)
- Git (2)
- Measure (2)
- Projection Bombing (2)
- Presentation (2)
- Creative Context (2)
- Natural Textures (2)
- Tess Martin (2)
- Scott Wilson (2)
- Alpha-Ville (2)
- Review (2)
- Untitled (Picture This) (2)
- Ralph Crispino (2)
- Cosm (2)
- Mac (2)
- Boaz Aharonovitch (2)
- C# (2)
- Mobile Projection (2)
- Memo Akten (2)
- Judith Stein (2)
- Generative Art (2)
- 3D (2)
All posts
May 2013
October 2012
September 2012
- Residency Begins at CAC Troy
- Installation Sketch at Open Studios
- Roman Moshensky's Mirror World
- Open Studios at I-Park
- Perception as a Creative Process
August 2012
- The I-Park Graveyard
- Scoping Out the Land
- Residency Begins at I-Park
- Residency at Contemporary Artists Center
July 2012
June 2012
- Stephen Lumenta's SC TextMate Bundle
- Adding OF Addons (ofxSuperCollider)
- Setting up SuperCollider with TextMate
- Switching to MacBook Pro
- QuickRef for SuperCollider
May 2012
- Getting Started with SuperCollider
- Getting Started with OpenFrameworks
- Overtones, Harmonics and Additive Synthesis
- Visit to Cold Spring
April 2012
January 2012
December 2011
- The Final Exhibition
- Playing with Particles
- Responsive Granular Sound
- Kinecting to the Network
- First Working Day
- Designs for Freemote
- Freemote Utrecht
- Untitled - Picture This (2011)
October 2011
- The Wider Context?
- Trading Time for Space
- Talk at Goldsmiths Digital Studios
- Intro to Marius Watz
- Practical Guide to Generative Art
September 2011
August 2011
June 2011
May 2011
April 2011
- Cosm, Collision Detection and Volume
- Vector-Base Amplitude Panning
- Intuition, and Direction of the Project
- Reflections: What is Jaaga?
- Going Further with Ambisonics
- Introduction to Ambisonics
- Surface (2010)
March 2011
- Servo Motors and Transistors
- Spinning a 12V DC Motor
- Spinning a 5V DC Motor
- First Week at Jaaga
- Presentation Style
- Beginning the Jaaga Fellowship
January 2011
November 2010
October 2010
September 2010