Forward Artillery Controller for ME 218b Project 2013
Rev 1 02/12/2013
Purpose:
The primary purpose of the Forward Artillery Controller (FAC) is to act as a gateway to the field infrastructure to allow your robot to request information about the state of the battle scene. Data on the status of the game and coordinates of ships/bots will be updated on the FAC from the field infrastructure at 10Hz.
Interface Connection
Connector:
The connector of the FAC is a 6-pin keyed Molex connector.
Pinout:
Pin 1 2 3 4 5 6 Name/Function +5V (@ 100mA) / Power to the FAC (Vdd) SDI / Serial Data Into the FAC SDO / Serial Data Out of the FAC SCK / Serial Clock SS / active low select line for the FAC GND / Ground reference for the FAC
Electrical Specifications
Parameter ViH VoH ViL VoL IiH, IiL IoH IOL Min. Vdd*0.65 Vdd-0.4 Max Units V V V V A A A
Vdd*0.35 0.4 1 -20 20
All Specifications at Vdd = 5V
Byte Transfer Specification
The Forward Artillery Controller uses a synchronous serial signaling method to transfer data into and out of the FAC. The signaling method is compatible with SPI communications, with the FAC operating as a slave device on an SPI network. The SS line must be lowered (asserted) to begin a 5-byte (40 bit) transfer and raised at the completion of the 5-byte transfer. The SS line must remain de-asserted for a minimum of 2ms between transfers. The SDO line represents the serial data out of the FAC, while the SDI line represents serial data into the FAC. The relationships between the four lines involved in the transfer of a byte are shown in the figure & table below:
SS 72 70 SCK 83 80 SDO MS b 75, 76 SDI MSb In 74 73 bit 6 - - - -1 LSb In 79 78 71
bit 6 - - - - - -1
LS b 77
Forward Artillery Controller Documentation2
Param No. 70* 71* 72* 73* 74* 75* 76* 77* 78* 79* 80* 83* * Symbol Characteristic Min TCY TCY + 20 TCY + 20 100 100 10 3.0-5.5V 2.0-5.5V 1.5TCY + 40 3.0-5.5V 2.0-5.5V Typ 10 25 10 10 25 10 Max Units Conditions 25 50 25 50 25 50 25 50 145 ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
TSSL2SCH, SS to SCK or SCK input TSSL2SCL TSCH TSCL SCK input high time (Slave mode) SCK input low time (Slave mode)
TDIV2SCH, Setup time of SDI data input to SCK edge TDIV2SCL TSCH2DIL, TSCL2DIL TDOR TDOF TSSH2DOZ TSCR TSCF Hold time of SDI data input to SCK edge SDO data output rise time SDO data output fall time SS to SDO output high-impedance SCK output rise time (Master mode) SCK output fall time (Master mode) 3.0-5.5V 2.0-5.5V
TSCH2DOV, SDO data output valid after TSCL2DOV SCK edge TSCH2SSH, SS after SCK edge TSCL2SSH
These parameters are characterized but not tested.
Tcy = 33S
Byte Level Protocol Specification
Common Byte Format:
Exchanges between the Forward Artillery Controller (FAC) and your robot take place with five successive bytes being exchanged. The first byte from the robot to the FAC is the actual command. The value returned from the FAC during this transfer will be 0x00, but has no meaning. The values sent to the FAC as the second through fifth bytes of the sequence should always be 0x00. The meanings of the values returned by the second through fifth byte transfers will be the results from the command byte.
Robot to Forward Artillery Controller Bytes:
The meaningful following table: Command 0x3F 0xC3 0xE7 values for the command bytes from the robot to the Forward Artillery Controller are shown in the Meaning Return the status of the game. Return the coordinates of the ship/robot specified in the 6 LSBs of the command.
Forward Artillery Controller to Robot Bytes:
The values and meanings of the response bytes returned by the Forward Artillery Controller are shown in the following table: Command 0x3F Response Bytes 0xFF, 0x00,0x00, SS Description of meaning SS = game status: 0x00 = stopped; bit 7 hi = red power station under repair, bit 6 high = blue power station under repair, 0x0A = game in play; 0x0B = game over, red won; 0x0C = game over blue won. Co-ordinates of requested ship/bot;XX = X co-ordinate, YY = Y co-ordinate, RR = orientation. If the requested ship/bot is not currently visible, the FAC will return 0xFF, 0x00, 0x00, 0x00. The rotation reported for ships will always be 0x00.
0xC3 0xE7
0xFF, XX,YY,RR
Query the Status of the Game:
To query the game status, send a byte of 0x3F to the FAC followed by 4 bytes of 0x00. The FAC will process the query and during the four 0x00 bytes of the exchange will return 0xFF, followed by two bytes of 0x00 followed by the game status byte.
Forward Artillery Controller Documentation3
Query the Co-Ordinates of a Ship/Robot:
To query the co-ordinates of a particular ship/robot, form the necessary command byte value by bit-wise ORing 0xC0 with the number of the requested ship/robot (3-19, 20-29 or 30-39). Transmit the resulting command byte, followed by four bytes of 0x00. The values returned from the FAC during those four bytes of 0x00 will be, in order, 0xFF, the X co-ordinate, the Y co-ordinate and the rotation of the requested ship/bot. Co-ordinates 0,0 are in the upper left corner of field, as shown in Fig. 1 of the project description(X:0 left-255 right, Y:0 up-255 down). Rotation 0 is pointed up, parallel to the dividing wall shown in Fig. 1 of the project description (0 facing up-255 facing up again, counter clockwise).
Power on and reset behavior:
Initially, after power on or a reset, the Forward Artillery Controller will return 0xFF from any query until such time as the Forward Artillery Controller is internally initialized.
Command Timing:
The interval between two successive transfers from robot to Forward Artillery Controller should be at least 2ms. The SS line must remain high for a minimum of 2ms between successive transfers.
Invalid Command Bytes:
If the Forward Artillery Controller receives a command byte not listed in the table, it will respond to the invalid command byte by queuing a series of 0xFF bytes to be returned to the robot.
Sample Byte Sequence:
Bot to FAC 0x3F 0x00 0x00 0x00 0x00 0xC3 0x00 0x00 0x00 0x00 0x4F 0x00 0x00 0x00 0x00 FAC to Bot 0x00 0xFF 0x00 0x00 0x0A 0x00 0xFF 0x27 0x50 0x10 0x00 0xFF 0xFF 0xFF 0xFF In this sequence, the bot queries the game state(0x3F), which will return 0xFF, then two bytes of 0x00 followed by 0x0A if the game is in play. The next query (0xC3) is for the co-ordinates of the bot from team #3. The results from this query indicate that the bot is on the field at co-ordinates 39, 80 with an orientation of 16. The illegal query (0x4F) results in the FAC queuing a 0xFF, which will be returned on the first, and subsequent bytes of 0x00 from the bot.
Physical Specifications
Dimensions:
The Forward Artillery Controller dimensions are 8.0 x 8.0 x 1.5.