Rev 2 Servo Control Board Protocol 5 May 1997
We are preparing a small board, using a PIC16C58A, to offloaddrive-wheel servo control functions from a main robot processor, allowingeasier control of wheel servos. The protocol will allow either free-runningoperation of each wheel servo, using a four-wire interface, or full steppedcontrol, using a two-wire serial interface running at 2400bps. A seventhwire may be used for a panic stop. All seven wires are active at all times.Pins which are unused should be jumpered low to avoid confusion.
Pin Description
1 -- Serial Input: Idle=0, StartBit=1, StopBit=0, data inverted, 2400bps
2 -- Serial Output: Idle=0, StartBit=1, StopBit=0, data inverted, 2400bps
3 -- Left wheel servo: Run=1, Stop=0
4 -- Left wheel direction: Forward=1, Backward=0 5 Right wheel servo:Run=1, Stop=0
6 -- Right wheel direction: Forward=1, Backward=0
7 -- Panic servo control: Normal=1, Stop=0
Serial data on pin 1 provides full control of wheel speed and direction.Available commands are:
0XXXXXXX | Set servo speed X (range is 3 to 127, default is 30). This actuallysets the time in mS for the servo pulse cycle, which consists of eithera 1mS or 2mS ON pulse, followed by a variable OFF time. |
1000MSEP | Reset controller attributes: M=1 (servos off), S=1 (speed set to 30),E=1 (encoder counts set to 0), and P=1 (pulse counts set to 0) |
1001X*** | Set count limit (default is 0, for free run). Client cpu must followthe command immediately with 2 bytes of count, high bits first. If X=0,encoder limits are set. Wheel servo encoder wheels can have up to 100 darkand 100 clear regions, yielding a resolution of 200 counts per revolution.If X=1, servo pulse limits are set. |
1010X*** | Report current counts. Controller responds with 4 bytes: left highbyte, left low byte, right high byte, right low byte. Controller countspositively for forward movement, negatively for backward movement. If X=0,encoder counts are reported. If X=1, servo pulse counts are reported. |
1011**** | Report servo operation and direction. Controller responds with onebyte, of the form ****LLRR. For both LL and RR, 00 means servo off, lastrun backwards. 01 means servo off, last run forwards. 10 means servo on,running backwards. 11 means servo on, running forwards. |
11AXLLRR | Set servo operation and direction. For both LL and RR, 00 or 01 meanoff, 10 means run backward, 11 means run forward. If X=0, encoder countlimit is used to determine run duration. If X=1, servo pulse limit is used.If the selected count limit is 0, servos will continue to run until resetby another command. Otherwise, servos will run until count limit is reached.If A=0, the controller will not inform the client cpu when limits are reached.If A=1, the controller will generate a single report byte when both servosreach the requested limit. |
Please direct any comments and challenges to us by . We aim to please, so give us suggestions....