Home

Advanced Embedded System - Portland State University

image

Contents

1. SD Ko R 2 E 2 sj O M2A M2B B B DODO MAO c 2010 BasicMicro All Rights Reserved 26 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Baud Rate RoboClaw supports 4 baud rates in serial mode The baud rate is selected by setting switch 4 and 5 Baud Rate SW4 SW5 2400 T 9600 19200 FON 2400 Baud 9600 Baud 38400 Baud as a Ra WR Su Bus aa naa Simple Serial Command Syntax The RoboClaw simple serial is setup to control both motors with one byte sized command character Since a byte can be anything from 0 to 255 the control of each motor is split 1 to 127 controls channel 1 and 128 to 255 controls channel 2 Command character 0 will shut down both channels Any characters in between will control speed direction of each channel Character Function lo Shuts Down Channel 1 and 2 A Channel 1 Full Reverse 6a Channel 1 Stop ae Channel 2 Full Reverse 920 Channel 2 Stop 2550 Channel A Full Forward c 2010 BasicMicro All Rights Reserved 27 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Simple Serial Wiring Example In simple serial mode the RoboClaw can only r
2. af m CT E z gt O UIOD OJIIWUDISEE Error Status 2 Status 1 e 4 4 L Status LED 1 I I E Status LED 2 I L Error LED Analog Mode Status LED 1 On continuous Status LED 2 On when motor s active RC Mode Status LED 1 On continuous blink when pulse received Status LED 2 On when motor s active Serial Modes Status LED 1 On continuous blink on serial receive Status LED 2 On when motor s active Errors Over Current Over Heat Main Batt Low Main Batt High Logic Batt Low Logic Batt High Error LED on solid Status 1 or 2 indicates which motor Error LED blinking once with a long pause Error LED blinking twice with a long pause Error LED on fast flicker until condition is cleared Error LED blinking three times with a long pause Error LED blinking four times with a long pause c 2010 BasicMicro All Rights Reserved 10 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet DIP Switch Overview The dip switch on RoboClaw is used to set its operating modes and the many options The switch is marked with an ON label at its top The switches are also labeled from left to right starting with switch 1 and ending with switch 10 When a dip switch is moved toward the label ON it is considered ON When the switch is facing away from the ON label it is considered off Be careful to ensure the switch is not fl
3. Robo Claw RevC Logic Battery Screw Terminals The logic circuits can be powered from the main battery or a secondary battery wired to CN3 JP1 controls what source powers the logic circuits The maximum input voltage for the logic supply is 30VDC L SME lt SNES Jong Basicmicro com i c mo SSD Logic Battery Logic Battery Robo Claw RevC c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Encoder Inputs This header is setup for dual quadrature encoders A and B are the inputs from the encoders The header also supplies 5VDC to power the encoders When connecting the encoder make sure the leading channel for the direction of rotation is connected to A If one encoder is backwards to the other you will have one internal counter counting up and the other counting down Which will affect the operation of Robo Claw Refer to the data sheet of the encoder you are using for channel direction Encoder VSS gt Encoder VCC gt Basicmicro com Robo Claw RevC Jog Encoder Channel B gt Encoder Channel A gt
4. C SNES A A Encoder 2 4 L Encoder 1 Control Inputs S1 S2 and S3 are setup for standard servo style headers GND 5V and I O S1 and S2 are the control inputs for serial analog and RC modes S3 used as a flip switch input when in RC or Analog modes In serial mode S3 becomes a emergency stop Basicmicro com GND gt Robo Claw RevC VCC gt JOU 12345678910 UUUUUUUUUU I O gt S152 S3 c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet BEC Jumper VCC on control input headers S 1 S2 and S3 can be turned off on or 2V by the jumper near S3 on CN5 Removing the BEC jumper disables VCC on S1 S2 and S3 headers In some systems the RC receiver may have its own supply and will conflict with the RoboClaw logic supply Basicmicro com E gt D gt amp O o 2 O D 1013 L SIupIG Z SMEIS O omo E
5. pu Lal e 000 A w K U Copa Cem p Ce C rame Sch e l s ba a i lat e Si waat 7 ise ez e 7 e i se Ib GZ t REES Re a rs pi BI S2 BI GC n e LA P e E e e i e 38 Ti C mr C3 dr O C er paid sro PA mm Top Overlay Bottom Overlay Terminals 1 B4 Connect to the forth battery s positive terminal 2 B3 Connect to the third battery s positive terminal 3 B2 Connect to the second battery s positive terminal 4 B1 Connect to the first battery s positive terminal 5 BO Connect to the first battery s negative terminal 6 B Connect to the first battery s negative terminal 7 P Connect to the battery s output or the charger s negative terminal Specifications and data are subject to change without notice Contact Tenergy for latest information 2010 Tenergy Corporation All rights reserved Page 3 of 3 Appendix F 7 Features e Intelligent charger designed for 4 cell LiFePO4 battery packs e CPU control and pulse width modulation PWM technology charging current and output voltage is controlled accurately to ensure fully charged and avoid over charging e Built in cooling fan to ensure charger long service life e Safety protection o Over Voltage Protection o Short Circuit Protection o Output Reverse Protection e Charging time o Charging Time
6. arts batteries lof ebe 60ah ph www electricmotorsport com store ems ev parts batteries lof ts 60ah ph www all battery com Tenergy14 6V10ALiIFePO4BatteryCharger 01034 aspx
7. terminal println delay 100 U oA AA C C _ 5 5 F FjO N N E E EE E amp EE _ gt E E EEoEE _E _ oor___ aa c 2010 BasicMicro All Rights Reserved 57 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Speed Controlled by Quadrature Encoders Arduino Example The following example was written using an BasicATOM Pro RoboClaw was connected as shown in both packet serial wiring and quadrature encoder wiring diagrams The example will command a 4wheel robot to move forward backward right turn and left turn slowly You can change the speed by adjusting the value of Speed and Speed2 variables Basic Micro Robo Claw Packet Serial Mode Switch settings SW3 ON SW4 0N SW5 ON tinclude MEN SI ee a define address 0x80 define Ko 0x00010000 define Ki 0x00008000 define Kd 0x00004000 define qops 44000 BMSerial terminal 0 1 RoboClaw roboclaw 5 6 void setup terminal begin 38400 roboclaw begin 38400 roboclaw SetM Constants address Kd Ko Ki qops roboclaw SetM2Constants address Kd Ko Ki qops void displayspeed void Ee EE bool valid WOES Ie SNC iocoe lei INSeclinenil cele TH if valid terminal print Encoder1 terminal print encl DEC terminal print terminal print status HEX terminal print EK EE if valid terminal print En
8. RoboClaw 2 Channel 15A Motor Controller Data Sheet Packet Serial Arduino Example The example will start the motor channels independently Then start turns with mix mode commands The program was written and tested with a Arduno Uno and P5 connected to S1 Set switch SW3 and SW5 to ON EE Eelere erer Mee Connie Eer E Switch settings SW3 ON and SW5 ON wine E ae tan uno Nelo reale define address 0x80 ROO eC Claw eene Sue ct EE roboclaw begin 19200 vente doo O ee Eeer Ee EE Ee nello delay 2000 robo llan Bac kuar M addr eSa A a d l roboclaw ForwardM2 address 64 Cmd 6 delay 2000 roboclaw ForwardBackwardM1 address 96 Cmd 6 roboclaw ForwardBackwardM2 address 32 7 Em delay 2000 roboclaw ForwardBackwardM1 address 32 onem roboclaw HorwardBackwardM2 address 96 em delay 2000 rop Motors roboclaw ForwardBackwardMl address UI roboclaw ForwardBackwardM2 address 0 delay 10000 roboclaw ForwardMixed address 64 T delay 2000 Robo Sky diede Cmd 9 delay 2000 noe ibra E Ehnen iC delay 2000 oboe E Eeer eler Cn delay 2000 T IEEE HE ETRE EE delay 2000 roboclaw ForwardBackwardMixed address 96 Cmd 12 delay 2000 EE delay 2000 T i oa e e e eee Sc Gna 5 delay 2000 T E roboclaw ForwardMixed address 0 delay 10000 EE c 2010 BasicMicro All Rights Reserved 38 B0097 RoboClaw 2 Channel 15A Motor Controller Data S
9. Table of Contents VI Appendixes VII I 15 PODEN ID li 15 APPCHODCB EE 77 5 else Tr EE 81 APPECHODCD EE 83 eener e E 87 POC aT i EE 89 References Table of figures GO RODO lina 4 Square L shape Aluminum bar 4 Cee lt Rel E ee 5 Nylon nut Brackets FA WI NE TT 6 PATA a Ol inerte 6 RODOCIIN Arai 7 EGET 8 gears to attach the encoder to the gear shaft 9 Sensores distribution ON the robot i 10 SMI aes TT aa GA ei 10 LIFE MnPO4 60AH Battery pack s 11 Charger BUND 14 PSU Guide Robot Mecanum Platform II L II Introduction This is the second term of working on PSU_GUIDE robot In the winter term we finished the lower part of the base The lower part was including the Aluminum structure Mecanum wheels Dc motors P60 gears and an Arduino mega as a simple microcontroller for demo purposes This term we started working on the upper part of the base which is including the Aluminum structure DC motor controller batteries battery charger Encoders Ultrasonic sensors and Bumpers Then after finishing working on the upper part we finished the whole base The body legs waist and the upper part that holding the arms and the head is integrated to the base That means the robot is ready to mount the head and arms to it For demonstration we will use Arduino Mega to get the input from the sonars and the bumpers then drive the base and waist We are going to write a simple
10. lt 3min transition 2 5 hours dwell 200 cycle BS EN60068 2 32 1993 TEST ED free fall appendix B 1 5 m length 1 5 m length 173mm X88mmX62mm L W H 1 0Kg XLR Connector Aluminum The charger has been calibrated to take account of the voltage drop in the DC output cables during operation to prevent the possibility of over or under charging of the battery it is recommended the DC output cables are connected directly to the battery without modification Warning Only for use with LiFePO4 4 cell battery pack If used with battery pack of less cells will cause damage to battery and possible personal injury may occur Unplug charger after use To prevent electrical shock DO NOT remove casing Be careful of high voltage inside charger If failure happens please contact us Users and non professional technicians are prohibited to open the charger Keep charger out of children s reach The charger and battery belongs in indoor environment with good ventilation and good cooling system Do not expose to humid high temperature flammable explosive gas environments Do not bring charger along during transportation to prevent shock damage Read the instructions carefully before using Damage caused by improper use is not covered by warranty VI References www pololu com catalog product 1496 roducts 10932 roducts MB1000 htm www electricmotorsport com store ems ev www sparkfun com www maxbotix com
11. current count along with each encoder status bit in binary and the direction bit As the encoder is turned it will update the screen Basic Micro Robo Claw Packet Serial Mode Switch settings SW3 ON SW4 0N SW5 ON Eae ERI NES Ted include RoboClaw h define address 0x80 define Ko 0x00010000 define Ki 0x00008000 define Kd 0x00004000 define qops 44000 BMSerial terminal 0 1 RoboClaw roboclaw 5 6 void setup terminal begin 38400 roboclaw begin 38400 roboclaw SetM Constants address Kd Ko Ki qops roboclaw SetM2Constants address Kd Ko Ki qops void loop VOEO E Stee bool valid uint32 t encl roboclaw ReadEncM1 address amp status amp valid if valid terminal print Encoder1 terminal print encl HEX EE E Ree ee terminal print status HEX terminal print uint32 t enc2 roboclaw ReadEncM2 address amp status amp valid if valid terminal print Encoder2 terminal print enc2 HEX terminal EIERE terminal print status HEX terminal print gt uint32 t speedl roboclaw ReadSpeedM address amp status amp valid Ee terminal print Speed1 terminal print speed1 HEX EE E Ree een O uint32 t speed2 roboclaw ReadSpeedW address amp Status amp valid if valid terminal print Speed2 terminal print speed2 HEX terminal print
12. pulses per second and using an acceleration value for ramping Different quadrature encoders will have different rates at which they generate the incoming pulses The values used will differ from one encoder to another Once a value is sent the motor will begin to accelerate incrementally until the rate defined is reached The command syntax Sent Address CMD Accel 4 Bytes QspeedM1 4 Bytes OspeedM2 4 Bytes Checksum 4 Bytes long are used to express the pulses per second Quadrature encoders send 4 pulses per tick So 1000 ticks would be counted as 4000 pulses The acceleration is measured in speed per second An acceleration value of 12 000 QPPS with a speed of 12 000 QPPS would accelerate a motor from 0 to 12 000 QPPS in 1 second Another example would be an acceleration value of 24 000 QPPS anda speed value of 12 000 QPPS would accelerate the motor to 12 000 QPPS in 0 5 seconds 41 Buffered M1 Drive With Signed Speed And Distance Drive M1 with a signed speed and distance value The sign indicates which direction the motor will run The distance value is not signed This command is buffered This command is used to control the top speed and total distance traveled by the motor Each motor channel M1 and M2 have separate buffers This command will execute immediately if no other command for that channel is executing otherwise the command will be buffered in the order it was sent Any buffered or executing command can be stopped when
13. right turn and left turn slowly You can change the speed by adjusting the value of Speed and Speed2 variables CMD var byte Speed var long Speed2 var long CRE var byte Address con 128 ENABLEHSERIAL sused on AtomPro24 and AtomPro28 AtomPro40 and ARC 32 use EnableHSerial2 SetHSerial H38400 H8DATABITS HNOPARITY HISTOPBITS Mixed Forward CMD 37 Speed 12000 Speed2 12000 CRC address cmd speed byte3 speed byte2 speed bytel speed byte0 speed2 byte3 speed2 byte2 speed2 bytel speed2 byte0 amp 0x7F hserout address cmd speed byte3 speed byte2 speed bytel speed byte0 speed byte3 speed2 byte2 speed bytel speed byte0 crc pause 4000 Mixed Backward CMD 37 Speed 12000 Speed2 12000 CRC address cmd speed byte3 speed byte2 speed bytel speed byte0 speed byte3 speed2 byte2 speed2 bytel speed2 byte0 amp 0x7F hserout address cmd speed byte3 speed byte2 speed bytel speed byte0 speed2 byte3 speed byte2 speed bytel speed byte0 crc pause 4000 Mixed Left CMD 37 Speed 12000 Speed2 12000 CRC address cmd speed byte3 speed byte2 speed bytel speed byte0 speed byte3 speed2 byte2 speed2 bytel speed2 byte0 amp 0x7F hserout address cmd speed byte3 speed byte2 speed bytel speed byte0 speed byte3 speed2 byte2 speed bytel speed byte0 crc pause 4000 Mixed Right CMD 37 Speed 12000 Speed2 1
14. Constant Voltage Shut off Current Power Efficiency Over Voltage Protection Software Over Voltage Protection Thermal Protection Current Limiting Protection Reverse Polarity Protection Electric Strength Test Input Output 4 Cell 14 6V 12 8V Nominal 10A Charger TN1210JL 240W 14 6V 0 02Vdc 10A 110Vac AC90 135V 14 6V 0 2V 50 60 Hz 10A 1A 14 6 Vdc 10A 1A 90 Vin 110Vac rated load YES The charger software limits the maximum output voltage to a level suitable for the connected battery system N A YES At CC Mode When output wires are reversely connected to the battery the charger will not operate and will work normally when DC wires are correctly connected 1500Vac 10mA 1 min No Breakdown Isolation Resistance Input ground Isolation Resistance Output ground Leakage Current Safety High Temperature Ambient Operating Low Temperature High Temperature Storage Low Temperature Storage Random Vibration Repetitive Shock Thermal Shock Drop Test AC Wire Length DC Wire Length Dimensions Net Weight Output Connector Type Casing 10m 500Vde 10m 500Vde lt 3 5mA CE UL Compliant 40 C 10 C 70 C Normal after recovery under normal temperature for 2 hours 40 C Normal after recovery under normal temperature for 2 hours 20Hz to 2000Hz 3 Grms 20 hours per axis 40g peak 3 orthogonal axes 3 and 3 in each axis 11ms pulse width 35 C to 75 C
15. Power Up Instruction Each time after the LV MaxSonar EZ is powered up it will calibrate during its first read cycle The sensor uses this stored information to range a close object It is important that objects not be close to the sensor during this calibration cycle The best sensitivity is obtained when it is clear for fourteen inches but good results are common when clear for at least seven inches If an object is too close during the calibration cycle the sensor may then ignore objects at that distance The LV MaxSonar EZ does not use the calibration data to temperature compensate for range but instead to compensate for the sensor ringdown pattern If the temperature humidity or applied voltage changes during operation the sensor may require recalibration to reacquire the ringdown pattern Unless recalibrated if the temperature increases the sensor is more likely to have false close readings If the temperature decreases the sensor is more likely to have reduced up close sensitivity To recalibrate the LV MaxSonar EZ0 cycle power then command a read cycle Product specifications subject to change without notice For more info visit www maxbotix com MaxBotix Pr MaxBotix MaxSonar amp EZO are trademarks of MaxBotix Inc Email info maxbotix com LV EZO patent 7 679 996 Copyright 2005 2012 bians E Appendix D 5 Nominal Capacity Max Charging Current Standard Charging Current Internal Resistance
16. Sent Address CMD QspeedM1 4 Bytes QOspeedM2 4 Bytes Checksum 4 Bytes long are used to express the pulses per second Quadrature encoders send 4 pulses per tick So 1000 ticks would be counted as 4000 pulses 38 Drive M1 With Signed Speed And Acceleration Drive M1 with a signed speed and acceleration value The sign indicates which direction the motor will run The acceleration values are not signed This command is used to drive the motor by quad pulses per second and using an acceleration value for ramping Different quadrature encoders will have different rates at which they generate the incoming pulses The values used will differ from one encoder to another Once a value is sent the motor will begin to accelerate incrementally until the rate defined is reached The command syntax sent Address CMD Accel 4 Bytes Qspeed 4 Bytes Checksum 4 Bytes long are used to express the pulses per second Quadrature encoders send 4 pulses per tick So 1000 ticks would be counted as 4000 pulses The acceleration is measured in speed per second An acceleration value of 12 000 QPPS with a speed of 12 000 QPPS would accelerate a motor from 0 to 12 000 QPPS in 1 second Another example would be an acceleration value of 24 000 QPPS anda speed value of 12 000 QPPS would accelerate the motor to 12 000 QPPS in 0 5 seconds 39 Drive M2 With Signed Speed And Acceleration Drive M2 with a signed speed and acceleration value The sign indicat
17. a diode array a PIC16F676 together with a TX When the BW is open or held low the TX output delivers variety of passive components asynchronous serial with an RS232 format except voltages are 0 Vcc The output is an ASCII capital R followed by three ASCII character 5 Z ZSS 5 oa digits representing the range in inches up to a maximum of 255 followed by a carriage return ASCH 13 The baud rate is 9600 8 bits no parity with one stop bit Although the voltage of 0 Vcc is outside the RS232 standard most RS232 devices have sufficient lt lt margin to read 0 Vcc serial data If standard voltage level RS232 is de desired invert and connect an RS232 converter such as a MAX232 i a d gt When BW pin is held high the TX output sends a single pulse suitable S for low noise chaining no serial data E RX This pin is internally pulled high The EZO will continually measure range and output if RX data is left unconnected or held high If held low the EZO will stop ranging Bring high for 20uS or more to command a range reading AN Outputs analog voltage with a scaling factor of Vcc 512 per inch A supply of 5V yields 9 8mV in and 3 3V yields 6 4mV in The output is buffered and corresponds to the most recent range data PW This pin outputs a pulse width representation of range The distance can be calculated using the scale factor of 147uS per inch BW Leave open or hold low for ser
18. and maximum speeds at which they operate So each quadrature encoder will produce a different range of pulses per second Command Description Drive M2 With Signed Speed And Acceleration Mix Mode Drive M1 M2 With Speed And Acceleration I I 38 Drive M1 With Signed Speed And Acceleration c 2010 BasicMicro All Rights Reserved 49 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 28 Set PID Constants M1 Several motor and quadrature combinations can be used with RoboClaw In some cases the default PID values will need to be tuned for the systems being driven This gives greater flexibility in what motor and encoder combinations can be used The RoboClaw PID system consist of four constants starting with QPPS P Proportional I Integral and D Derivative The defaults values are OPPS 44000 P 0x00010000 I 0x00008000 0x00004000 QPPS is the speed of the encoder when the motor is at 100 power P I D are the default values used after a reset Command syntax Sent Address CMD D 4 bytes P 4 bytes I 4 bytes QPPS 4 byte Checksum Each value is made up of 4 bytes for a long To write the registers a checksum value is used This prevents an accidental write 29 Set PID Constants M2 Several motor and quadrature combinations can be used with RoboClaw In some cases the default PID values will need to be tuned for the systems being driven This gives greater flexibility in what motor and enc
19. code to show that everything is working properly Robot Design According to our design in the google SketchUp in figure 1 the base consists of all parts mentioned in the introduction There is a little different between the real robot and the designed one The stepper motor part is not yet in the real robot which add one more degree of freedom that allow the robot to rotate around the z axis HI Figure 1 PSU Guide Robot Construction Parts All the parts that we bought during working on this project were from Parkrose hardware A Aluminum Bars The Aluminum bars that used in building the upper part of the base is square shape 1 5 X1 5 and a thickness of 0 065 which weighs 45lb per foot The other square shape is 5 X 5 and thickness of 0 065 which weighs 0 13lb per foot The last piece was L shape 0 75 X0 75 and a thickness of 0 125 which weighs 0 205lb per foot As shown in figure 2 Figure 2 Square L shape Aluminum bars B Bolts There are two types of bolts One of them is stainless steel socket screws 2 length and 3 16 in width and a bolts of 3 4 length 3 16 width There couple bolts which are used in small quantity 1 length 1 16 width 1 4 length 1 16 width It is shown in figure 3 The 2 bolts are 24 teeth as there are 32 teeth and 24 teeth Figure 3 Socket screw bolts D Nuts The lock nuts figure 4 are nylon which will tighten the bolts strongly It is 3
20. gt ti i aja O ra OS C L DO ESICsiLs c 2V 5V Robo Claw RevC Microcontroller DIP Switch Logic Battery 3 5mm Screw Terminals Encoder Input Header Input Control Headers VCC on Input Control Header Disable Jumper Logic Voltage Regulator Logic Voltage Source Selection Header DC Motor Channel 2 Screw Terminals Main Battery Input Screw Terminals DC Motor Channel 1 Screw Terminals Status LED 1 Status LED 2 Error LED 2Z3FASHIOTNMOONOODb c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Dimensions Basicmicro com Robo Claw RevC 10313 3 Dif L SNEIS c SNES cD Board Edge 2 3 W X 3 L Hole Pattern 0 125D 2 W x 2 7 H c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Header Overview JP1 Logic Supply Select 7 L SMEIS lt Snes 1043 Basicmicro com 0O00 m meu O lt K CN3 Logic Battery gt I CN4 Encoder Inputs gt 78888 00 CN5 Control Inputs gt JP3 5V Jumper gt
21. motor 2 forward and reverse Valid data range is 0 127 A value of 0 full speed reverse 64 stop and 127 full speed forward Example with RoboClaw address set to 128 Serout P15 119200 128 7 32 167 amp 0X7F M2 half speed reverse E c 2010 BasicMicro All Rights Reserved 35 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Commands 8 13 Mix Mode Commands The following commands are mix mode commands and used to control speed and turn Before a command is executed valid drive and turn data is required You only need to send both data packets once After receiving both valid drive and turn data RoboClaw will begin to operate At this point you only need to update turn or drive data 8 Drive Forward Drive forward in mix mode Valid data range is 0 127 A value of 0 full stop and 127 full forward Example with RoboClaw address set to 128 Serout P15 119200 128 8 127 263 amp Ox7F full speed forward 9 Drive Backwards Drive backwards in mix mode Valid data range is 0 127 A value of 0 full stop and 127 full reverse Example with RoboClaw address set to 128 Serout P15 119200 128 9 127 264 amp 0x7F full speed reverse 10 Turn right Turn right in mix mode Valid data range is 0 127 A value of 0 stop turn and 127 full speed turn Example with RoboClaw address set to 128 Serout P15 119200 128 10 127 265 amp 0x7F1 full speed right turn 11 Turn left T
22. to our robot as there still a dead zone which can t be recognized as obstacle by the Kinect or ultrasonic sensors The main goal is to not use these bumpers because we should have an efficient system which able to detect the obstacle and not to crash on them The bumpers are used for an emergency stop in a case there are no inputs from the other sensors Tow micro switches are used in each bumper Springs as well as spacers are used to protect the micro switches from being damaged during operation Each micro switch is simply operated as they work either normally open or normally closed For instance when it hit something it will simply turned off the input from 5 to the analog digital input in the Arduino board Figure 16 shows the bumpers Figure 16 Bumpers V Prices Hardware stuffs Lo 20026 Encoder A 69 95 O Micro switch Battery Management system 1 38 41 board Gears Aluminum Bars Le L Toth 6292 __ Appendix A 1 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Feature Overview 2 Channel at 15Amp Peak 30Amp Battery Elimination Circuit BEC Switching Mode BEC Hobby RC Radio Compatible Senal Mode TTL Input Analog Mode 2 Channel Quadrature Decoding Thermal Protection Lithium Cut Off Packet Serial High Speed Direction Switching Flip Over Switch Over Current Protection Regenerative Braking K L E G D L 2 Basic Description The RoboClaw 2X15 Amp is an extremely ef
23. 0 687 0388 ees baie wanw TenergyBattery com email sales itenergwbatierv Com Contents 1 Outline This specification applies to 4 senal cell LiFePO4 Battery Protection Circuit Module designed and manufactured by TENERGY CORPORATION 2 Electrical characteristics Unless specified otherwise Temp 25 C oe Se Battery Type LiFePO4 Battery a Application oo en _ panni rire cr E i E Charge Protection Over charge detection voltage Call eee mee ee L Balance open voltage Call 3 600 0 025V ee _ e Short Circuit protection short Circuit Protection Deatection delay time Internal resistance Main loop electrify resistance Current Consumption Current consume in normal operation tenia Specifications and data are subject to change without notice Contact Tenergy for latest information 2010 Tenergy Corporation All ngh s reserved Page 2 of 3 Tenergy Corporation 436 Kato Terrace Fremont CA 94539 TE ERGY Tel 510 687 0388 Fax 510 687 0328 www TenergyBattery com email sales tenergybattery com 3 PCB Layout mam AG Pa a Top Layout Bottom Layout da CS d a Pee D X thins Eet D0 B H ESA GSA RE TOR GOA SES IEA HOUOOUUL eo et Tow Tsar T He TO 40 uep S af Teal Teal ja 1 w e EP z si es 8 o ee GL Jet je 1 os os eB terso IK Ak n aA b e less best ed
24. 1 41 Ah rate of the pack 10A charge current e Built in IC to cut off power automatically when battery is fully charged e LED indicators o LED 1 Red Power On o LED 2 Red Charging o LED 3 Green Fully Charged User Instructions Check the output plug of this charger and make sure it is not loose Before charging please connect the charger s alligator clips to battery first the red clip connects to the POSITIVE pole and the black connects to the NEGATIVE pole After connect the input power plug to the indoor power supply The charger applies the intelligent charging method of constant current and constant voltage The charger will automatically shut off when battery is fully charged Unplug the input power supply then disconnect the output clips When charger is not in use or finished charging be sure to unplug input power supply ndictor LED instruction Charging indicator shows red under normal charging state It turns into Green when the battery is fully charged the battery can be put into use at this time The charging voltage of this charger is 12V and shut off current is 1A It can only be operated when connect with not fully charged battery Includes e Battery Charger e Power Cable e Manual Technical Specifications Item Model Max Output Power Output Voltage Output Current Rated Input Voltage Input Voltage Constant Voltage AC Input Voltage Frequency Constant Current
25. 10 24V 15 owersupplyvoltage Rkzi p p 5 A F CHA Bk3h p p 5 DA F lge R e obt BK HH p p 5 Hr RF SE jonl SOMALA Fmax 20mALL Fmax 30mABL Fmax 20mALL Fmax 50mAUL Fmax 30mALL Fmax SEE hk BS 10 20 60 100 200 300 360 500 10 200 380 500 SIN ua ote 1 merino O OO H Afi ER ZH Sen Output form Voltage output Open collector output Voltage output Open collector output voltage output Open collector output hh E Output capacity Residual voltage 0 4 V max SH LEE SOMALA F Rp ZOMART Residual voltage 0 4V max or foe Di x R Se Maximum response frequency 367 H 45 T de Phase difference of output SH Os output wave rom percentage d Ge O pSBIF S tzen 1 01 sl max _ 10 abl RRs SIRIA TED SC 500m esac ARAKS Se 5007 FF Seat MERKO k n rise and at hee of o p s max at control output at gece of 10 1 0 ps Lita control output all times mA with 2 m cable vanaga ofS V ane losd en wA with T dd arer k cnr 1 FRM AE HER E BER HOR e i dii Luni 2 i a BY Ba e maximum electrical response revolution is determined by the resolution an Fe ER SEE a x60 maximum response frequency as follows Ai ine M t LENS Maximum electrical response frequency rpm 2 wk VARIA Maximum response frequency resolution x 60 E dine STAI MIIS sms This means that the A6B2 encoder will not operate electrically if its shaft speed exceeds the maximum electrical response revolution YUEQING YING S IMPORT am
26. 16 in width to support the available bolts and there are 100 nuts Figure 4 Nylon nut E Brackets This time we used only four kind of bracket They are 1 1 2 X1 1 2 with 6 holes L bracket brace 1 1 2 X5 8 with 4 holes L bracket 1 X1 2 with 2 holes L bracket and the 4 X4 T shaped bracket with 5 holes We have to do little modification to these brackets to make them more suitable with the robot design All brackets are shown in figure 5 Figure 5 Brackets F Washers There are many washers used in this robot to hold the bolts while they are attached to the brackets Figure 6 Flat washer G Spacer Spacers are used to build the bumpers as we will talk about them in detail in the bumpers part of this report Figure 7 Aluminum spacer IV Base Parts A DC motor controller Basic Micro s RoboClaw motor controller can control a pair of brushed DC motors using serial RC or analog inputs Integrated dual quadrature decoders make it easy to create a closed loop speed control system This version can supply a continuous 15 A per channel 30 A peak 1 Figure 8 shows a picture of this micro controller In this robot two of these motor controllers are used to control four DC motors See appendix A for more information about these motor controller p www pololu com catalog product 1496 support all the documentations required to work in this motor controller as well as the libraries or codes related
27. 2 BHKAIS E6A2 MI ay ES o AIOUTPUT CIRCUIT DIAGRAMS Rr HH ee HHA A Ss Qutput diagram Outputwave Wire CodeCode Sa eats Output transistor EU BAGA2 CS3C T 100 WW BAGA2 CS5C ONT ad color A Signal OFF Pe 1 2T41 4T 50 25 ED DER CW 6A2 CO DISC moa E Direction of rotation CW E SAGA2 CH3C Black A ph AWhite B ph Orange Z ph META M BAGA2 CW5C Output Clockwise as viewed from the shaft ov ih aie ONIH OFFIL eee I wi _ WW SABA2 CWZ3C ang 4 1 4Tt1 2T 50 45 BAGA2 CHZ5C 74 OFF L At wi H see ARRE LOI 79 K Jg Sg it 06 CCW D fatta of rotation CCW AXE EBAR He 51 47 1814818 SAGA2 CW3E LM T FR AA Note Camtarclockwise as viewed from the shaft T The white green and orange artan S nine lines of the single type E6A2 CS do not output signals no connection T 360 SAR 2 The aranga TeL IRR 8 9 i LL reversible type ops no Vec 5 12V ONIHY output signal no connection AWA The voltage output type is capable of OFFIL sinking a maximum of 20 mA ONIH molackAph AWhite B ph G Note W BAGA2 CWZ3E RIR Output OFFIL I rss S ni H and L indicate e Boga levels ONIH of the voltage output 718 OFFILI 2 Output A leads B by ec af when the shaft revolves clockwise Output Alaga behind B by 1 4T 1 8T when the shaft revolves counterclockwise mn CN T 100 de EES 4 T 50 25 E Z9 RT Installation Dimension amp 4 amp unit mm Dimensions wit
28. 2000 CRC address cmd speed byte3 speed byte2 speed bytel speed byte0 speed2 byte3 speed2 byte2 speed2 bytel speed2 byte0 amp 0x7F hserout address cmd speed byte3 speed byte2 speed bytel speed byte0 speed byte3 speed byte2 speed bytel speed2 byte0 crc pause 4000 Mixed Stop CMD 37 Speed 0 Speed2 0 CRC address cmd speed byte3 speed byte2 speed bytel speed byte0 speed byte3 speed2 byte2 speed2 bytel speed2 byte0 amp 0x7F hserout address cmd speed byte3 speed byte2 speed bytel speed byte0 speed byte3 speed Datei speed bytel speed2 byte0 crc SEO EE c 2010 BasicMicro All Rights Reserved 6 1 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Electrical Characteristics Characteristic Pulse Per Second Main Battery B B Logic Battery LB LB External Current Draw BEC Logic Circuit Motor Current Per Channel I O Voltages I O Logic Tempature Range EES c 2010 BasicMicro All Rights Reserved 62 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Warranty Basic Micro warranties its products against defects in material and workmanship for a period of 90 days If a defect is discovered Basic Micro will at our discretion repair replace or refund the purchase price of the product in question Contact us at support basicmicro com No returns will be accepted without the proper authoriza
29. Rights Reserved 2 1 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Mode 2 Analog Input For Analog mode set SW1 SW2 and SW3 OFF In this mode S1 and S2 are set as analog inputs Voltages of OV Full reverse 1V Stop and 2V Full forward You can use linear potentiometers of 1K to 100K to control RoboClaw Or you can use a PWM signal to control RoboClaw in analog mode If using a PWM signal to control RoboClaw you will need a simple filter circuit to clean up the pulse If using a potentiometer set the BEC header to 2V Switch 4 Mixing Mode SW4 ON Turns mixing mode ON One channel input to control forward and reverse Second channel input for steering control Control will be like a car SW4 OFF Turns mixing mode OFF One channel controls one motor speed and direction Second channel controls the other motor speed and direction Control will be like a tank Switch 5 Exponential Mode SW5 ON Turns exponential mode ON Exponential response softens the center control position This mode is ideal with tank style robots SW5 OFF Turns exponential mode OFF Motor response will be linear and directly proportional to the control input Ideal for 4 wheel style robots c 2010 BasicMicro All Rights Reserved 22 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Switch 7 Flip Switch SW7 ON Turns the flip switch input S3 on The flip switch signal is a TTL driven s
30. Temp resistance of Shell Self Discharge rate month Energy Density Single cell charging 3 8 Batiery pack charming 3 63 Y Working Voltage Single cell 2000 times 80 DOD Battery pack 1500 times 80 DOD Discharging 20C 63C KN gt 800w ke Power Density 85 100 Whke Cell Weight l 6mm 05mm 150mm Discharge Curve Yoltage LY Capacity Ah Note Red 0 5C rate Black 1 0C rate Blue 3 0C rate Charging Curve Cad Leg Yoltage 3 4 LY La Lad b sA E L ETI ETI 3 0 15 30 45 Capacity Ah Note Red 0 5C rate Black 1 0C rate Blue 3 0C rate SPECIFICATION OF GBS LFP20A H single cell charging 3 8V Battery pack charging 3 6V Nominal Capacity 20Ah Working Voltage single cell charging 2 5V Battery pack discharging 2 8V Max Discharai Continuous Current lt 3C Max Charging Current 30 Rut bg Current Impulse Current lt 10C 0 3 0 8C Best Charging Current 0 5C Standard Charging Current Single cell 1500 times 80 DOD Internal Resistance lt 2 5m Q Cycle Life l Battery pack 1200 times 80 DOD Charging gt 0 C Temp resistance of Shell 139 C Working Temperature 7 7 l Discharging 20 C 65 C 0 5kg 100g self Discharge rate month lt 3 Cell Weight gt 800w kg Energy Density 85 100Wh kg Power Density single Cell Dimension 71mm 42mm 152mm Appendix E 6 Tenergy Corporation 436 Kato Terrace TEN ERG Y Tel 51
31. Voltage output ole SAS NPN Push Pull output 5 L CPNP ft iHPNP Voltage output TT D 3 DES 12V 5 DC12 24V 6 DC5 24V Z WEATHER Zero Signal e ppi L L leness Output A NEW N E H AE Phase Difference e AE een se an en zs enger ze eee eee DR EE TE ee j UZ 4 gt N P ESS EE GZe wep Lupgepemn seQuNN sJUBNbes Ei Ordering Information neen ROTARY ENCODERS sara loi MRI SIAE R R e Suopiy Voltage det Resolution p r se EEN siracazosie 19 80 100 200 300 360 ge output DC 5 12V Am mA 200 00 sed TR S sco en SPI PR ZG wdi s HSH RIZA ERT A gg rename t LET cK L ZR GRU ZH 0 R E TL L E CAEREMMKO g ren SMMS500P RH BA BE Ae Ze s SS ROTARY ENCODERS HEN 4446625 WE AGA2 INCREMENTAL ROTARY ENCODERS OUTSIDE DIAM 25 MODEL A6A2 PARA ESUBSTITUTE EGA2 Ah 25 HS AG6A2 BKHS E6A2 Miniature Rotary Encoder for Positioning in Space Confined Areas R Wide variety of supply voltages and output forms to match input devices M Models with zero index function ideal for positioning applications R High resolution models 300 or 360 pulses per revolution substantially improve measuring accuracy M High response frequency and noise immunity make encoders ideal for factory automation applications EH E TERESPECIFICATIONS DC12V 10 DC12V 10 DC12V 10 GG DC5V 5 12V 10 24V 15 DC5V 5 12V 10 24V 15 DC5V 5 12V
32. a new command is issued by setting the Buffer argument All values used are in quad pulses per second The command syntax Sent Address CMD QSpeed 4 Bytes Distance 4 Bytes Buffer l Byte Checksum 4 Bytes long are used to express the pulses per second The Buffer argument can be set to a 1 or O If a value of 0 is used the command will be buffered and executed in the order sent If a value of 1 is used the current running command is stopped any other commands in the buffer are deleted and the new command is executed 42 Buffered M2 Drive With Signed Speed And Distance Drive M2 with a speed and distance value The sign indicates which direction the motor will run The distance value is not signed This command is buffered Each motor channel M1 and M2 have separate buffers This command will execute immediately if no other command for that channel is executing otherwise the command will be buffered in the order it was sent Any buffered or executing command can be stopped when a new command is issued by setting the Buffer argument All values used are in quad pulses per second The command syntax Sent Address CMD QSpeed 4 Bytes Distance 4 Bytes Buffer l Byte Checksum 4 Bytes long are used to express the pulses per second The Buffer argument can be set to a 1 or 0 If a value of 0 is used the command will be buffered and executed in the order sent If a value of 1 is used the current running command is stopped any other c
33. aw and can be used to validate the data Command syntax Sent Address CMD Received Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum The command will return 6 bytes Byte 1 2 3 and 4 make up a long variable which is received MSB first and is the current ticks per second which can be any value from 0 4 294 967 295 Byte 5 is the direction 0 forward 1 backward Byte 6 is the checksum It is calculated the same way as sending a command and can be used to validate the data The following example will read M2 pulse per second and direction with RoboClaw address set to 128 hserout 128 19 read command for M2 encoder hserin Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum 20 Reset Quadrature Encoder Counters Will reset both quadrature decoder counters to zero Since CMD 20 is a write command a checksum value is required Command syntax and example hserout 128 20 148 amp 01111111 resets encoder registers EES c 2010 BasicMicro All Rights Reserved 48 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Commands 28 48 Motor Control by Quadrature Encoders The following commands are used to control motor speeds acceleration and distance using the quadrature encoders All speeds are given in quad pulses per second QPPS unless otherwise stated Quadrature encoders of different types and manufactures can be used However many have different resolutions
34. coder2 terminal print enc2 DEC temninal print terminal print status HEX terminal print S S c 2010 BasicMicro All Rights Reserved 58 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Luino e seeedi iebec lan head spec lM aCchess Esser E ETI terminal print Speed1 terminal print speed1 DEC EZE HE BELE TE EE Eelere EE ah if valid terminal print Speed2 terminal print speed2 DEC tomina E prne SE terminal println voll LT roboclaw SpeedAcce DistanceMI address 12000 12000 48000 Caas E eni Solna do displayspeed roboclaw ReadBuffers address deoth1 depth2 while depth1 roboclaw SpeedAcce DistanceMI address 12000 12000 48000 do displayspeed roboclaw ReadBuffers address deoth1 depth2 while depth1 c 2010 BasicMicro All Rights Reserved 59 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Reading Quadrature Encoder BasicATOM Pro Example The example was tested with a BasicATOM Pro RoboClaw was connected as shown in both packet serial wiring and quadrature encoder wiring diagrams The example will read the speed total ticks and direction of each encoder Connect to the program using the Basic Micro Studio terminal window set to 38400 baud The program will display the values of each encoders current count along with each encoder status bit in binary and the direct
35. d 1 3 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet RC Input c 2010 BasicMicro All Rights Reserved 14 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Mode 1 RC Input For RC mode set SW1 ON RC mode is typically used when controlling RoboClaw from a hobby RC radio This mode can also be used to simplify driving RoboClaw from a microcontroller using servo pulses There are 4 options in RC Input mode These options are set with SW4 SW5 SW6 and SW7 Switch 4 Mixing Mode SW4 ON Turns mixing mode ON S1 controls forward and reverse S2 controls steering Control will be like a car SW4 OFF Turns mixing mode OFF S1 controls motor 1 speed and direction S2 controls motor 2 speed and direction Control will be like a tank Switch 5 Exponential Mode SW5 ON Turns exponential mode ON Exponential response softens the center control position This mode is ideal with tank style robots SW5 OFF Turns exponential mode OFF Motor response will be linear and directly proportional to the control input Ideal for 4 wheel style robots c 2010 BasicMicro All Rights Reserved 1 5 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Switch 6 MCU or RC Control SW6 ON Turns MCU control mode ON RoboClaw will continue to execute last pulse received until new pulse received Signal lost fail safe and auto calibration are off in this mode SW6 OFF Tur
36. eceive serial data Use the below wiring diagrahm with the following code examples Make sure you install the BEC jumper to 5V if powering the MCU from RoboClaw GND gt VCC gt I O gt lt Install Jumper on MB Main Battery oe oo an g1 Status 2 Status 1 WH Error NNO OLEslLOGVECH DAY MEIH OGoyY woo oJoIwoIseg Power Switch gt EE c 2010 BasicMicro All Rights Reserved 28 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Simple Serial Arduino Example The following example will start both channels in reverse stop then full speed forward The program was written and tested with a Arduino Uno and Pin 5 connected to S1 Set switch SW2 and SW5 to ON Basic Micro Robo Claw Simple Serial Test Switch settings SW2 ON and SW5 ON Make sure Arduino and Robo Claw share common GND tinc lude TIE N BMSerial mySerial 5 6 EE E te Ekel myserial begin 19200 void loop myserial write 1 myserial write 1 delay 2000 myoerral write IZZO Myserial write I7 delay 2000 L eau c 2010 BasicMicro All Rights Reserved 29 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Simple Seria
37. el 15A Motor Controller Data Sheet 17 Read Quadrature Encoder Register M2 Read decoder M2 counter Since CMD 16 is a read command it does not require a checksum However a checksum value will be returned from RoboClaw and can be used to validate the data Command syntax Sent Address CMD Received Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum The command will return 6 bytes Byte 1 2 3 and 4 make up a long variable which is received MSB first and represents the current count which can be any value from 0 4 294 967 295 Each pulse from the quadrature encoder will increment or decrement the counter depending on the direction of rotation Byte 5 is the status byte for M1 decoder It tracks counter underflow direction overflow and if the encoder is operational The byte value represents BitO Counter Underflow 1 Underflow Occurred Clear After Reading Biti Direction 0 Forward 1 Backwards Bit2 Counter Overflow 1 Underflow Occurred Clear After Reading Bit3 Reserved Bit4 Reserved Bit5 Reserved Bit6 Reserved Bit7 Reserved Byte 6 is the checksum It is calculated the same way as sending a command It can be used to validate the resulting data The following example will read M1 counter register status byte and checksum value with RoboClaw address set to 128 hserout 128 17 read command for M2 encoder hserin Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Va
38. er or filtered PWM from a microcontroller Analog mode is ideal for interfacing RoboClaw joystick positioning systems or other non microcontroller interfacing hardware Analog mode can not use encoders Mode 3 Simple Serial In simple serial mode RoboClaw expects TTL level RS 232 serial data to control direction and speed of each motor Simple serial is typically used to control RoboClaw from a microcontroller or PC If using a PC a MAX232 type circuit must be used since RoboClaw only works with TTL level input Simple serial includes a slave select mode which allows multiple RoboClaws to be controlled from a signal RS 232 port PC or microcontroller Simple serial is a one way format RoboClaw only receives data Mode 4 Packet Serial In packet serial mode RoboClaw expects TTL level RS 232 serial data to control direction and speed of each motor Packet serial is typically used to control RoboClaw from a microcontroller or PC If using a PC a MAX232 type circuit must be used since RoboClaw only works with TTL level input In packet serial mode each RoboClaw is assigned an address using the dip switches There are 8 addresses available This means up to 8 RoboClaws can be on the same serial port When using the quadrature decoding feature of RoboClaw packet serial is required since it is a two way communications format This allows RoboClaw to transmit information about the encoders position and speed eaaa c 2010 BasicMicro All Rights Reserve
39. es which direction the motor will run The acceleration value is not signed This command is used to drive the motor by quad pulses per second and using an acceleration value for ramping Different quadrature encoders will have different rates at which they generate the incoming pulses The values used will differ from one encoder to another Once a value is sent the motor will begin to accelerate incrementally until the rate defined is reached The command syntax sent Address CMD Accel 4 Bytes Qspeed 4 Bytes Checksum 4 Bytes long are used to express the pulses per second Quadrature encoders send 4 pulses per tick So 1000 ticks would be counted as 4000 pulses The acceleration is measured in speed per second An acceleration value of 12 000 QPPS with a speed of 12 000 QPPS would accelerate a motor from 0 to 12 000 QPPS in 1 second Another example would be an acceleration value of 24 000 QPPS anda speed value of 12 000 QPPS would accelerate the motor to 12 000 QPPS in 0 5 seconds eau c 2010 BasicMicro All Rights Reserved 53 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 40 Mix Mode Drive M1 M2 With Speed And Acceleration Drive M1 and M2 in the same command using one value for acceleration and two signed speed values for each motor The sign indicates which direction the motor will run The acceleration value is not Signed The motors are sync during acceleration This command is used to drive the motor by quad
40. eturn string is terminated with a null 0 character This is done so the version information can be read from a standard PC terminal window hserout 128 21 read firmware version hserin Str VersionByte 32 0 Checksum 24 Read Main Battery Voltage Level Read the main battery voltage level connected to B and B terminals The voltage is returned in 10ths of a volt Command syntax Sent Address CMD Received Value Bytel Value Byte0 Checksum The command will return 3 bytes Byte 1 and 2 make up a word variable which is received MSB first and is 10th of a volt A returned value of 300 would equal 30V Byte 3 is the checksum It is calculated the same way as sending a command and can be used to validate the data The following example will read the main battery voltage with RoboClaw address set to 128 hserout 128 24 read main battery voltage hserin Value Bytel Value Byte0 Checksum 25 Read Logic Battery Voltage Level Read a logic battery voltage level connected to LB and LB terminals The voltage is returned in 10ths of a volt Command syntax Sent Address CMD Received Value Bytel Value Byte0 Checksum The command will return 3 bytes Byte 1 and 2 make up a word variable which is received MSB first and is 10th of a volt A returned value of 50 would equal 5V Byte 3 is the checksum It is calculated the same way as sending a command and can be used to validate the data The following example will read the ma
41. ficient versatile dual channel synchronous regenerative motor controller It supports dual quadrature encoders and can supply two brushed DC motors with 15 Amps continuous and 30 Amp peak With dual quadrature decoding you get greater control over speed and velocity Automatically maintain a speed even if load increases RoboClaw also has a built in PID routine for use with an external control system RoboClaw is easy to control with several built in modes It can be controlled from a standard RC receiver transmitter senal device microcontroller or an analog source such as a potentiometer based joystick RoboClaw is equipped with screw terminal for fast connect and disconnect All modes are set by the onboard dip switches making setup a snap Optical Encoders RoboClaw features dual channel quadrature decoding RoboClaw gives you the ability to create a closed loop system Now you can know a motors speed and direction giving you greater control over DC motors systems Power System The RoboClaw is equipped with synchronous regenerative motor drivers This means your battery 15 recharged when slowing down braking or reversing In addition a switching mode BEC is included It can supply a useful current of up to 3Amps The BEC is meant to provide power to a microcontroller or RC receiver B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Hardware Overview HOM N Hon MB C SNYES JOWZ Basicmicro com ff WwW O lt L qq
42. h Encoder Mounting Bracket E69 1 Panel supplied with A6A2 CWZ encoders mr 12 0 47 905 dia LASA_ aottt Three M3 YUEQING YING S IMPORT amp EXPORT CO LTD http www yingselectric com Appendix C 3 LV MaxSonar EZO v High Performance Sonar Range Finder CR With 25V 55V power the LV MaxSonar Wi EAU provides very short to long range detection and ranging in an incredibly small package The LV MaxSonar EZ0 detects objects from U inches to 254 inches 6 45 meters and provides sonar range information from 6 inches out to 254 inches with J inch resolution Objects from 0 inches to 6 inches typically range as 6 inches The interface output formats included are pulse width output analog voltage output and serial digital ourput Features Benefits Beam Characteristics inuous iable sain Very low cost sonar The LV MaxSonar EZ0 has the most for beam control and side ranger sensitivity of the LV MaxSonar e I REI N Reliable and stable range line yielding mbola wile beam wil high i i sensitivity Sample results for measured beam patterns are shown below on a 12 inch ed The detection pattem is shown for 25Vt055V5 ipply 2mA typical current draw e A 0 25 Inch diameter dowel e Readings can occur up to S Quality beam note the narrow beam for close small objects every 50mS 20 Hz rate characteristics B 1 inch diameter dowel ote the l
43. heet Packet Serial BasicATOM Pro Example The example will start the motor channels independently Then start turns with mix mode commands The program was written and tested with a BasicATOM Pro and P15 connected to S1 Set switch SW3 and SW5 to ON Basio Micro Robo Claw Packet Serial rest Commands OC 6 13 Switch settings SW3 ON and SW5 ON Main Pause 2000 scroto ee 000200070540 SerOwe Play EE EE EE dE TIE EES Pause 1000 Scuole is LOA RZ Of Oo ase R E pull seo SCout Pla bho E DE T L E sea Oy ws Zee De MSO Se Pause 1000 ER Pils aro 00r M2 T T Oe ae 0e MI full speed backwards SS COE Play EE EE e EE kee Pause 1000 Scuole is LLOAO0 pilZe7 UO Oo 2s R E pull sco SCout EE EE EE Zero De MZ T Pause 1000 scroll Ma mode rige EE peed Pause 1000 SEET S a IE EE a e s top Pause 1000 SCROLLER E 6 0P Mi mode lert Tull s pecsd Pause 1000 Se EE KEE a le Or lS EE Mise modems top Goto Main EE c 2010 BasicMicro All Rights Reserved 39 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Battery and Version Information B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 21 Read Firmware Version Read RoboClaw firmware version Returns up to 32 bytes and is terminated by a null character Command syntax Sent Address CMD Received RoboClaw 10 2A v1 3 9 Checksum The command will return up to 32 bytes The return string includes the product name and firmware version The r
44. hen a new command is issued by setting the Buffer argument All values used are in quad pulses per second The command syntax Sent Address CMD Accel 4 Bytes QOSpeedM1 4 Bytes DistanceM1 4 Bytes OSpeedM2 4 bytes DistanceM2 4 Bytes Buffer l Byte Checksum 4 Bytes long are used to express the pulses per second The Buffer argument can be set to a 1 or O If a value of 0 is used the command will be buffered and executed in the order sent If a value of 1 is used the current running command is stopped any other commands in the buffer are deleted and the new command is executed 47 Read Buffer Length Read both motor M1 and M2 buffer lengths This command can be used to determine how many commands are waiting to execute Sent Address CMD Received BufferM1 1 Bytes BufferM2 1 Bytes Checksum The return values represent how many commands per buffer are waiting to be executed The maximum buffer size per motor is 31 commands EE c 2010 BasicMicro All Rights Reserved 56 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Reading Quadrature Encoder Arduino Example The example was tested with an Arduino Uno RoboClaw was connected as shown in both packet serial wiring and quadrature encoder wiring diagrams The example will read the speed total ticks and direction of each encoder Connect to the program using a terminal window set to 38400 baud The program will display the values of each encoders
45. his is a high resolution version of command 18 and 19 Command 31 can be used to make a independent PID routine The resolution of the command is required to create a PID routine using any microcontroller or PC used to drive RoboClaw The command syntax Sent Address CMD Received Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum The command will return 5 bytes MSB sent first for a long The first 4 bytes are a 32 byte value long that repersent the speed The 5th byte Value2 is direction 0 forward 1 backward is A checksum is returned in order to validate the data returned 32 Drive M1 With Signed Duty Cycle Drive M1 using a duty cycle value The default PWM is 8bit resolution The default value can be changed see CMD 48 The duty cycle is used to control the speed of the motor without a quadrature encoder A value used to drive one motor at 50 will be differ from one motor to the next The command syntax Sent Address CMD Duty 2 Bytes Checksum The duty value is signed and the default range is 8bits The default PWM resolution can be changed for more range To change the resolution see command 48 33 Drive M2 With Signed Duty Cycle Drive M2 using a duty cycle value The default PWM is 8bit resolution The default value can be changed see CMD 48 The duty cycle is used to control the speed of the motor without a quadrature encoder A value used to drive one motor at 50 will be differ from o
46. ial output on the TX output When BW pin is held high the TX output sends a pulse instead of serial data suitable for low noise chaining LV MaxSonar EZ0 Timing Description 250mS after power up the LV MaxSonar EZO je ready to accept the RX command If the RX pin is left open or held high the sensor will first run a calibration cycle 49mS and then it will take a range reading 49mS After the power up delay the first reading will take an additional 100mS Subsequent readings will take 49mS The LV MaxSonar Pan checks the RX pin at the end of every cycle Range data can be acquired once every 49mS Each 49mS period starts by the RX being high or open after which the LV MaxSonar EZO sends thirteen 42KHz waves after which the pulse width pin PW is set high When a target is detected the PW pin is pulled low The PW pin is high for up to 37 5mS if no target is detected The remainder of the 49mS time less 4 7mS is spent adjusting the analog voltage to the correct level When a long distance is measured immediately after a short distance reading the analog voltage may not reach the exact level within one read cycle During the last 4 7mS the serial data is sent The LV MaxSonar EZ0 timing is factory calibrated to one percent at five volts and in use is better than two percent In addition operation at 3 3V typically causes the objects range to be reported one to two percent further than actual LV MaxSonar EZO General
47. ignal OV is active and 5V is not active When the flip switch signal is active all inputs to RoboClaw are reversed SW7 OFF Turns flip switch input S3 off c 2010 BasicMicro All Rights Reserved 23 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Analog Wiring Example Connect the RoboClaw as shown below using two potentiometers Install BEC 2V jumper and set switch SW4 to ON Mixing Mode You can also use the wire example with SW4 OFF Center the potentiometers before applying power or the attached motors will start moving S1 potentiometer in mix mode SW4 will control forward and reverse S2 potentiometer in mix mode SW4 will control turning LEFT RIGHT S1 Potentiometer S2 Potentiometer lt Install Jumper on MB Main Battery Status 2 Status 1 DD 9 Error QA CO OO0p OLE8SLOGVTECH eid Odd IASY MEIH 0009 LUOO 0 01IUU01ISp9 O Power Switch 24 c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Simple Serial c 2010 BasicMicro All Rights Reserved 25 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Mode 3 Simple Serial Sim
48. ill take RoboClaw about 1 second to calibrate the neutral position Remove BEC Jumper lt Install Jumper on MB Main Battery OL6E8LZ9NGVTECH Error woo oJoIWoIseg Power Switch c 2010 BasicMicro All Rights Reserved 18 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet RC Control Arduino Example The example will drive a 2 motor 4 wheel robot in reverse stop forward left turn and then right turn The program was written and tested with a Arduino Uno and P5 connected to S1 P6 connected to S2 Set switches SW1 SW4 SW5 and SW6 to ON Basic Micro Robo Claw RC Mode Control Robo Claw EE Ee yO avis irom DEET See Switch settings SW1 ON SW4 ON SW5 ON and SW6 ON tinelude Servo nN Servo myservol create servo object to control a Roboclaw channel Servo myservo2 create servo object to control a Roboclaw channel iene variable to store the servo position void setup myservol attach 5 attaches the RC signal on pin 5 to the servo object myservo2 attach 6 attaches the RC signal on pin 6 to the servo object vord loop myservol writeMicroseconds 1500 Stop myservo2 writeMicroseconds 1500 Stop delay 2000 myservol writeMic
49. in battery voltage with RoboClaw address set to 128 hserout 128 25 read logic battery voltage hserin Value Bytel Value Byte0 Checksum c 2010 BasicMicro All Rights Reserved 41 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 26 Set Minimum Logic Voltage Level Sets logic input LB LB minimum voltage level If the battery voltages drops below the set voltage level RoboClaw will shut down The value is cleared at start up and must set after each power up The voltage is set in 2 volt increments A value of 0 sets the minimum value allowed which is 3V The valid data range is 0 120 6V 28V The formula for calculating the voltage is Desired Volts 6 x 5 Value Examples of valid values are 3V 0 8V 10 and 11V 25 RoboClaw example with address set to 128 hserout 128 26 0 154 amp 0X7F 27 Set Maximum Logic Voltage Level Sets logic input LB LB maximum voltage level The valid data range is 0 144 OV 28V By setting the maximum voltage level RoboClaw will go into shut down and requires a hard reset to recovers The formula for calculating the voltage is Desired Volts x 5 12 Value Examples of valid values are 12V 62 16V 82 and 24V 123 RoboClaw example with address set to 128 hserout 128 27 82 213 amp O0X7F Main Battery Voltage Levels The main battery levels are set in a similar way as the logic battery See command 2 and 3 for details c 2010 BasicMic
50. ion bit As the encoder is turned it will update the screen Encoderl Var Long Encoder2 Var Long otat us Var Byte CRC Var Byte ENABLEHSERIAL used on AtomPro24 and AtomPro28 AtomPro40 and ARC 32 use EnableHSerial2 SetHSerial H38400 H8DATABITS HNOPARITY HISTOPBITS Pause 250 Hserout 128 20 148 amp 0x7F Resets encoder registers Main Pause 100 ReadEncoderM1 Hserout 128 16 Hserin Encoder1 byte3 Encoderl Byte2 Encoderl Bytel Encoder1 Byte0 Status crc Saronio EE Ws 04 0 eine Ib e JI Seite ReadSpeedM1 Hserout 128 18 Hserin Encoderl byte3 Encoderl Byte2 Encoderl Bytel Encoderl Byte0 Status crc Ss a ene Mos 6 Mo Sjesecls SP IWC ee Is IWiiescicmens DIC SEI ReadEncoderM2 IS IRE MZ SAI Hserin Encoder2 byte3 Encoder2 Byte2 Encoder2 Bytel Encoder2 Byte0 Status crc Samone Stevie 5400 EE ReadSpeedM2 Hserout 128 19 Hserin Encoder2 byte3 Encoder2 Byte2 Encoder2 Bytel Encoder2 Byte0 Status crc Sao Soule Mss fe lo esse VDC T ils WiLiescinens 7 DIC STAI Goto Main c 2010 BasicMicro All Rights Reserved 60 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Speed Controlled by Quadrature Encoders BasicATOM Pro Example The following example was written using an BasicATOM Pro RoboClaw was connected as shown in both packet serial wiring and quadrature encoder wiring diagrams The example will command a 4wheel robot to move forward backward
51. ksum 4 Bytes long are used to express the pulses per second Quadrature encoders send 4 pulses per tick So 1000 ticks would be counted as 4000 pulses 36 Drive M2 With Signed Speed Drive M2 with a speed value The sign indicates which direction the motor will turn This command is used to drive the motor by quad pulses per second Different quadrature encoders will have different rates at which they generate the incoming pulses The values used will differ from one encoder to another Once a value is sent the motor will begin to accelerate as fast as possible until the rate defined is reached The command syntax sent Address CMD Qspeed 4 Bytes Checksum 4 Bytes long are used to expressed the pulses per second Quadrature encoders send 4 pulses per tick So 1000 ticks would be counted as 4000 pulses EE c 2010 BasicMicro All Rights Reserved 52 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 37 Mix Mode Drive M1 M2 With Signed Speed Drive M1 and M2 in the same command using a signed speed value The sign indicates which direction the motor will turn This command is used to drive both motors by quad pulses per second Different quadrature encoders will have different rates at which they generate the incoming pulses The values used will differ from one encoder to another Once a value is sent the motor will begin to accelerate as fast as possible until the rate defined is reached The command syntax
52. l BasicATOM Pro Example The following example will start both channels in reverse stop then full speed forward The program was written and tested with a BasicATOM Pro and PO connected to S1 Set switch SW2 and SW5 to ON ON CTS 12345678910 Bas ic Micro Robo Claw Simple Serial Test Switch settings SW2 ON and SW5 ON Make sure BAP and Robo Claw share common GND Main SO Piso 200 Ol Bul esitOe born E Derek Pause 500 EE Eelere Pause 3000 Serout lo ITO EE 255 bOwanrd tact Pause 3000 LER Pils EEN B 642s uet Oop boith ehanme is Pause 500 Seront PID EE 32 ob Reverse slowly Pause 3000 Serout Pils 2192007 11 128 Reverse fast Pause 3000 Goto Main EES c 2010 BasicMicro All Rights Reserved 30 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Packet Serial c 2010 BasicMicro All Rights Reserved 3 1 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Mode 4 Packet Serial Packet serial mode set SW3 ON and then selected address See table below Packet serial is used to communicate more sophisticated instructions to RoboClaw RoboClaw can send or receive serial data in packet mode The basic command structures consists of address byte command byte data bytes and a checksum The amount of data each command will send or receive can vary In packet mode the RoboClaw serial commands are buffered for more complex functionality Baud Rate Packet serial sup
53. lue2 Checksum 18 Read Speed M1 Read M1 counter speed Returned value is in pulses per second RoboClaw keeps track of how many pulses received per second for both decoder channels Since CMD 18 is a read command it does not require a checksum to be sent However a checksum value will be returned from RoboClaw and can be used to validate the data Command syntax Sent Address CMD Received Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum The command will return 6 bytes Byte 1 2 3 and 4 make up a long variable which is received MSB first and is the current ticks per second which can be any value from O 4 294 967 295 Byte 5 is the direction 0 forward 1 backward Byte 6 is the checksum It is calculated the same way as sending a command and can be used to validate the data The following example will read M1 pulse per second and direction with RoboClaw address set to 128 hserout 128 18 read command for Ml encoder hserin Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum EES c 2010 BasicMicro All Rights Reserved 47 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 19 Read Speed M2 Read M2 counter speed Returned value is in pulses per second RoboClaw keeps track of how many pulses received per second for both decoder channels Since CMD 19 is a read command it does not require a checksum to be sent However a checksum value will be returned from RoboCl
54. mergency Stop In serial mode S3 becomes the emergency stop S3 is active low It is internally pulled up so it will not accidentally trip Basicmicro com Robo Claw RevC JOUZ II IC L smels Z SMEIS WI A O LB LB ele X 2 1 keck O c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Logic Supply Select The RoboClaw logic requires 5VDC which is provided from the on board regulator The regulator source input is set with the logic supply jumper Set to LB for a separate logic battery or MB for the main battery as the source Basicmicro com Robo Claw RevC JOU L smels Z Snes LB MB SHIN BEL na A O LB LB ele 2 1 sade c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Main Battery Screw Terminals The main battery connections are marked with a B and B on the main scre
55. ne motor to the next The command syntax Sent Address CMD Duty 2 Bytes Checksum The duty value is signed and the default range is 8bits The default PWM resolution can be changed for more range To change the resolution see command 48 c 2010 BasicMicro All Rights Reserved 5 1 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 34 Mix Mode Drive M1 M2 With Signed Duty Cycle Drive both M1 and M2 using a duty cycle value The default PWM is 8bit resolution The default value can be changed see CMD 48 The duty cycle is used to control the speed of the motor without a quadrature encoder A value used to drive one motor at 50 will be differ from one motor to the next The command syntax Sent Address CMD DutyM1 2 Bytes DutyM2 2 Bytes Checksum The duty value is signed and the default range is 8bits The default PWM resolution can be changed for more range To change the resolution see command 48 35 Drive M1 With Signed Speed Drive M1 using a speed value The sign indicates which direction the motor will turn This command is used to drive the motor by quad pulses per second Different quadrature encoders will have different rates at which they generate the incoming pulses The values used will differ from one encoder to another Once a value is sent the motor will begin to accelerate as fast as possible until the defined rate is reached The command syntax sent Address CMD Qspeed 4 Bytes Chec
56. ned This command is used to control the motors top speed total distanced traveled and at what incremental acceleration value to use until the top speed is reached Each motor channel M1 and M2 have separate buffers This command will execute immediately if no other command for that channel is executing otherwise the command will be buffered in the order it was sent Any buffered or executing command can be stopped when a new command is issued by setting the Buffer argument All values used are in quad pulses per second The command syntax Sent Address CMD Accel 4 bytes QSpeed 4 Bytes Distance 4 Bytes Buffer l Byte Checksum 4 Bytes long are used to express the pulses per second The Buffer argument can be set to a 1 or O If a value of 0 is used the command will be buffered and executed in the order sent If a value of 1 is used the current running command is stopped any other commands in the buffer are deleted and the new command is executed 45 Buffered M2 Drive With Signed Speed Accel And Distance Drive M2 with a speed acceleration and distance value The sign indicates which direction the motor will run The acceleration and distance values are not signed This command is used to control the motors top speed total distanced traveled and at what incremental acceleration value to use until the top speed is reached Each motor channel M1 and M2 have separate buffers This command will execute immediately if no other command f
57. ns RC control mode ON RoboClaw will calibrate the center and end points automatically to maximize stick throw This mode includes a fail safe If control input is lost RoboClaw will shut down Switch 7 Flip Switch Input SW7 ON Flip switch input requires servo pulse Pulse greater than 1 5ms will reverse steering control The flip switch is typically used in robot combats to automatically reverse the controls if a robot is flipped over SW7 OFF Flip switch input expects TTL control signal OV for flipped and 5V for normal c 2010 BasicMicro All Rights Reserved 16 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Servo Pulse Ranges The RoboClaw expects RC servo pulses on S1 and S2 to drive the motors when the dip switches are set for RC mode The center points are calibrated at start up 1000us is the default for full reverse and 2000us is the default for full forward The RoboClaw will auto calibrate these ranges on the fly If a pulse smaller than 1000us or larger than 2000us is detected the new pulses will be set as the new range Pulse Function 000us EU Reverse 2000us LEI Forward c 2010 BasicMicro All Rights Reserved 17 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet RC Wiring Example Connect the RoboClaw as shown below Set switches SW1 and SW4 to ON Make sure you center the control sticks and turn the radio on first then the receiver then RoboClaw It w
58. o 149 F Self Discharge Rate lt 3 monthly F BMS Using battery management system is important because we are using a battery pack of 4 cells The cells are exposed to different temperature as they worked This difference in temperature as well as the differences in the chemical component as they are not perfect will make the voltage different from cell to cell by time Using the BMS will protect the cells from overcharge overdischarge over current drown as well as keep cells having the same voltage In appendix E the BMS specification and user manual are found ke WW mm VEEL AO ele A oe Figure 14 BMS G Charger The charger that we used has Over Voltage Protection Short Circuit Protection and Output Reverse Protection This charger is a special charger for the lithium ion batteries charger is shown in figure 15 It can support a 10 Amp which means the charging time is 6 hours Charging Time 1 41 Ah rate of the pack 10A charge current this formula shows that the time is a bit longer as there are two stages of charging The first one is when the current is constant and the voltage is increased In the other hand after this stage is the stage when the charger start holding the voltage and start decreasing the current till it reaches zero For more detail see appendix F Figure 15 Charger H Bumpers There is one more thing have been added in this term which is the bumpers The bumpers are important
59. oating in between and is firmly OFF or ON See illustration below The red switch SW1 is in the ON position The grey colored switches are in the OFF position Lsnjejg gz snye asicmicro com Robo Claw RevC c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Low Voltage Cutoff RoboClaw has a built in low voltage protection This has two main purposed To protect RoboClaw from running erratically when the main battery level gets to low and protect a Lithium battery from being damaged Voltage EES c 2010 BasicMicro All Rights Reserved 12 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet RoboClaw Modes There are 4 modes Each with a specific way to control RoboClaw The following list explain each mode and the ideal application Mode 1 RC Input With RC input mode RoboClaw can be controlled from any hobby RC radio system RC input mode also allows low powered microcontroller such as a Basic Stamp or Nano to control RoboClaw RoboClaw expects servo pulse inputs to control the direction and speed Very similar to how a regular servo is controlled RC mode can not use encoders Mode 2 Analog Analog mode uses an analog signal from OV to 5V to control the speed and direction of each motor RoboClaw can be controlled using a potentiomet
60. oder M1 counter Since CMD 16 is a read command it does not require a checksum However a checksum value will be returned from RoboClaw and can be used to validate the data Command syntax Sent Address CMD Received Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum The command will return 6 bytes Byte 1 2 3 and 4 make up a long variable which is received MSB first and represents the current count which can be any value from 0 4 294 967 295 Each pulse from the quadrature encoder will increment or decrement the counter depending on the direction of rotation Byte 5 is the status byte for M1 decoder It tracks counter underflow direction overflow and if the encoder is operational The byte value represents BitO Counter Underflow 1 Underflow Occurred Clear After Reading Bit1 Direction 0 Forward 1 Backwards Bit2 Counter Overflow 1 Underflow Occurred Clear After Reading Bit3 Reserved Bit4 Reserved Bit5 Reserved Bit6 Reserved Bit7 Reserved Byte 6 is the checksum It is calculated the same way as sending a command It can be used to validate the resulting data The following example will read M1 counter register status byte and checksum value with RoboClaw address set to 128 hserout 128 16 read command for Ml encoder hserin Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum c 2010 BasicMicro All Rights Reserved 46 B0097 RoboClaw 2 Chann
61. oder combinations can be used The RoboClaw PID system consist of four constants starting with QPPS P Proportional I Integral and D Derivative The defaults values are OPPS 44000 P 0x00010000 I 0x00008000 0x00004000 QPPS is the speed of the encoder when the motor is at 100 power P I D are the default values used after a reset Command syntax Sent Address CMD D 4 bytes P 4 bytes I 4 bytes QPPS 4 byte Checksum Each value is made up of 4 bytes for a long To write the registers a checksum value is used This prevents an accidental write c 2010 BasicMicro All Rights Reserved 50 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 30 Read Current Speed M1 Read the current pulse per 125th of a second This is a high resolution version of command 18 and 19 Command 30 can be used to make a independent PID routine The resolution of the command is required to create a PID routine using any microcontroller or PC used to drive RoboClaw The command syntax Sent Address CMD Received Valuel Byte3 Valuel Byte2 Valuel Bytel Valuel Byte0 Value2 Checksum The command will return 5 bytes MSB sent first for a long The first 4 bytes are a 32 byte value long that repersent the speed The 5th byte Value2 is direction 0 forward 1 backward is A checksum is returned in order to validate the data returned 31 Read Current Speed M2 Read the current pulse per 125th of a second T
62. ommands in the buffer are deleted and the new command is executed c 2010 BasicMicro All Rights Reserved 54 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 43 Buffered Mix Mode Drive M1 M2 With Signed Speed And Distance Drive M1 and M2 with a speed and distance value The sign indicates which direction the motor will run The distance value is not signed This command is buffered Each motor channel M1 and M2 have separate buffers This command will execute immediately if no other command for that channel is executing otherwise the command will be buffered in the order it was sent Any buffered or executing command can be stopped when a new command is issued by setting the Buffer argument All values used are in quad pulses per second The command syntax Sent Address CMD QSpeedM1 4 Bytes DistanceM1 4 Bytes OSpeedM2 4 Bytes DistanceM2 4 Bytes Buffer l Byte Checksum 4 Bytes long are used to express the pulses per second The Buffer argument can be set to a 1 or O If a value of 0 is used the command will be buffered and executed in the order sent If a value of 1 is used the current running command is stopped any other commands in the buffer are deleted and the new command is executed 44 Buffered M1 Drive With Signed Speed Accel And Distance Drive M1 with a speed acceleration and distance value The sign indicates which direction the motor will run The acceleration and distance values are not sig
63. ong narrow e glande eem on can gt mtine holes en continually m i rnt 3 25 Parara EE note the lone controlled detection pattern mat range information WEI Lange 11 inch wide board moved left to right with e operation provides excellent for multiple la scia brasia the range reading as desired and the sensor stationary This shows the All prias mg active sensor s range capability Serial 0 to Vec 9600Baud aie or K ieaie mengen Aer SIN Sensor reports the range be shape of the board i e flat mimor like Analog Vec 512 inch reading directly frees up and should never be confused with actual e Pulse SS 147uSfinch Weer processor S a a inedow i Fast measurement cycle LL LEELA T User can choose any of n Designed for protecte indoor environments CECCO tt Sensor operates at 42KHz Pee OSO sensor drive double Vcc I NES JE _ a D il MaxBotiX ne Email info maxbotx com MaxBotix MaxSonar amp E ZD are trademarks of MaxBotix inc Wek wast maebotce com LV E2Z0 patent 7 679 006 Copyright 2005 2012 Td m MBO gas LV MaxSonar EZO Pin Out GND Return for the DC power supply GND amp Vcc must be LV MaxSonar EZ0 Circuit ripple and noise free for best operation The iV MaS ona EEN 5V Vce Operates on 2 5V 5 5V Recommended current using active components consisting of an LM324 capability of 3mA for 5V and 2mA for 3V
64. or that channel is executing otherwise the command will be buffered in the order it was sent Any buffered or executing command can be stopped when a new command is issued by setting the Buffer argument All values used are in quad pulses per second The command syntax Sent Address CMD Accel 4 bytes QSpeed 4 Bytes Distance 4 Bytes Buffer l Byte Checksum 4 Bytes long are used to express the pulses per second The Buffer argument can be set to a 1 or 0 If a value of 0 is used the command will be buffered and executed in the order sent If a value of 1 is used the current running command is stopped any other commands in the buffer are deleted and the new command is executed c 2010 BasicMicro All Rights Reserved 55 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 46 Buffered Mix Mode Drive M1 M2 With Signed Speed Accel And Distance Drive M1 and M2 with a speed acceleration and distance value The sign indicates which direction the motor will run The acceleration and distance values are not signed This command is used to control both motors top speed total distanced traveled and at what incremental acceleration value to use until the top speed is reached Each motor channel M1 and M2 have separate buffers This command will execute immediately if no other command for that channel is executing otherwise the command will be buffered in the order it was sent Any buffered or executing command can be stopped w
65. p EXPORT CO LTD http www yingselectric com MEA 53025 WS AGA2 INCREMENTAL ROTARY ENCODERS OUTSIDE DIAM d 25 MODEL A6A2 EARHIE SUBSTITUTE E6A2 SKIS dap 3 A6A2 BRAS E6A2 Ram I g SPECIFICATIONS Matese SW Mechanical Spec STER Startion Torque rit EMoment of Inertia Dk Bl Radial Shaft loading Fj Thrust RAKE Mounting Tolerance WR Raclial 0 03mm TIR Max EMRZ Axial 0 2mm Wax fi EWXShaft Runout 0 T Max RER L tt Allowable Shaft Load E Radial 5N EI Axial 3N 26 E RE Maxirnun Rotating Speed 5000rpm HEI Operating Temp Range TRR A0 55 RRR 25 80 Or HW Doum dite THEN rw 35 85 RHOR amp 5E 4 A Insulation resistance 20M 2 BI EDC VERA DHHS HR IN Hi E Dielectric strength AC500V 50 50Hx min ZEIL 7 BRIK L bL IRI e IN A Vibration resistance 10 55Hz EES zmm X Y ZEA tHe INA Shock resistance http www yingselecteie com y 25 58 ax IECH een SES S H rer KE aile length 500mm 60g GOR Jam ZER RT BE6A2 CW20 KARF CHARME E iR Dimensions amp ftunit mm Al Z Smodel AGA 2 Blue E o 3 La gt 5 OUTA 46 5 PV CHEER 645 HEREA 015mm ARR SS 0 9mm eRAESOOmmMHE Output cable shielded O D 4 dia Standard length 50cm 1 64 ft YUEQING YING S IMPORT amp EXPORT CO LTD http www yingselectric com WR 4 44025 WE AGA2 INCREMENTAL ROTARY ENCODERS OUTSIDE DIAM d 25 MODEL A6A2 4 4ARIN SUBSTITUTE E6A2 his 25 HS A6A
66. ple Serial mode set SW1 OFF SW2 ON and SW3 OFF In this mode S1 accepts TTL level byte commands RoboClaw is receive only and uses 8N1 format which is 8 bits no parity bits and 1 stop bit If your using a microcontroller you can interface directly to RoboClaw If your using a PC a level shifting circuit is required MAX232 The baud rate is set by the dip switches Switch 1 Slave Select SW1 ON Turns slave select ON Slave select is used when more than one RoboClaw is on the same serial bus When slave select is set to ON the S2 pin becomes the select pin Set S2 high 5V and RoboClaw will execute the next commands Set S2 low OV and RoboClaws will ignore all sent commands Simple Serial Slave Setting up the RoboClaw for serial slave is straight forward Make sure all RoboClaws share a common signal ground GND shown by the black wire PO Brown line is connected to S1 of all 3 RoboClaws which is the serial in of the RoboClaw P1 P2 and P3 are connected to S2 Only one MCU pin is connected to each RoboClaws S2 pin To enable RoboClaw hold S2 high otherwise any commands sent is ignored a1y d esicsiis 81 a Wi HAUT 9 ZE AL 2 a aj ID eng d RI pa en F ED RE g1 97 O EN v 9 DER Cu RE OH ID un ago 3 te leslesfis O lesles el AG AZ D ER gs D gt
67. plied to charge the battery When using an ATX type power supply if it senses anything over 16V it will shut down By setting the maximum voltage level RoboClaw before exceeding it will go into hard breaking mode until the voltage drops below the maximum value set The formula for calculating the voltage is Desired Volts x 5 12 Value Examples of valid values are 12V 62 16V 82 and 24V 123 Example with RoboClaw address set to 128 serout Pia 119200 128 3 02 213 amp UXIF 4 Drive Forward M2 Drive motor 2 forward Valid data range is 0 127 A value of 127 full speed forward 64 about half speed forward and 0 full stop Example with RoboClaw address set to 128 Serout P15 119200 128 4 127 259 amp OX7F M2 full speed forward E c 2010 BasicMicro All Rights Reserved 34 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet 5 Drive Backwards M2 Drive motor 2 backwards Valid data range is 0 127 A value of 127 full speed backwards 64 about half speed backward and 0 full stop Example with RoboClaw address set to 128 serout Plb5 119200 128 5 127 260 amp 0X F 7M2 full speed forward 6 Drive M1 7 Bit Drive motor 1 forward and reverse Valid data range is 0 127 A value of 0 full speed reverse 64 stop and 127 full speed forward Example with RoboClaw address set to 128 Serout P15 119200 128 6 96 230 amp OX7F MI half speed forward 7 Drive M2 7 Bit Drive
68. ports the same baud rate modes as simple serial and uses the same RS232 8N1 format The following table defines the available baud rates and their respective switch settings Baud Rate SW5 CI OO a9200 iON Address When using packet serial each RoboClaw must be assigned a unique address With up to 8 addresses available you can have up to 8 RoboClaws bussed on the same RS232 port The following table defines the addresses and their respective switch settings Address SW 1 SW6 SW7 128 0x80 ia es E c 2010 BasicMicro All Rights Reserved 32 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Checksum Calculation All packet serial commands use a 7 bit checksum to prevent corrupt commands from being executed Since the RoboClaw expects a 7bit value the 8th bit is masked The checksum is calculated as follows Address Command Data Checksum To mask the 8th bit you use can a simple math expression called AND as shown below Serout P15 119200 128 0 127 255 amp 0X7F The hexadecimal value 0X7F is used to mask the 8th bit You can also use a binary value of 01111111 as shown below Sserour Plo 219200 128 0 227 255 amp 7011111117 EE c 2010 BasicMicro All Rights Reserved 33 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Commands O 7 Standard Commands The following commands are the standard set of commands used with packet mode The command syntax is the same fo
69. r EZO shown in figure 12 is 3 42kHz Ultrasonic sensor measures distance to objects RoHS Compliant Read from all 3 sensor outputs Analog Voltage Serial Pulse Width Virtually no sensor dead zone objects closer than 6 inches range as 6 inches Resolution of 1 inch Maximum Range of 254 inches 645 cm Operates from 2 5 5 5V Low 2 0mA average current requirement 20Hz reading rate Small lightweight module Designed for easy integration into your project or product Widest beam of the LV MaxSonar EZ sensors Great for people detection applications Figure 12 LV MaxSonar EZO For more information see appendix C E Batteries A four Life MnPO4 60AH are used in this robot There are many reasons of using these batteries Reading the specifications will give an idea about these reasons Figure 13 shows the battery pack All the charts and the instruction manual are found in appendix D gt tT gt E dle det end s vee ei ELECTRIC VEHICLE TECHNOLOGY Figure 13 LiFeMnP04 60AH Battery pack Specifications 4 Nominal Voltage 12 8V 4X 3 2 V Nominal Capacity 60 Ah LiFe MnPO4 chemistry Operation Voltage Range 11 2 to 14 4V Weight 9 2 kg or 20 3 Ibs Dimension 125X280X180 mm or 4 9X11X7 1 in Max Charging Current 3C Max Discharge Current 3C continuous 10C pulsed Cycle Life gt 1500 80 DOD Operating Temperature 20 to 65 Cor 4 t
70. r commands 0 to 7 Address Command ByteValue Checksum O Drive Forward M1 Drive motor 1 forward Valid data range is 0 127 A value of 127 full speed forward 64 about half speed forward and 0 full stop Example with RoboClaw address set to 128 Serout P15 119200 128 0 127 255 amp OX7F Ml full speed forward 1 Drive Backwards M1 Drive motor 1 backwards Valid data range is 0 127 A value of 127 full speed backwards 64 about half speed backward and 0 full stop Example with RoboClaw address set to 128 Serout P15 119200 128 1 127 256 amp OX7F 7M1 full speed forward 2 Set Minimum Main Voltage Sets main battery B B minimum voltage level If the battery voltages drops below the set voltage level RoboClaw will shut down The value is cleared at start up and must set after each power up The voltage is set in 2 volt increments A value of 0 sets the minimum value allowed which is 6V The valid data range is 0 120 6V 30V The formula for calculating the voltage is Desired Volts 6 x 5 Value Examples of valid values are 6V O 8V 10 and 11V 25 Example with RoboClaw address set to 128 serou t Plo 119200 I23 2 Z5 1605 amp 0X7F 3 Set Maximum Main Voltage Sets main battery B B maximum voltage level The valid data range is 0 154 OV 30V If you are using a battery of any type you can ignore this setting During regenerative breaking a back voltage is ap
71. ro All Rights Reserved 42 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Quadrature Decoding c 2010 BasicMicro All Rights Reserved 43 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Quadrature Decoding Handling the quadrature encoders is done using packet serial All the switch settings still apply in to enabling packet serial and setting the desired baud rates See Mode Packet Serial The following commands deal specifically with the dual quadrature decoders built into RoboClaw Checksum Calculation All packet serial commands use a 7 bit checksum to prevent corrupt commands from being executed Since the RoboClaw expects a 7bit value the 8th bit is masked The checksum is calculated as follows Address Command Data Checksum To mask the 8th bit you use can a simple math expression called AND as shown below Serout P15 i19200 128 0 127 255 amp 0X7F The hexadecimal value 0X7F is used to mask the 8th bit You can also use a binary value of 01111111 as shown below Serout Pl 119200 128 UO 127 455 KK EE EK EEN c 2010 BasicMicro All Rights Reserved 44 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Quadrature Encoder Wiring RoboClaw can read two quadrature encoders The encoders are connected to RoboClaw using CN4 Both GND and 5 volts are present on the header to power the encoders In a two motor robot configuration one motor will spin clock wi
72. roseconds 1250 full forward delay 1000 myservol writeMicroseconds 1500 stop delay 2000 myservol writeMicroseconds 1750 full reverse delay 1000 myservol writeMicroseconds 1500 Stop delay 2000 myservo2 writeMicroseconds 1250 full forward delay 1000 myservo2 writeMicroseconds 1500 Stop delay 2000 myservo2 writeMicroseconds 1750 full reverse delay 1000 E c 2010 BasicMicro All Rights Reserved 19 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet RC Control BasicATOM Pro Example The example will drive a 2 motor 4 wheel robot in reverse stop forward left turn and then right turn The program was written and tested with a BasicATOM Pro and PO connected to S1 P1 connected to S2 Set switches SW1 SW4 SW5 and SW6 to ON Bas New bee Omir OO Ome lair Mode ib io Cilla with Ser pulses Trom a Mle EE el Switch settings SW1 ON SW4 0N SW5 ON and SW6 ON Main EE Wis Is eZ eo SILOS pulse ees EE PS Op pause 2000 Sullsoure Plas SOC eZ full backward pause 1000 PULS one RE HR E ESCOP pause 2000 Sulbsoure Pls 250 Z E G E forward pause 1000 pulce EE EE T pause 2000 E Plas SO lt 2 se lert ta ia pause 1000 EE ER Je ia O0 T pause 2000 EE TER kA O SIG Teele T pause 1000 goto main EE c 2010 BasicMicro All Rights Reserved 20 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Analog Input c 2010 BasicMicro All
73. se CW while the other motor will spin counter clock wise CCW The A and B inputs for one of the two encoders must be reversed as shown If either encoder is connected wrong one will count up and the other down this will cause commands like mix drive forward to not work properly LUIS DIGITAL USES DIGITAL C13 OOD F E Status2 Status1 A R18 Q O Ge JOMOd I O EE Uh ool Oooo Mo ff WH Error R5 Robo Claw p3 M1A M1B B B M2B M2A Basicmicro com c 2009 O c 2010 BasicMicro All Rights Reserved 45 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Commands 16 20 Reading Quadrature Encoders The following commands are used in dealing with the quadrature decoding counter registers The quadrature decoder is a simple counter that counts the incoming pulses tracks the direction and speed of each pulse There are two registers one each for M1 and M2 Note A microcontroller with a hardware UART is recommended for use with packet serial modes Command Description Read Quadrature Encoder Register for M1 Read Quadrature Encoder Register for M2 Read M2 Speed in Pulses Per Second Resets Quadrature Encoder Registers for M1 and M2 18 Read M1 Speed in Pulses Per Second 16 Read Quadrature Encoder Register M1 Read dec
74. tion Copyrights and Trademarks Copyright 2010 by Basic Micro Inc All rights reserved PICmicro is a trademark of Microchip Technology Inc The Basic Atom and Basic Micro are registered trademarks of Basic Micro Inc Other trademarks mentioned are registered trademarks of their respective holders Disclaimer Basic Micro cannot be held responsible for any incidental or consequential damages resulting from use of products manufactured or sold by Basic Micro or its distributors No products from Basic Micro Should be used in any medical devices and or medical situations No product should be used in a life Support situation Contacts Email sales basicmicro com Tech support support basicmicro com Web http www basicmicro com Discussion List A web based discussion board is maintained at http www basicmicro com Technical Support Technical support is made available by sending an email to support basicmicro com All email will be answered within 48 hours All general syntax and programming questions unless deemed to be a software issue will be referred to the on line discussion forums c 2010 BasicMicro All Rights Reserved 63 Appendix B 2 DE 5 im S 35 ROTARY ENCODERS RS ships M AGA2 INCREMENTAL ROTARY ENCODERS OUTSIDE DIAM 25 MODEL AGA2 HEMSSUBSTITUTE ESA ei DAGGASMINITYPE ENCODERS CWZ 6C L B PNP BS HIPNP open collector Output C NPNF BES HOpen collector NPN output E HE NPN f ii
75. to that purpose Figure 8 RoboClaw 2x15A B Encoder This encoder sends a 200 pulse per rotation Using this encoder allows us to know the direction and the speed which allows adding a closed loop feedback controller The encoder is shown in figure 9 Appendix B has more information about these encoders Figure 9 Encoder Features 2 Resolution 200 Pulse Rotation Input Voltage 5 12VDC Maximum Rotating Speed 5000rpm Allowable Radial Load 5N Allowable Axial Load 3N Cable Length 50cm Shaft Diameter 4mm Gears A Tetrix gears are used in this design Tetrix gears are expensive as they cost 17 19 found another source of gears which are cheaper p www servocity com index html this website is a good resource to find motor accessories like gears hubs and bearing Etc In order to use these gears the bore of the 3 diameter had to be come 0 5 so we made them bigger by using a 0 5 drill bit After that we used one of the holes that surrounding the bore with the mechanical key Using the mechanical key is to attach the gear to the bane bot gear shaft Figure 10 shown the gears and how they are attached to the encoder as well as the gear shaft Figure 10 gears to attach the encoder to the gear shaft D Ultrasonic sensors In our design a 12 ultrasonic sensors are used in this design Figure 11 shows how these ultrasonic sensors are attached to this robot This LV MaxSona
76. urn left in mix mode Valid data range is 0 127 A value of 0 stop turn and 127 full speed turn Example with RoboClaw address set to 128 Serout P15 119200 L28 dl 127 266 OX F full speed left turn 12 Drive Forward or Backward 7 Bit Drive forward or backwards Valid data range is 0 127 A value of 0 full backward 64 stop and 127 full forward Example with RoboClaw address set to 128 Serout P15 119200 128 12 96 236 amp 0x7F medium speed forward 13 Turn Left or Right 7 Bit Turn left or right Valid data range is 0 127 A value of 0 full left 0 stop turn and 127 full right Example with RoboClaw address set to 128 Serout P15 119200 128 13 0 141 amp 0x7F full speed turn left c 2010 BasicMicro All Rights Reserved 36 B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Packet Serial Wiring In packet mode the RoboClaw can transmit and receive serial data RoboClaw is transmitting return data a processor with a hardware serial port is required GND gt VCC gt Si gt S2 gt 6LO ZZO 91950919 sb n pf Ce lt i DC O00 Jr C1 R18 l U 00 2 69 S IR y fk H og ELE Oe S Sak Q O x Power Switch c 2010 BasicMicro All Rights Reserved 37 B0097
77. w terminal B is the positive side of the battery typically marked with a red wire The B is the negative side of the battery and typically marked with a black wire When connecting the main battery its a good practice to use a switch to turn the main power on and off When placing a switch in between the RoboClaw and main battery you must use a switch with the proper current rating Since the RoboClaw can draw up to 30Amps peak you should use a switch rated for at least 40Amps The main battery can be 6V to 30V DC Power Switch M1A M1B B M2B M2A Motor Screw Terminals The motor screw terminals are marked with M1A M1B for channel 1 and M2A M2B for channel 2 There is no specific polarities for the motors However if you want both motors turning in the same direction on a 4 wheeled robot you need to reverse one of the motors as shown below MIA M1B B M2B M2A c 2010 BasicMicro All Rights Reserved B0097 RoboClaw 2 Channel 15A Motor Controller Data Sheet Status and Error LEDs The RoboClaw has 3 main LEDs 2 Status LEDs and 1 Error LED When Robo Claw is first powered up all 3 LED should blink several times briefly to indicate all 3 LEDs are functional The status LEDs will indicate a status based on what mode RoboClaw is set to OASY MeO oqoy

Download Pdf Manuals

image

Related Search

Related Contents

取扱説明書 - M  SEC01 - SECARROPAS - SIN MARCA (AXEL - MORRIS  Valueline VLCB59000B100    L`adjoint ou R1 et moi le R…  advertencia - Victor Technologies  2010 300 421 0 MBA Modell M04, M11 CM pt - Becker  ARCTIC SOUND P311    PDFダウンロード  

Copyright © All rights reserved.
Failed to retrieve file