Pololu SMC01A User Manual Download Page 9

Byte 3: Motor Number and Direction (continued).

 

"

Bit 7 must be cleared since this is not a start byte.

To obtain the complete byte 3 value from a motor number and a direction, multiply the 
motor number by 2 and add 1 if the direction is forward.  For example, to make motor 5 
go forward, byte three should be 5 

x

 2 + 1 = 11.  To make motor 1 go backward, byte 3 

should be 1 

x

 2 = 2.   (Two efficient ways to multiply by 2 in a microcontroller program 

are shifting left by one digit or adding the motor number to itself.)

Byte 4: Motor Speed.

  The most significant bit must be zero since this is not a start 

byte, and the remaining seven bits are available for specifying the speed.   The possible 
range of values for byte 4 is thus 0x00 to 0x7F (0 to 127 decimal).  0x00 turns the motor 
off, and 0x7F turns the motor fully on; intermediate values correspond to intermediate 
speeds.

Resetting the Motor Controller

The motor controller’s optional reset line should normally be kept high at +5V. Pull the 
reset line low to 0V for at least 2 microseconds to reset the motor controller to its initial 
state (all motors off, waiting for the first serial command).  You do not need to reset the 
motor controller to use it successfully.  However, you may need to reset the motor 
controller to ensure that spurious signals sent when your robot controller turns on do 
not cause the motor controller to detect the baud rate incorrectly. 

Controlling Multiple Motor Controllers with One Serial Line

To control a particular motor, you must specify its motor number in command byte 3.  
For all motor controller boards, motor M1 responds to commands for motor number 0, 
and M2 responds to commands for motor number 1.  To control more than two motors 
with a single serial line, you need to use motor numbers 2 through 63.  Motor 
controllers that are not specially ordered respond to numbers 2 and 3; you need to order 
specially programmed motor controllers to use motor numbers 4 through 63.

For example, to control six motors independently, you need three motor controller 
boards, each with different motor numbers.  All three motor controllers respond to 
commands for motor numbers 0 and 1.  For controlling the six motors independently, 
use motor numbers 2, 3, 4, 5, 6, and 7.  (The exact numbers depend on which motor 
numbers you request when you specially order additional motor controllers.)

You can individually control up to 62 motors at a time with a single serial line using 31 
motor controllers: one with the default program and 30 that are specially programmed.

9

Pololu

© 2001
http://www.pololu.com/

Summary of Contents for SMC01A

Page 1: ...tents Safety Warning Parts List Contacting Pololu How to Solder Assembly Instructions Connecting the Motor Controller Using the Motor Controller How the Motor Controller Works Description and Specific...

Page 2: ...se or to the performance of this product This product is not designed for and should not be used in applications where the malfunction of the product could cause injury or damage Parts List The follow...

Page 3: ...er soldering trim excessleadswithdiagonalcutters To solder heat a component lead and the PCB pad and then apply solder until the solder flows onto both the lead and the pad If the solder beads up on t...

Page 4: ...ptions concern the size of the assembled motor controller You can insert the various components into the PCB without soldering to helpdeterminewhichoptionsarebestforyou Should I use IC sockets for U1...

Page 5: ...5 Pololu SMC01A C2 C1 U3 U2 U1 M2 1 2 M1 Next add the tantalum capacitor C2 You may need to bend the leads to make them straight so that they will fit The capacitor is polarized which means it must on...

Page 6: ...o use it to ensure that spurious signals sent when your robot controller turns on do not cause the motor controller to detect the baud rate incorrectly onnect this pin to a 0 5V digital output on your...

Page 7: ...port connector R2 10k R1 4 7k Q1 2N2222 Bold circles indicate pads that are connected to 5V which you can use with the circuit shown on the left SMC01A C2 C1 U3 The above diagram shows a simple circui...

Page 8: ...s byte should always be 0x80 128 in decimal to signify the beginning of a command The start byte is the only byte with the highest bit bit 7 set and it alerts all devices on the serial line that a new...

Page 9: ...or controller to use it successfully However you may need to reset the motor controller to ensure that spurious signals sent when your robot controller turns on do notcausethemotorcontrollertodetectth...

Page 10: ...of 19200 The four numbers in square brackets are the data to be sent and they correspond to the four control bytes for the motor controller The first two bytes should always be 80 and 0 The second 0 m...

Page 11: ...on and off very rapidly 600 times per second and varies the percentage of the time that the switches are on to achieve the speed set by the serial interface For a higher speed the switches are on a l...

Page 12: ...bot controller you can independently set each of two small DC motors the kind typically found in remote control cars and motorized toys to go forward or backward at any of 127 different speeds To cont...

Reviews: