G3: Dagu Thumper Controller - shalan/CSCE4301-WiKi GitHub Wiki

Dagu Thumper Controller

Project Idea

The idea behind our project is to implement a Dagu Thumper controller using Bluetooth. What we essentially want to accomplish is to control the Dagu Thumper from a mobile device through a Bluetooth terminal. Moreover, The Dagu Thumper is also going to be interfaced with an Ultrasonic Sensor that is constantly monitoring the front of the Dagu Thumper where it reads the distance between it and any obstacles in its way. This prevents any potential collisions of the Dagu Thumper and any obstacles around it such as walls, ground elements or any other hurdles. Finally, we would like to implement some form of speed control where the user can dictate how fast they want the Thumper to be.

Project Design

System Architecture

In this diagram, we detail how the full system will function. The flow starts with the User Interface on a mobile device. The Dagu Thumper is connected to a Blueooth module which makes it detectable by other Bluetooth devices. Once the module establishes a connection with the user's device, the user can start issuing commands to the Thumper. There are 6 different commands that the user can issue; moving forward, backwards, right and left, stopping and finally increasing or decreasing the speed.

All commands will be relayed by the Bluetooth module to the Nucleo Microcontroller that is interfaced with the Dagu Thumper. The Nucleo board is also interfaced with an ultrasonic sensor that is fitted at the forefront of the Thumper in order to detect any obstacles it might collide into. If the sensor detects any hurdles it will bring the Thumper to a complete stop. The Microcontroller will process the command (in the form of a character; more info on that in the project Git Repo) that came from the Bluetooth module and issue the necessary commands to the Thumper in order to move it accordingly.

System Flow

Hardware Interfacing

The way in which we are going to be interfacing our hardware is pretty straightforward. We have two processing elements that need to be connected to each other; the Bluetooth module (HM-10) & the STM32 Nucleo. The main processing unit will be the STM32. Essentially, the Bluetooth is only set up as a gateway which retrieves any information coming to it and relays it to the Nucleo board for processing. Both of these components will be interfaced to each other using asynchronous communication via UART1.

As for the rest of the components; the ultrasonic sensor and the Thumper, they will be interfaced exclusively with the Nucleo board. Any information coming to the Nucleo from the HM-10 will be processed and relayed as movement commands to the Dagu Thumper. Moreover, the ultrasonic sensor will be interfaced with the Nucleo through regular GPIO input and output pins. The ultrasonic sensor's echo pin will be connected to a Timer channel pin on the STM32 set in input capture mode. This aids us in capturing when the Echo pin was triggered and when it was disabled. The ultrasonic sensor will be sending distance measurements to the Nucleo board every 50ms.

Finally, for speed control, the STM32 will store the commands that were relayed to it by the HM-10 in a memory buffer, in order to remember the last commands. If the user was to input the same command twice in succession (notably the forward command), this will increment the speed at which the Dagu Thumper operates. Otherwise, it will just process the command normally. Furthermore, the user also has the ability to decrease the speed of the Thumper if they wish using a special command.

Hardware Interface

Development

This is what the final product looks like. As you can see the Thumper has the ultrasonic sensor set up at the front of the Chassis to detect any obstacles ahead of it. Moreover, the entire circuitry is power by portable battery pack, while the Dagu Thumper is powered by a 10000 mAh LiPo Battery. All the system functionalities were working as expected, and the Thumper was able to respond to any command without failure. The bluetooth module was not very powerful and the user had to remain at a distance of around 3 to 4 meters in order to stay connected to the Thumper.

FreeRTOS was not used for this project, since we did not have the time to implement all of the necessary tasks properly.

Ultrasonic Sensor

Motor Controller

Final Product

System Inputs & Outputs

Inputs

  • Movement commands from the HM-10 Blueooth module as bytes
  • Echo measurements from the Ultrasonic sensor

Processing

  1. Data incoming from the bluetooth module are processed and converted into characters
  2. The characters are sent via the UART from the module to the Nucleo board
  3. The Nucleo board takes the character input and issues the proper movement commands to the Dagu Thumper using the UART
  4. The Nucleo increases the speed of the Thumper if the same command is issued twice in succession
  5. The ultrasonic takes distance readings every 50 ms and stops the Thumper in case any obstacles are detected at a certain distance

Outputs

  • Dagu Thumper movement in the desired direction
  • Dagu Thumper avoiding collisions with any obstacles
  • Dagu Thumper speed control

Project Milestones

MS1 - Full Hardware Interfacing (Ultrasonic Sensor & Dagu Thumper)

The Thumper and Ultrasonic sensor will have been interfaced with the Nucleo board and collision detection will be implemented

MS2 - Full System Integration

The entire system will be integrated together and we will have implemented and set up the bluetooth module

MS3 - Additional Features

Implementing the speed control feature

Technical Challenges

  • Linking the Bluetooth module & the STM32 together using UART
  • Charging the Dagu Thumper battery
  • Making sure the commands are only sent to the Thumper once
  • Setting up speed control

Future Work

  • Setting up sensors on all sides to introduce spatial awareness
  • Introducing a self driving system, where the Thumper can navigate an area autonomously without colliding
  • Connecting camera to our System to allow for Remote control of the thumper
  • Emulate modern vehicles and implement a self parking system

System Features

  • Thumper control via Bluetooth
  • Thumper collision avoidance using the ultrasonic sensor
  • Thumper speed control

Required Components

Hardware:

  • STM32 Nucleo Board (L432KC)
  • HM-10 Bluetooth Module
  • HC-SR04 Ultrasonic Sensor
  • Dagu Thumper
  • Pololu TReX Motor Controller
  • Android Mobile Phone

Software:

  • CubeMX
  • Keil uVision

Resources & References

Github Repository

Resources

References

Project Authors:

  • Ashraf Ibrahim (GH Handle : ashrafSwailem)
  • Nourhan Mokbel (GH Handle : nourhanmokbel)
  • Saif El Din Abbas (GH Handle : TheRealStraits)

Extra Notes

This project is part of the CSCE 4301 Embedded Systems course in the American University under the supervision of Dr. Mohamad Shalan.