Introduction:------------------------------------------------------------------------------------------------------------------------------------------------------The TAMUbot version 3.0 robot uses motor controller consisting of H-bridges and a micro controller. A single motor controller can control up to two DC motors. The motors are controlled using Pulse Width Modulation (PWM) while it receives commands in the I2C format. (This build of the robot is called the Parker01) The H-Bridge is called the MD22. It is a dual 50 volt, 5 amp H-Bridge motor controller. ===================================================================================Parts List:------------------------------------------------------------------------------------------------------------------------------------------------------
===================================================================================Data Sheets and Ordering Information:------------------------------------------------------------------------------------------------------------------------------------------------------This part can be bought online at DevanTech![]() Figure 1: The MD22 Motor Controller with connection labels [1] The schematics of the system can be found in the attachments below titles md22sch1.gif and md22sch2.gif ===================================================================================
Features of Component:
------------------------------------------------------------------------------------------------------------------------------------------------------1. Can drive two independent motors2. Has several control modes of which I2C is used for Parker01 3. Handles voltages from 5 V to 50 V for motor control 4. 5V at 50mA is needed for control logic 5. Can handle up to 5 Amps of current 6. Physical size: 110mm x 52mm x 25mm 7. Uses a PIC16F873 micro controller as its primary logic IC to perform I2C Communication ===================================================================================Working of Component------------------------------------------------------------------------------------------------------------------------------------------------------This part of the guide explains the working of the I2C communications of the MD22 motor controller. And the connections required for running the DC MotorsThe MD22 consists of 2 H-Bridges and uses a PIC16F873 micro controller. The controller comes with a control program which can be found in the attachment md22.hex. The I2C communication mode allows the MD22 to interface with the AVR micro-controllers that run a PI controller for navigation purposes. The AVR and PI controller will be covered in the TAMU Robot Controller section of this guide. The maximum connection speed that the MD22 can handle over the I2C bus is 200Mhz ------------------------------------------------------------------------------------------------------------------------------------------------------Connecting the MD22:
-----------------------------------------------------------------------------------------------------------------------------------------------------Modes of the MD22The MD22 can run at multiple modes, in this section we will cover the I2C mode. Each mode for the the MD22 can be selected with the physical switch (blue) seen in Figure 1. There are 16 different possible modes that this switch can indicate of which all are used. Eight of the sixteen modes are I2C modes. The position of the switch is read once at power-up. The mode cannot be changed when the MD22 is on.
------------------------------------------------------------------------------------------------------------------------------------------------------I2C mode:The MD22 has 8 registers due to the PIC16F873 it relies upon to perform the I2C to PWM conversion. Of these 8 registers only 5 are used.The registers are numbered 0-7 and are as follows. Details for each used register are given after the table
It is important to note that certain features work only with certain modes of the MD22 *Speed2/turn register has dual usage. The register is used as the speed register for motor 2 in mode 0,1 The register is used as a turn register for the two motors in mode 2,3 ------------------------------------------------------------------------------------------------------------------------------------------------------Mode Register
------------------------------------------------------------------------------------------------------------------------------------------------------Speed RegisterIn mode 0,1 the speed register will set the speed for motor 1
In mode 2,3 the speed register will set the speed for both motor 1 and motor 2 In modes 0 and 2 the speed register is read as a unsigned value In modes 1 and 3 the speed register is read as a signed value ------------------------------------------------------------------------------------------------------------------------------------------------------Turn RegisterIn mode 0,1 this will act exactly like the speed register but for motor 2 In mode 2,3 the value in the turn register is combined with the value in the speed register to steer the robot in this mode the speed register is looked up to decide if the direction is reverse or forward if the direction is forward motor speed1 = speed - turn motor speed2 = speed + turn else the direction is reverse so motor speed1 = speed + turn motor speed2 = speed - turn [1] ------------------------------------------------------------------------------------------------------------------------------------------------------Acceleration RegisterBy default the fastest changes power every 64us The acceleration register can be used to control the acceleration of the robot if a certain period is to be consumed before reaching the desired speed. Thus the time taken to reach the new speed is given by Time = Acceleration register value*64us*Steps [1] (Eq.1) 0=< Acceleration register value >=255 Steps = |current speed - desired speed| ------------------------------------------------------------------------------------------------------------------------------------------------------ |
