My Persistent Brain - Rover 5
January 3, 2012
This blog entry is my persistent auxillary brain for robotics stuff.
Can't generally run a DC Motor from an Arduino because motors draw too much current and it would fry the board. So the Arduino needs to provide logic controlling an external power supply.
To run a brushed DC motor from an Arduino need to use a dedicated motor shield/board (such as a Dagu 4-Channel Motor/Encoder Controller) or an arrangement called an "H bridge" IC (eg: L298)? In either case, the IC needs to be able to handle the stall current of the motors.
An IC setup apparently involves soldering additional components (diodes, capacitors etc) See Arduino book 8.12/page 289.
Pololu Rover 5 motors draw 2.4A stall current, 210 mA free run. Dagu controller can handle 4A stall current.
Peak current drawn by the motor must not exceed rating for IC/motor controller.
Motor (quadrature) encoders give an indication of speed and angular position of motor in question. Uses a lot of pins! Decoding the quadrature encoders involves a little bit of programming work.
Dagu 4-Channel Controller:
- has two sets of power terminals for input - logic (5V) and motor power (7V2)
- for some reason, need to connect each motor to gnd despite these terminals having gnd.
- for one motor need to use at least 4 pins:
Input: current sense (Analog in), and quadrature (interrupt)
Output: direction (digital), speed (PWM)
- although, could get by with only the two output pins to start with
- these connect to male header pins on the Dagu board, so hookup wire won't cut it. Used smart clips for initial hookup, but will need to get female headers at some stage.
Controller board is smaller than top of Rover 5 tray. Maybe could fit two on? Comes with metal stand offs (stands off?). Need to check whether can mount aduino on top of the Dagu board.
- battery pack intended to fit within chassis between motor enclosures => not very accessible for battery changes. Need to work out some easy way of mounting controller board etc so it is easy to remove to change batteries. Hinged?
- test first by hooking up one motor
- if not enough pins, wire logic for two motors on each side to be controlled in tandem (tracks)
- does not come with a switch for battery pack. Might be advisable?
- apparently, the point of quadrature is that motors tend to run at different speeds for a given pwm value, so quadrature allows you to calibrate them
- also gives an indication of real world distance, useful for eg turning through specific angles.
- seems to be not much use unless it is important to know: distance travelled or speed of motor
- don't understand need to use quadrature to determine direction of motor if direction is controlled by aduino pin out
Not clear what limits to be placed on reversing direction. What is minimum transition time?
Apparently NiMH/rechargeable batteries are better to use for Robots than Akaline. Something to do with Akaline batteries suffering large voltage swings at times which can reset the Arduino.