Make with Ada

Programming Competition   June 20 - September 30, 2016

Explorer and mapper robot

The explorer and mapper robot will be a robot with four wheels which will evolute in a room. Thanks to some ultrasonic ranging modules and AHRS, it will take some positions and send and/or record them. With those data, we can plotted the shape of the room and the object. I will use an Nucleo board, and perhaps add an hardware abstraction layer to suport also Arduino board in the robot. For the plotting application, I will use a computer or a Raspberry or a STM32F4 board with a screen. And of course, all will be make with Ada.

Project Lead Sébastien BARDOT     Location Angoulême, France
Log Updates 8

Project Log

Adding the project in github

https://github.com/Levraichacal/EMR1

Posted Jul 18, 2016 at 01:12

I made a branch of AdaDriversLibrary and add the support of the Nucleo F411RE. You can tfind it at : https://github.com/Levraichacal/AdaDriversLibrary

I also add at this branch the mpu6050 motion sensors.

Posted Aug 26, 2016 at 08:22

On EMR1, I removed the unused drivers as I used the one in AdaDriversLibrary

Posted Aug 27, 2016 at 09:25

I add the common and the blinky project to be sure that the builder work properly: link

Posted Aug 27, 2016 at 09:27

As I never use multitask in Ada and furthermore with the ravenscar norm, I made a small project with four tasks whose toggle some LEDs at different speed (1, 2, 3, 4 seconds). This is the link of the project 2 - Task test.
I will use a task for : * get the data from the MPU6050, * get the data from the HMC5883L, * get the data from the six HC-SR04, * calculate the AHRS * drive the motor * Send the data.

Some extra thing will be : * Get the data from 2 others MPU6050 * Calculate the Euler' angles of each * drive the servomotors * Get the data from the two others HC-SR04.

Posted Aug 29, 2016 at 03:58

As I need a compass to have a cap, I choose the HMC5883L from honeywell. So I write the HMC5883L package for drive it. It is at the following link : HMC5883L driver.

Posted Sep 03, 2016 at 11:53

For follow my project and add the change, I put all on my website

Posted Sep 21, 2016 at 03:13

I won't have the time to achieved my project in the deadline: baby, moving and travelling for work have used all my free time. I will continue it when I will have free time again (probably next week) and published all on my website and my Github.
Its application is the mapping and also scanning with differents sensors detections for military field or after climatics disasters like security in the house after an earthquake, tsunami... This is the plan that I wanted to follow.
For the robot :
1. Write the driver for the NucleoF411RE --> OK thanks to svd2ada
2. Test the port with LEDs --> OK
3. Test the task with ravenscar respect on the NucleoF411RE --> OK
4. Write the driver for the MPU6050 --> OK
5. Write the driver for the HMC5883L --> OK
6. Get and send the HMC5883L data with two differents task --> In progress
7. Get and send the MPU6050 data with two differents task (the sending will be common with the other sensors) --> In progress
8. Write the AHRS with a task --> In progress
9. Write the motors drivers --> In progress
10. Write the drivers for the HC-SR04 --> Not start but already made with an arduino in Ada
11. Use the HC-SR04 for positionning the robot, and control its moving :
- Go further during 10 cm until its at 30 cm;
- Turn left, and go further during 10 cm until 50 cm;
- Turn left and restart the scanning.
12. Take all the data, and send it at each stop. The aim is to have the position of the robot and the differents distances measures by the six HC-SR04. The position of the differents HC-SR04 are know and the coordonates will be calculated on the receiver.
-- In extra
13. Add calibration mode for the compass (HMC5883L), the IMU (MPU6050), the ultrasonics sensors (the six HC-SR04)
14. Add two HC-SR04 on plateform controling by two servomotors for make a 3D mapping
15. Add control mode as manual directing by the receiver parts.
16. Add other sensor: Camera, gaz/oxygen detection, smoke detection, radioactivity sensor, metal detection, mines detection...
17. Support others board fom stm and arduino due.

For the receiver:
1. Received the data and print it --> In progress
2. Calculate the coordonates and print it on the screen
3. Plot the point representing the coordonates on the screen
-- In extra
4. Add a menu for connecting
5. Add a touch for each sensors which need to be calibrated
6. Add a scale on the screen to zoom and dezoom on the map
7. Add the 3D representation of the coordonates.
8. Add manual mode control and use the accelerometers of the Disco1-F469 to control the movement.

The architecture will be like this:
On the robot:
A semaphore for each sensors to protect the reading and writing of the data. To keep it safe and don't have a problem on the AHRS calculation and sending data to the receiver. So it will be on those tasks:
1. Get the HMC5883L Data at 25 Hz
2. Get the MPU6050 Data at 25 Hz
3. Calculate the AHRS at 25 Hz
4. Send the data at 10 HZ

I will used a common pwm for the HC-SR04 and interruptions for the return of the information.

On the receiver :
The received data will interrupts when they arrived. A procedure will plot the data at the sceen. The connecting mode, calibration and auto/manual mode.

*OPEN :
All is write under GPL3 licence. As mentionned previously, all is store on my Github. I used GPS IDE from AdaCore.

  • COLLABORATIVE :
    All is explained on website and the code is store on Github. I will commit the driver on the AdaCore github also, free to them to accept it. Everybody is free to reuse my codes.

  • DEPENDABLE :
    I used the ravenscar profile to follow the real time rules and keep the system safe. I comment all my code before uploading it on github to be readable.

  • INVENTIVE :
    I don't know if a robot like mine have been already code in Ada but it was for me a way to code in Ada and use Ravenscar profile and multitasking. And also, starting to code on the stm chip and with Ada, my favourite language (but I don't used it at work ... for the moment).

