5# Coding for the Rover
Table of Contents
1 Function Description
The range detect rover is build with interactive of multiple sensors to sensing the environment. Then control the rover move around in complex situation like office, home with some edge intelligence.
The sensors include ultrasonic sensor with slow and short detecting distance around 20cm, and one expensive 60GHz radar sensor with precise range detect of 200cm, then sensor module even with intelligence to detect human presence or sudden movement. This helps move around with human interactive.
2 The Hardware Interfaces
Here is hardware interfaces and how the MKR board, TMC5272 board, stepper motors, range detect sensors and Power supply connected.
Each connection has been tested in previous forum post, it proves to be reliable in functional.
3 Software
This is how the software flowchart runs,
After configurating the hard ware interface one by one, the program is running in two different loops. One is for sensor value scan and fusion the data to decide the movement to the rover. To keep going or dodging in other direction.
Another is for stepper motor state machine, report the state of the rove and control the rove with instruction to left or right wheels in velocity mode.
4 How to improve it
This is simple range detect sensor fusion project. If the sensor is arranged in one rotary pole, the surrounding distance can be mapped more precisely, like lazer radar in automatice car does. That would be potential improvement for this projec.
This Project is design with Arduino. I have tried with arduino cloud editor https://app.arduino.cc/sketches
That is also one alternative design platform for arduino. That is Another interesting work to do next.