Radio Shack Mobile Robot manual RC Servo Motor and Steering Motor Control

Page 37

Coprocessor Command Summary continued

RC Servo Motor and Steering Motor Control:

Example: !1R380

This command begins with “!1R” and is followed by a character indicating the RC servo motor number (3 in the example), followed by the position in hexadecimal (80 in the example). Possible position val- ues are “01” through “FF” which results in about 120 degrees of motion. This varies depending on the motor. A position value of 80 hexadecimal will center the motor. A position value of “00” will de- energize the servo motor to conserve power. It normally takes less than one second for the motor to po- sition itself. During that time, do not de-energize the motor. If the command is accepted, an “A” will be returned indicating “acknowledged“.

Motor 2 Control (Powerful Output):

Example: !1M20

A second motor control port is provided that can be used to control DC motors or other powerful loads such as lamps. We refer to this as the Powerful Output. The command begins with “!1M2” and is followed by a character indicating the action 0=off, 1=forward, 2=reverse. If the command is accepted, an “A” will be returned indicating “acknowledged“.

Coprocessor Communication Rules

Communication between the Basic Stamp II Master and the coprocessors follow these rules:

￿￿ Single-wire bidirectional serial communication.

￿￿ Serial communication parameters: 2400 baud, 8 data bits, and 1 stop bit.

￿￿ Coprocessor network is a master/slave setup. Slaves only talk when asked to. Coprocessors never send “!” which is reserved to identify the beginning of a command.

￿￿ Each command sent by the master begins with “!”.

￿￿ All commands should be upper case.

￿￿ Second character of each command is the coprocessor address character. Usually “1”, “2”, etc.

￿￿ The third character of each command is normally the actual command itself.

Such as “M”, “R”, etc.

￿￿ Commands are fixed length and do not require carriage returns or other termination.

￿￿ 8-bit values are sent/received using 2 hex digits. 00-FF. 16-bit values are 4 hex digits. Leading zeros required to maintain fixed length.

￿￿ Single digit values from 0-9 can be a single character 0-9. Such as motor #, etc.

￿￿ Commands return a value or return an “A” to indicate “acknowledged”.

34

Image 37
Contents Assembly and User Guide ARobot Mobile Robot Connectors About ARobot IntroductionBasic Stamp II Control Computer What You’ll Need Feature ListTechnical Specifications Precautions Controller Component LocatorGlossary of Terms Glossary of Terms Glossary of Terms Assembly Overview Quantity Description Used For PartsAbout Screw, nut, and washer sizes Parts Motor Brackets Sanding PaintingPaint Primer Finish CoatSummary WhiskersHow it Works Whisker Detail Full Scale Whisker Wire Pattern Drive Motor and Brackets Encoder Sensor Front Wheel Assembly Steering Motor and Rear Wheels Steering Motor Mounting Wheel and Axle Steering System Controller Board Don’t install batteries yet Battery PackSummary Don’t install batteries yet Body Cable Finishing Up About the Controller Board Basic Stamp II InstallationProgramming PC Editor/Downloader Software Cable to your PCUSB Port Programming NotePrograms Steering Adjustment Program STRAIGHT.BS2Test Program TEST.BS2 Wander Program WANDER.BS2About the Controller Board Reset Button Power On/Off SwitchBatteries Speaker LED indicatorsDrive Motor and Encoder Push Buttons and Jumpers switchesSteering Motor Example !1M11200E7 Coprocessor Command SummaryCoprocessor Communication Rules RC Servo Motor and Steering Motor ControlHexadecimal, Binary, Bytes, Words, etc Body Connector J8 Battery Connector J9Serial Port J12 PinoutDrive Motor Connector J10 RC Servo Motor Connectors J2-J5Powerful Connector J11 Voltage 12 volts Maximum Current 500ma PinoutExpansion Port RC Servo Motor Signals Expansion Connector J1Expansion Port Circuit Examples Digital/Power Output Switch Input ExampleDigital Inputs Sensor Input ExampleBasic Stamp II light sensor example code Analog InputsCommunications Coprocessor Network ExpansionUsing ARobot’s controller as a coprocessor Using Other ControllersCabling between ARobot’s controller and another controller Suggested Reading Component Suppliers Small Parts Sava IndustriesStock Drive Products SuperCircuitsWeb Sites Internet Robot ResourcesNewsgroup NameDescription Internet News GroupsTroubleshooting Arrick Robotics Warranty InformationRobotics.com