CURRENT ISSUE
Contests
Feature Article
|
|
Issue #200 March 2007
Inertial Rolling Robot
by Jeff Bingham & Lee Magnusson
Start | Electronics | Drive Motor | Servo Motor | Pressure Sensor | Software | DC Drive Motor Control | Servo Motor Control | Mechanical Components | Manufacturing | Assembly | Findings | Sources & PDF
DC DRIVE MOTOR CONTROL
The code for the DC drive motor and the steering servo motor both use
PWM. They’re both in the pwm.c file on the Circuit Cellar FTP site.
The brushed DC motor must have variable speed and torque capabilities, and it must operate bidirectionally. The motor currently uses voltage control, but it has the capability to use current control. Current control hasn’t been implemented in software. The torque in a brushed DC motor is proportional to the current through the motor (related by the motor’s torque constant), so it may be advantageous to use current control if you want to control torque.
Voltage control is achieved by a PWM signal to the motor at approximately 10 kHz. This is implemented on the H8/3664 microcontroller using Timer V. Since Timer V does not have a buffered register for changing the duty cycle of the PWM, an interrupt is set up on compare match to update the value in the compare register and eliminate the possibility of erroneous pulses being generated.
|