update on 19-02-2013

IMU

Communication with other boards of the robot

All the code described above is available as open source at Google code repository:
Processing IMUdisp test GUI
Arduino Joystick-USB interface

dsPIC33 XC16 code for UDB4 IMU board: lino-UDB4 as MPLABX project
dsPIC33 XC16 code for dsNAV motor controller boards: dsPID4W as MPLABX project


The IMU board is the hub for all the hardware involved in navigation. It collects GPS, magnetometer, gyro and accelerometer data. Using sensors fusion with DCM it returns the orientation value to the master dsNav board, to compute the correct dead-reckoning, and returns the current position to the High Level Supervisor. So, the communication among boards is a crucial task for each of them. Both serial and I2C communication are used. All the serial communications use my light protocol. The I2C comm uses the classic protocol applied to the I2C EEPROM: a first write points to a specific register and consecutive readings/writings automatically increment the pointer.

Following a detailed description of the code involved in a top-down style.

To test all the communications in an easy way, before involving HLS, a simple GUI written in Processing is used. All the interested parameters can be read and displayed for debugging purpose.
This GUI reports all the parameters from every boards involved, even current consumed and speed for each one of the motors.


In order to use the above GUI correctly, we need some more parameters. The emulated HLS needs desired speed and direction as input to drive all the control chain. This goal is simply achieved with a couple of analog joysticks connected to an Arduino board. Through a simple Joystick-USB program, Arduino sends serially these values to the Processing Program.
Once built this input device could be useful for future applications too.

This is the bottom of the chain: the dsNAV motor controller hardware directly attached to the H-bridges, one for front wheels, one for rear wheels. The dsPID4W MPLABX project is the same for both master and slave board. The board addressed by the IMU is elected as master at startup.

As aforementioned the IMU is the hub for all the navigation hardware, collecting and computing all the needed information.
Starting from the original Bill Premerlani MatrixPilot code for UDB4 board and getting a lot of good suggestions from the different branches of this very interesting project, I added all the needed protocols to communicate with Lino boards, resulting in this lino-UDB4 MPLABX project.