Tracking Path Traveled by Robot and Outputting Path When Traveled

I am building a simple firefighting robot with my son.

One requirement for our robot is to track the path taken by it and then display the path upon completion.

The robot will be front wheel drive, with caster wheels on the rear and we are using stepper motors to power the front wheels.

Therefore, the Arduino will need to record the distance traveled and the direction that the robot will turn through using the stepper motors, then to display the path traveled upon completion.
We hope to store this data in polar form, angles and distances.

We are unsure on how to store the distance and angle variables, then to display them.

If anybody could offer some advice on what approach we should be taking with this aspect of our project, we would be very grateful!!!

Many thanks,
Kieran

Hi and welcome to the forum.

Counting steps is easy. One common misconception is that this is good enough for navigation. It is not.
If accurate navigation is not the goal of your path recording, then charge forward.
But I just want to jump in early in this conversation with the idea that turning the wheels a certain amount does not lead to accurate or reproducible movement.

Are you looking to make a graphical display on your robot? Or transmitting the movement data to a PC and displaying it there?

Look up "differential steering" for some ideas on calculating robot position from wheel rotation angles or step counts. Of course, wheels slip, especially during robot turns, which is one factor making this approach inaccurate.

To measure heading and turn angles, use an electronic compass as a North reference. The compass must be carefully calibrated while mounted on the robot, as magnetometer readings are severely distorted by nearby magnets, currents and magnetic materials.

vinceherman:
Hi and welcome to the forum.

Counting steps is easy. One common misconception is that this is good enough for navigation. It is not.
If accurate navigation is not the goal of your path recording, then charge forward.
But I just want to jump in early in this conversation with the idea that turning the wheels a certain amount does not lead to accurate or reproducible movement.

Are you looking to make a graphical display on your robot? Or transmitting the movement data to a PC and displaying it there?

Hi, thank you for your reply!

We are looking to transmit the movement data to a PC to display it there.
The only data that we wish to record is the X and Y position with respect to time.
The robot is going to be controlled by an IR controller so the data will need to be stored on a memory drive which could be removed from the robot or transmitted live to a PC.

Thank you,
Kieran and James

jremington:
Look up "differential steering" for some ideas on calculating robot position from wheel rotation angles or step counts. Of course, wheels slip, especially during robot turns, which is one factor making this approach inaccurate.

To measure heading and turn angles, use an electronic compass as a North reference. The compass must be carefully calibrated while mounted on the robot, as magnetometer readings are severely distorted by nearby magnets, currents and magnetic materials.

Thank you,

I shall give differential steering a Google.
Would you be familiar with how to store this data and then display it to a PC from the arduino?

Kieran and James

I think that a SD card is a workable solution for storing the data.
As you say, the card can then be removed and read on the PC.

Read up on the SD library.
https://www.arduino.cc/en/reference/SD
Read up on the ReadWrite tutorial.

I am not sure what the easiest way on a PC to take a text file of coordinates and display them in a meaningful way.

Great, thank you so much for the help!