Posted Sep 30, 2016 at 02:24

Explorer and mapper robot

The explorer and mapper robot will be a robot with four wheels which will evolute in a room. Thanks to some ultrasonic ranging modules and AHRS, it will take some positions and send and/or record them. With those data, we can plotted the shape of the room and the object. I will use an Nucleo board, and perhaps add an hardware abstraction layer to suport also Arduino board in the robot. For the plotting application, I will use a computer or a Raspberry or a STM32F4 board with a screen. And of course, all will be make with Ada.

Project Lead Sébastien BARDOT     Location Angoulême, France
Log Updates 8

Project Log

Adding the project in github

https://github.com/Levraichacal/EMR1

Posted Jul 18, 2016 at 01:12

I made a branch of AdaDriversLibrary and add the support of the Nucleo F411RE. You can tfind it at : https://github.com/Levraichacal/AdaDriversLibrary

I also add at this branch the mpu6050 motion sensors.

Posted Aug 26, 2016 at 08:22

On EMR1, I removed the unused drivers as I used the one in AdaDriversLibrary

Posted Aug 27, 2016 at 09:25

I add the common and the blinky project to be sure that the builder work properly: link

Posted Aug 27, 2016 at 09:27

As I never use multitask in Ada and furthermore with the ravenscar norm, I made a small project with four tasks whose toggle some LEDs at different speed (1, 2, 3, 4 seconds). This is the link of the project 2 - Task test.
I will use a task for : * get the data from the MPU6050, * get the data from the HMC5883L, * get the data from the six HC-SR04, * calculate the AHRS * drive the motor * Send the data.

Some extra thing will be : * Get the data from 2 others MPU6050 * Calculate the Euler' angles of each * drive the servomotors * Get the data from the two others HC-SR04.

Posted Aug 29, 2016 at 03:58

As I need a compass to have a cap, I choose the HMC5883L from honeywell. So I write the HMC5883L package for drive it. It is at the following link : HMC5883L driver.

Posted Sep 03, 2016 at 11:53

For follow my project and add the change, I put all on my website

Posted Sep 21, 2016 at 03:13

I won't have the time to achieved my project in the deadline: baby, moving and travelling for work have used all my free time. I will continue it when I will have free time again (probably next week) and published all on my website and my Github.
Its application is the mapping and also scanning with differents sensors detections for military field or after climatics disasters like security in the house after an earthquake, tsunami... This is the plan that I wanted to follow.
For the robot :
1. Write the driver for the NucleoF411RE --> OK thanks to svd2ada
2. Test the port with LEDs --> OK
3. Test the task with ravenscar respect on the NucleoF411RE --> OK
4. Write the driver for the MPU6050 --> OK
5. Write the driver for the HMC5883L --> OK
6. Get and send the HMC5883L data with two differents task --> In progress
7. Get and send the MPU6050 data with two differents task (the sending will be common with the other sensors) --> In progress
8. Write the AHRS with a task --> In progress
9. Write the motors drivers --> In progress
10. Write the drivers for the HC-SR04 --> Not start but already made with an arduino in Ada
11. Use the HC-SR04 for positionning the robot, and control its moving :
- Go further during 10 cm until its at 30 cm;
- Turn left, and go further during 10 cm until 50 cm;
- Turn left and restart the scanning.
12. Take all the data, and send it at each stop. The aim is to have the position of the robot and the differents distances measures by the six HC-SR04. The position of the differents HC-SR04 are know and the coordonates will be calculated on the receiver.
-- In extra
13. Add calibration mode for the compass (HMC5883L), the IMU (MPU6050), the ultrasonics sensors (the six HC-SR04)
14. Add two HC-SR04 on plateform controling by two servomotors for make a 3D mapping
15. Add control mode as manual directing by the receiver parts.
16. Add other sensor: Camera, gaz/oxygen detection, smoke detection, radioactivity sensor, metal detection, mines detection...
17. Support others board fom stm and arduino due.

For the receiver:
1. Received the data and print it --> In progress
2. Calculate the coordonates and print it on the screen
3. Plot the point representing the coordonates on the screen
-- In extra
4. Add a menu for connecting
5. Add a touch for each sensors which need to be calibrated
6. Add a scale on the screen to zoom and dezoom on the map
7. Add the 3D representation of the coordonates.
8. Add manual mode control and use the accelerometers of the Disco1-F469 to control the movement.

The architecture will be like this:
On the robot:
A semaphore for each sensors to protect the reading and writing of the data. To keep it safe and don't have a problem on the AHRS calculation and sending data to the receiver. So it will be on those tasks:
1. Get the HMC5883L Data at 25 Hz
2. Get the MPU6050 Data at 25 Hz
3. Calculate the AHRS at 25 Hz
4. Send the data at 10 HZ

I will used a common pwm for the HC-SR04 and interruptions for the return of the information.

On the receiver :
The received data will interrupts when they arrived. A procedure will plot the data at the sceen. The connecting mode, calibration and auto/manual mode.

*OPEN :
All is write under GPL3 licence. As mentionned previously, all is store on my Github. I used GPS IDE from AdaCore.

  • COLLABORATIVE :
    All is explained on website and the code is store on Github. I will commit the driver on the AdaCore github also, free to them to accept it. Everybody is free to reuse my codes.

  • DEPENDABLE :
    I used the ravenscar profile to follow the real time rules and keep the system safe. I comment all my code before uploading it on github to be readable.

  • INVENTIVE :
    I don't know if a robot like mine have been already code in Ada but it was for me a way to code in Ada and use Ravenscar profile and multitasking. And also, starting to code on the stm chip and with Ada, my favourite language (but I don't used it at work ... for the moment).

Posted Sep 30, 2016 at 02:24