Version 2 (modified by 10 years ago) (diff) | ,
---|
There are many types of motors including:
- DC Motors are usually the main motors that drive a robots wheels or tracks
- Servo Motors and Stepper Motors are used to effect fine control such as for manipulating objects.
Motors generally use electromagnets to generate physical motion such as rotating a shaft. Electromagnets typically require much more current than a micro-controller can source directly. To control motors, micro-controllers typically use a transistor as a valve; turning the transistor on or off requires a very small amount of current, but when turned on, the transistor can allow large amounts of current to flow through it to the motor.
DC motor controllers often use 4 transistors in an H-Bridge circuit; this allows the motor direction to be reversed by swapping the direction of current flow through the motor. DC motor speed is often controlled using pulse-width modulation (PWM). In many cases, there are dedicated integrated circuits to provide this functionality such as Arduino Motor Shields; and code libraries to support them.
Working with motors involves many considerations including protecting the motors from overheating if they are working too hard (e.g. stalled), braking control, and using the motors efficiently. For more details about DC motor control see (see here)