Self driving RC car

What are you developing?
MartinP
Posts: 16
Joined: Fri Nov 25, 2016 8:49 pm

Self driving RC car

Postby MartinP » Sun Dec 04, 2016 12:42 pm

Howdy.
This is an autonomous vehicle, a small RC car.
I build this for (winning) a competition called robot folkrace, which looks like this:

And the rules (in English):
http://www.robotchampion.se/wp-content/uploads/2013/10/Folkrace_2013_SRC_en.pdf

My progress so far:
Bought a small 1/24 scale RC from China. A bounch of sensors and of course a bunch of Maple Minis (so far i killed two of them).
Designed a circuit and PCB in Kicad, along with the sensor array.
I bought a cheap stepper motor driver from China, it's not the best design Ive seen but it allows for a lot more current than a regular L298N.
It looks like this without the shell of the car:
Image

It does actually drive pretty well using minimum viable code:


This saturday I worked more with the code, reusing a FSM (finite state machine) I use with my minisumos (a different kind of robot), and a PID-controller. It runs pretty good. Lets say it crashes into the wall just to show that the FSM is working :D Still a long way to go.


It seems to run perfectly fine even though the use of several doubles (which btw are 8 byte each on the Maple Mini). The sensors are polled every 30 ms, which may seem slow and I will try a shorter interval between the polls.

What needs to be done:
* Tuning the PID
* Serial protocol for Bluetooth communication, to make the PID tuning easier.
* EEPROM read/write/update. I put an EEPROM chip on the board which the Maple Mini communicates with on the I2C bus.
* Higher capacity battery.

What could be done:
* Custom wheels and tires. For lower CG and better traction.

Thats all for now.

User avatar
zoomx
Posts: 352
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: Self driving RC car

Postby zoomx » Sun Dec 04, 2016 7:00 pm

Great!

Which sensors are you using?

MartinP
Posts: 16
Joined: Fri Nov 25, 2016 8:49 pm

Re: Self driving RC car

Postby MartinP » Sun Dec 04, 2016 11:05 pm

I use Sharp gp2y0e02b

MartinP
Posts: 16
Joined: Fri Nov 25, 2016 8:49 pm

Re: Self driving RC car

Postby MartinP » Tue Dec 06, 2016 7:29 pm

Did some more work on the steering this afternoon.



The Maple can handle a lot of computing! I included a secondary PID to adjust the speed, along with filters for all 7 sensors.
Adjusted the gains for the steering PID, it's finally satisfactory.
In the video the robot runs for 2 minutes and some seconds, I counted to 37 laps. Thats 10 more than sunday.

Next big step is to get the speed PID running good. Then comes object avoidance. Still a long way to go.

User avatar
RogerClark
Posts: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Self driving RC car

Postby RogerClark » Tue Dec 06, 2016 8:06 pm

how did you destroy the Maple minis?

Is it spikes on the power supply from the motor?

MartinP
Posts: 16
Joined: Fri Nov 25, 2016 8:49 pm

Re: Self driving RC car

Postby MartinP » Tue Dec 06, 2016 8:28 pm

One let the smoke out when I plugged in the USB cable (I might had a bit too much current draw on the onboard regulator). I'm not sure what happened to the other one, it's just dead.

User avatar
RogerClark
Posts: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Self driving RC car

Postby RogerClark » Tue Dec 06, 2016 9:53 pm

Its best not to use the onboard regulator to run too many other things, as often the regulators are not good quality.

I know a lot of people have blown up the regulator on other STM32 boards (like the Blue Pill board), but those boards have very cheap components and the USB connectors often break as well.

Some of the Maple mini's on eBay and AliExpress are factory rejects from the original manufacturer (who is called "Baite")
I think if you buy direct from Baite's store on AliExpress the boards are usually OK as they are not rejects that someone else has tried to fix and then resell.

MartinP
Posts: 16
Joined: Fri Nov 25, 2016 8:49 pm

Re: Self driving RC car

Postby MartinP » Wed Dec 07, 2016 8:06 pm

Thanks Roger. Yes it could be that I got some factory rejects because I didn't order them from the Baite store. I'll keep that in mind.


Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest