The firmware for robì Nucleo board, used to read data from the IMU, send velocities commands to the wheels, and read actual wheel velocities.

Dependencies:   X_NUCLEO_IKS01A1

Robì board


Firmware overview

The goals of this firmware are:

  • read data from the IMU (the blue shield installed on the ), and send them through ethernet to the PC mounted on Robì
  • receive via ethernet the target velocity of the robot, calculate the required wheels velocities, and send them to the 4 wheels via CAN
  • receive via CAN the actual speeds of the wheels, calculate from them the actual robot velocities, and send it to the PC via ethernet.

For sending and receiving data through ethernet, on the board two UDP sockets are opened, one for outbound communication, and one for inbound communication. A serial communication is also set, that communicates with the PC through the same micro USB cable used to power the Nucleo board, and only trasmits debug info.
The only files you should need to edit/read are main.cpp, with the business logic, and param_config.h file, where you can consult or edit some firmware settings: IP&port for the UDP sockets, size of UDP packet, baudrate of the serial port.

Board setup

The blue shield with the IMU (X-NUCLEO-IKS01A1) must be placed in the connector on the board, the ethernet cable connected to the PC, the micro USB connected to the PC for power supply and debug. NOTE: two micro USB connectors exist, the correct one is the one on the opposite side of the board with respect to the ethernet connector, and not the one adjacent the ethernet connector.

On desktop side, the communication with the board is executed via ROS nodes, that you can find in this repo.

Actual functionalities

This firmware is still very raw, since I only had time to take steps for the implementation of the communication, and not on the logic. As a suggestion, read carefully the current code (it's only 140 LOC), and use it as an example of how the involved parts are going to communicate, rather than a simplified version of the final firmware.

Some final notes

  • learn the structure of the CAN messages to understand the prepareCANMessages procedure
  • for CAN communication you need to connect a CAN transceiver to PD0 and PD1 pins (make reference to this image)
  • the board currently sends raw data from the IMU, and the correction of the IMU bias/distortion is made in the ROS node that receive the data.

Jånzo

History

No significant changes, commit only to publish the project default tip

2018-05-11, by giovanniberi93 [Fri, 11 May 2018 08:04:59 +0000] rev 13

No significant changes, commit only to publish the project


forse scrivo bene su can

2018-03-01, by giovanniberi93 [Thu, 01 Mar 2018 00:36:42 +0000] rev 12

forse scrivo bene su can


adesso riesco a interpretare i valori delle velocit? letti via ethernet!

2018-02-22, by giovanniberi93 [Thu, 22 Feb 2018 11:40:22 +0000] rev 11

adesso riesco a interpretare i valori delle velocit? letti via ethernet!


scrittura su CAN funzia

2018-02-16, by giovanniberi93 [Fri, 16 Feb 2018 17:30:19 +0000] rev 10

scrittura su CAN funzia


tolto ppm, messo can e sistemato il codice

2018-02-16, by giovanniberi93 [Fri, 16 Feb 2018 13:02:49 +0000] rev 9

tolto ppm, messo can e sistemato il codice


uso https://os.mbed.com/users/goodgod/code/PPM/, non capisco se va

2018-02-13, by giovanniberi93 [Tue, 13 Feb 2018 11:28:07 +0000] rev 8

uso https://os.mbed.com/users/goodgod/code/PPM/, non capisco se va


Removed NTP, because doesn't support microseconds (it seems)

2018-01-18, by giovanniberi93 [Thu, 18 Jan 2018 13:10:37 +0000] rev 7

Removed NTP, because doesn't support microseconds (it seems)


Set as destination port an "unprivileged" one, for simpler integration of ROS driver

2018-01-18, by giovanniberi93 [Thu, 18 Jan 2018 09:18:07 +0000] rev 6

Set as destination port an "unprivileged" one, for simpler integration of ROS driver


NTP setup

2018-01-17, by giovanniberi93 [Wed, 17 Jan 2018 14:52:24 +0000] rev 5

NTP setup


Spinning at highest possible speed; correction of typos

2018-01-17, by giovanniberi93 [Wed, 17 Jan 2018 09:14:56 +0000] rev 4

Spinning at highest possible speed; correction of typos