HextorTechnical.txt ------------------- sections:- Overview Hardware Expansion Printed Circuit Board - Jumpers Talking to the BOS Listening to the Infra-Red co-processor Talking to the Ultrasonics co-processor Direct Servo Control Feelers Overview -------- Hextor has an expandable layered multiprocessor control system with interlayer communication taking place over serial links. The basic system consists of:- - a Basic Stamp BS2Sx processor which communicates with - the Behavioural Operating System (BOS) processor - the Infra-red (IR) communications processor - the Ultrasonic-rangefinder (US) processor - and the LCD and keypad (LCD) processor in turn:- - the Behavioural Operating System (BOS) processor communicates with - the five Servo-coprocessors (SCP) which control the servo pulses All communication is at 9600 baud, no parity, one stop bit. The Behavioural Operating System processor is what makes Hextor so easy to use. It accepts high level ASCII commands such as "F", "B", "R", "L" etc to make Hextor step Forward, Backwards, Rightturn and Leftturn using a Tripod-gait. There are also high level Wave-gait commands as well as low-level direct control of the servos and interogation of servo position and status. The Ultrasonic-rangefinder processor accepts commands telling it in which direction to point the sensor, controls the servo to point in the required direction, operates the Polaroid sensor and sends back the distance information. The Infra-red communications processor can be trained to respond to any standard TV or HiFi Infra-red remote control, once trained it is continually watching for IR signals and the BS2 can ask for the current signal code. The LCD and keypad processor accepts information to be displayed and can be asked to read the Pendant buttons by the LCD and return the button code. The Servo Co-processors accept speed and position information and send out the pulses to control servos 0 - 14. Servos 0 - 11 are in the legs, 12 and 13 in the arm and gripper, while the connections for 14 are free for user options. The hierarcy can be expanded upwards by using the expansion connector onto which can be plugged higher level processors, see below. For the Introductory programs 'Program Headers' in the index shows information on all the BOS commands including those for low level servo control; information as to the assignments of servo numbers to leg joints; information on the meta commands used in the BS2Sx programs; and all the descriptive program headers for the BS2Sx programs up to Hextor_22. The Hxtr*-Doc.BSx files contain information as above for MultiProgSX0, MultiProgSX1 and MultiProgSX2. Hardware -------- Power is supplied from a standard 7.2 volt sub-C racing pack through two fuses, one for the servos and one for the electronics. One diode provides reverse voltage protection to the electronics and a further two diodes reduce the voltage to that suitable for the servos. There is one main on/off switch (Sw1) located by the Stamp which controls power to the Stamp and other electronic sytems, the stamp in turn is in control of two relays (Rly1 and Rly2), Rly1 supplies power to the servos while the Rly2 supplies power to all the other board-electronics including the LCD. But see below at 'Grip/Lift J6,7'. Non-regulated power to off-board electronics via the expansion connector is not switched by the relays and thus off board electronics can hold the Stamp in 'reset' reducing current to a few microamps. This facility allows higher level processors to be added which can have total control over the Stamp and its sub-processors. Power to the leg servos is supplied through Rly1 controlled by the Stamp. To enable users to quickley disable the leg servos Rly1 is enabled by a switch (Sw2). Grip/Lift J6,7 -------------- Power to the Lift, Gripper, Auxiliary and Ultrasonic servos can be jumpered to either:- the supply to Rly1 or to the switched output from it, hence if the jumper is set to switched then all the servos can be disabled by Sw2. Alternativly when the legs are disabled software can still operate the gripper/Lift, Auxiliary and Ultrasonic servos. Note that with the jumper in the latter position Sw1 will not switch off power to those servos. However the servos only take 30 microamps each when not being pulsed and so will have negligible affect on the battery. Expansion --------- The connector is routed as follows:- (Note due to an oversight there are two jumpers labeled J18) pin1 /MR - BS2Sx /reset - low to reset BS2 - also J12 reset 0v D0 - BS2Sx pin8 - J13 - jumpered to right LED D1 - BS2Sx pin9 - J14 - jumpered to left LED D2 - BS2Sx pin10 - J16 - jumpered to left feeler/left gripper pad via J17 D3 - BS2Sx pin11 - J15 - jumpered to right feeler/right gripper pad via J18a D4 - BS2Sx pin12 D5 - BS2Sx pin13 D6 - BS2Sx pin14 - J18b - jumpered to Ultrasonic processor Receive D7 - BS2Sx pin15 - J19 - jumpered to Ultrasonic processor Transmit 5V - from board 5v regulator pin12 7V - direct from main on/off switch Removal of the jumpers allows the BS2 full use of the connector. Printed Circuit Board - Jumpers ------------------------------- (Note due to an oversight there are two jumpers labeled J18) J1 - 4 BOS serial-coms to D9-connector or to BS2 see photograph for link placement J5 Attn. line from D9-connector to BS2 open to use D9 for serial coms to BS2 link to program BS2 J6,7 Grip/lift, Auxilliary and Ultrasonic Servo-supply Servo-supply - unswitched Servo-supply - switched off by SW1 see photograph for link placement J8 BOS commands, serial-coms baud rate from BS2 or D9 open 2400 linked 9600 J11 link to supply Protected 7v to Expansion-connector pin12 J12 BS2 reset, link to reset BS2, use so external circuitry can reset BS2 Note reset signal also appears on Expansion-connector pin1 J13 BS2 pin8 and Expansion-connector pin3=D0 to right-LED J14 BS2 pin9 and Expansion-connector pin4=D1 to left-LED J15 BS2 pin11 and Expansion-connector pin6=D3 to right-Feeler via J18a (J18a) also right gripper pad via header plug on J18a J16 BS2 pin10 and Expansion-connector pin5=D2 to left-Feeler (J17) also left gripper pad via header plug on J17 J18b BS2 pin14 and Expansion-connector pin9=D6 to US-sub-system J19 BS2 pin15 and Expansion-connector pin10=D7 to US-sub-system Prog short together to enter programming-mode for the IR-receiver Talking to the BOS ------------------ There are routines in the BS2Sx programs which send commands to the BOS and receive replies. The BOS has a 'Busy-out' pin which goes low when the BOS is ready to receive commands. There is also an 'Halt-in' pin which if taken high tells the BOS to stop all walking movements and stand still. Examine the 'tellBOS' routines for detailed information. The BOS has commands which directly control the servos, see the section 'Direct Servo Control'. To use a terminal to talk directly to the BOS see 'Application notes' item #10. Listening to the Infra-Red co-processor -------------------------------------- The IR co-processor is continually monitoring for an IR signal and continually sending byte information to the BS2. The low nibble contains the key code - 0 - no valid signal 1 - key1 signal received 2 - key2 signal received 3 - key3 signal received 4 - key4 signal received 5 - key5 signal received 6 - key6 signal received 7 - key7 signal received 8 - key8 signal received the high nibble contains timing information which on a new keypress starts at 15 and counts down to 0, when 0 is reached the key code changes back to 0. From MultiProgSx0 onwards there is a flagbit in CommonRam which can be altered from the LCD menu. Talking to the Ultrasonics co-processor --------------------------------------- Communication is over two pins of the expansion bus and the US module as fitted operates remote-mode where it waits for a two byte command - "T", - from the BS2, then drives the servo to the indicated position, operates the sensor and returns a 1 byte distance measurement of between 15 and 255 representing 0.15m to 2.67m. Direct Servo Control -------------------- These commands turn on servo power and exit with servo power on. BOSbusy goes low immediately, doesn't wait for move to finish. $speed;$servo - high nibble and low nibble respectively of second byte X implies value ignored BOScmnd, arg1, arg2 0, $speed;$servo, position tell servo to move 1, $XX;$servo, X returns servo Position 2, $XX;$servo, X returns servo Status if bit1=1 then servo is on if bit0=1 then servo has finished moving 3, X, X returns hiFlag byte, loFlagbyte flag bits 0 to 14 correspond to servos 0 to 14 if bit=1 then servo has finished moving bit 15 is always 1 4, X, X returns hiFlag byte, loFlagbyte flag bits 0 to 14 correspond to servos 0 to 14 if bit=1 then servo is being pulsed bit 15 is always 1 5, $XX;$servo, X stop pulsing servo Feelers ------- the feelers are connected to BS2 pins 12 and 13 and are pulled high by resistors, they should be adjusted to sit between the two pins marked 'Bumper' without making contact with them. The two 'Bumper' pins are connected to ground so if a feeler is displaced it will touch one of the pins pulling the BS2 pin low. The meta-command 'b' reads the two BS2 pins Instead of fitting feelers, pressure switch pads fitted to the gripper fingers may be connected to the touch jumpers J17/18a (not the 'Bumper' pins!) then the 'b' command will read the finger pads. If the pins of either J17/18 are shorted together then the corresponding BS2 pin will be pulled low.