My progress:
made a robot prototype based on Arduino UNO board.
designed the architecture of software.
Coding the class of Sensor.
Architecture of Software:
Four kind of object: Sensor, Motor, Messager, Action.
Two thread: 'main process' and 'timer interrupt process'
Attachments in detail:
- Class diagram:
- Data of Class:
- Interaction diagram:
Message format for communicating:
baud rate: 2k bit/s( it depends on: 1.the min signal pulse width, here I take 500us. Constraint: must be less than the half of 38k.)
start bit: 3 bits of 0 (using the low output of IR-receiver as the 0 bit)
data:
typedef struct{
uint8_t ReceiverID; // send from LSB
uint8_t SenderID;
uint8_t MessageID;
uint8_t Para;
uint8_t VerifyFirst; // Verify bytes, the value should be equal to the value of ReceiverID
uint8_t VerifyLast; // Verify bytes, the value should be equal to the value of the l Para
}TxRxBuf_stru;
verification: using repeating data as above.
Stop bit: null.
Message transfer rate: 2K bits/51 bits=39, 39 messages per second.
collision detecting: thinking:)
Problem:
1. about emitting infrared of prototype robot : when change signal from 0 to 1 on the 38k PWM, there is a very strong infrared at the start of changing that can enable all four IR-receivers. I'll go to Xinchejian and to solve the problem tonight.