Skip to content
dischoen edited this page Mar 9, 2014 · 5 revisions

Software

The software for this project consists of three parts, as pictured below:

  1. The Control software is executed on the Robot Control board and controls the motors

  2. The Bluetooth relais software is executed on the Arduino Bluetooth and receives commands via BT and provides them to the Control board via I2C.

  3. The remote control software is executed on an Android tablet and sends commands to the robot via BT.

The software for this projects is located in these repositories:

Sensors

Gyro and Acceleration sensor, including calculations and mounting. I bought a nice 10DOF sensor from Adafruit. Unfortunately I was quite behind schedule, so the limiting of the angle of the robot's body is not yet working. Currently the speed nominal values are applied to the motors without feedback.

Motor Power and Battery

When I applied the big wheels to the robot and applied power, it showed that the center of gravity was close to the wheel axis, so the robot rotated without creating much excentric momentum. I had to add extra weight out of center. This made the robot move, on the other hand the motors are not strong enough to rotate the robot any more, so there is also no need to limit the power by means of a rotation sensor.

But the weight is also so high that the motors draw so much current that the rechargeable batteries give up after some minutes. I had to replace them with normal batteries.

Remote Control

Android app

This is a relative simple Android app with a main class and one View. It creates a Bluetooth socket (The MAC address of the ARDUINOBT is hardcoded). To control the robot I use the position sensors of the device. Roll and yaw angle are translated into left and right motor speed, and sent via bluetooth.

Bluetooth receiver

This runs on a ArduinoBT. The program tries to read a command, which starts with a sync pattern and the speed of the motors. I intended to communicate with the Arduino Robot via SoftwareSerial, but I ran into massive problems on the Arduino Robot. So I switched to I2C. The ArduinoBT is a I2C slave, and the Robot is the master. It reads commands every 20ms.

Android->Arduino (Telecommands)

<SYNC><LeftSpeed><RightSpeed>[<ExtraTC>]<EOC>
  • SYNC pattern to start a command: 0xFFFF, uint16_t
  • Speed: desired speed, range -255..255, uint16_t
    • -255 max neg. speed
    • 0..stop
    • 255..max. speed
  • Not yet implemented: ExtraTC: optional extra command:
    • CmdID: command identifier, uint8_t
    • CmdParam: command parameter, uint8_t
  • EOC: end of command: pattern to finish a command. 0x66. uint8_t

Arduino->Android (Telemetry)

(Also not yet implemented)

  • SYNC pattern to start a command: 0xEB90, uint16_t
  • AccelerationX: int16_t
  • AccelerationY: int16_t
  • AccelerationZ: int16_t
  • RotationX: int16_t
  • RotationY: int16_t
  • RotationZ: int16_t
  • Orientation: chassis angle, int16_t
  • State: bit pattern for various binary system states, uint32_t
  • EOC: end of command: pattern to finish a command. 0x09BE. uint16_t

Next: Chassis