Robots - Notes - Motor Control Introduction Robot Control Program Skeleton Small DC Motor Control: Part 1, Uncontrolled Speed (open loop) - using PARTS Mark III controller, PARTS Mark III Sensor Board with H-Bridge Kit and JAL language. These notes will explain how to make two small DC motors rotate both forward and reverse at variable speeds. We will not explain how to precisely control the speed, such as making both motors run at exactly the same speed, but will cover that in Part II. I will start by building up a block diagram for one motor and controller. Then I will build up the code. The speed of a small DC motor is controlled by varying the current applied to the motor by a square wave. Picture of Motor and constant power supply and of motor and square wave generator and batteries. The amplitude of the square wave is determined by the voltage source (4 to 6 AA batteries) and remains constant. If 4 AA batteries are used then the amplitude is approximately 4.8 volts if 6 AA batteries are used then the amplitude is approximately 7.2 volts. Same picture as above with amplitude pointed out. The current is varied by varying the amount of time the voltage is present and the amount of time the voltage is off. One complete on off cycle determines the period of the square wave. The number of times the voltage cycles on and off per second determines the frequency. The ratio of on time to off time is referred to as the duty-cycle. Show picture with 75% on duty cycle Most computers and microcontrollers use voltage up to 5 volts and draw current in the 10's of milliamps. A DC electric motor normally wants voltages that start at 4.5 volts and currents that start in the 100's of milliamps. DC motors quickly range up into the 12 to 24 volts range and can draw several amps. So it's fairly clear that computer electronics cannot directly supply the required voltage. An H-Bridge driver is used to control the higher power that a motor needs using a smaller signal that computer electronics provides. This driver can switch a higher current on and off and can change the direction of the current using a smaller signal supplied by the microcontroller. The diagram below shows a logic symbol of a H-Bridge driver. The main input, 1A, is a logic level one or zero generated by MCU. This low power signal is replicated as a high power output signal at 1Y. The signal at 1Y is suitable a higher current device like a motor.
If you have any questions or comments about this page please email me at: debots_replacethis_dinkdaze.org with at sign. |