Two embedded systems working as one.
The project pairs a handheld controller with the robot. Analog joystick readings are divided into speed ranges, converted into discrete commands, encoded into a compact bit sequence, and transmitted over an infrared carrier. The robot decodes those commands and applies them to its left motor, right motor, or flipper servo.
The robot and controller were designed and built within a set project budget for competition against other student teams. The work involved hardware and software integration as well as weekly technical progress presentations.
Input, transmission, and actuation.
ControllerJoysticks and push buttons select motion commands.
IR protocolTwo start bits and five command bits are transmitted.
RobotPWM drives two motors and positions the flipper servo.
Encoding controller commands.
The controller prepends two start bits and copies the five-bit command value into the outgoing signal.
std::bitset<SIGNAL_BITS>
Remote::encodeCommand(const Command command) {
std::bitset<SIGNAL_BITS> signal;
signal[SIGNAL_BITS - 1] = START_BIT_0;
signal[SIGNAL_BITS - 2] = START_BIT_1;
std::bitset<COMMAND_BITS> value =
static_cast<std::uint8_t>(command);
for (std::size_t index = 0; index < COMMAND_BITS; ++index) {
signal[SIGNAL_BITS - index - 1 - START_BIT_LENGTH] =
value[COMMAND_BITS - index - 1];
}
return signal;
}
Firmware organized around hardware responsibilities.
- Separate robot and remote-controller executables share device, pin, motor, and infrared components.
- Motor speed is expressed from reverse to forward and mapped to PWM duty cycle.
- The receiver validates start bits before mapping a signal to a command.
- Timer output generates servo PWM and the infrared carrier used by the transmitter.