3D printed RC-car – powered by stm32duino

madias
Thu Apr 14, 2016 10:27 pm
Because I really learned to love my 3d-printer, my next project is a 1:8 RC car.
Printings for the chassis are ready,
some facts:
Complete own design (I studied some “commercial” products) – Those who know me know that I always reinvent the wheel.
printed material: PLA and PETG
Scale: 1:8 (or something, bigger than 1:10)
Non printed parts: differential (full metal), gears (full metal) wheels, shock absorbers (I already printed all those things out with the conclusio it’s better to buy them cheap)
Battery: 11.1V, 2200mAh, continuous load 44A (yep, I try to be really careful…)
Motor: 336W Daypower 75030 – really a monster -> http://www.pollin.de/shop/dt/MDM0OTg2OT … 75030.html
Servo: MG996R (clone) – full metal
ESC: one of those 320A ESC’s found on ali (high power), they are ok, but NEVER NEVER 320A :) (guess about 20-30A, so within my calculations for the motor (28A)) – works out of the box with servo lib

RC-control
two maple mini’s, both with NRF24l01:
RC-car:
gets data from receiver (servo, motor)
transmits: battery voltage, temperature of battery and motor (NTC’s), RPM of the motor (again a cheap optical module) and used ampere (will get one of those 20A hall sensor A-measurement modules soon)

Remote controller:
all poti stuff, ILI9341 TFT with touch (I’ve rewritten our library to use with SPI2, so I do not have to share SPI with the NRF24), transmits all calibration data, lots of settings with presets, calculations like top speed, used A / km and so on (everything is possible), envelopes for all potis/joysticks…

Programming itself isn’t a really challenge for me, but all those 3d printed parts. While in testing phase I’ve changed several times materials, dimensions to curb the 336W motor, it’s really a beast.

Some photos so far (third with a NANO while testing):
Image
Image
Image


mrburnette
Thu Apr 14, 2016 11:36 pm
I have never “been into” the RC car scene, but this design is definitely making me want one! Bravo.
Ray

madias
Sat Apr 16, 2016 9:30 pm
mrburnette wrote:I have never “been into” the RC car scene, but this design is definitely making me want one! Bravo.
Ray

madias
Fri Apr 22, 2016 9:02 pm
Little update:
I printed out the physical remote control device as a draft:
Image
Image

User interface is very slim:
ILI9341 touch TFT (2.6′)
2 potis (steering wheel and accelerator – was a little bit nasty to justify and select the right return springs)
1 backward button

Under the hood there is nothing special:
STM32 mini
NRF24L01 (antenna breakout version)
24LC512 I2c EEPROM (storing data and presets like calibration, car setups, channels…)

Power:

two 18650 lion’s (I’m not sure if I use them parallel (>8.2V) or serial (>4.1V), depends on the NRF24 if it’s happy with a single cell voltage of 3.8-4.1 and an AMS1117 3.3)
TP4056 charger on board

Software
Basic functionality is working, have to write a touch display interface (combined with the steering wheel and backward button as data input)
EEPROM organisation as described here: viewtopic.php?f=18&t=1034


madias
Mon Apr 25, 2016 10:07 pm
Further success:
Touch display -> working!
EEPROM -> working!
NRF24 communication -> working!
all analog and digital inputs –> working!
accurate battery sensor: -> working! fixed with: viewtopic.php?f=18&t=707&p=12557#p12557
all in all the consumption is about 150mA, driven by (a total of) 4000mAh batteries so a lot of time of fun without the need of recharging
Image

RogerClark
Mon Apr 25, 2016 11:21 pm
Hi Matthias

What 3D package did you use ?

You could do the remote control using Bluetooth from a smartphone, using an nRF51822, as I have an Arduino core that works with some nRF51822 modules.
But I suspect control using a smartphone is not optimal, and the separate dedicated controller, like you have made, is better than smartphone control.

I presume you are always in line of sight with the car, so the nRF24l01 has enough range, especially if you use the ones with external antennas.
And Bluetooth doesn’t seem to have more range than the nRF24L01.


madias
Tue Apr 26, 2016 5:44 am
Dear Roger,
I use 123D-Design from Autodesk with ambivalent feelings: Workflow for drafts is superb, but some functions are missing or idiotic programmed.
I did a smartphone / BT driven toy car in the past, works nice, but with this car with a approximating top speed of 60-80km/h (remember: I use a 336W motor with 1:17 transmission!) I’ll kiss the walls within seconds if controlled by smartphone.
I have seen YT-videos of RC-cars with the nrf24L01 (antenna version) with superb range, so this was the reason I decided for them.
I think with the nrf24 you have the better choice, because you can slow down transmission speed (I use 250kps) for a higher range. I also can try out different power modes if the range is not satisfactory.
A real NO-WAY for RC-cars are the cheap 433MHZ transmitter/receiver: Because of indifferences with motor/servo you loose control/contact too often. (Tried out many things like shielding, decoupling capacitors…..)
Maybe I’ll try a BT-only project in the future -> I have BT-05 and BT-06 at home, but I think I’ll use the BT-dongles (BT-05 isn’t really cheap) for “smarter” projects.

RogerClark
Tue Apr 26, 2016 5:58 am
Hi Matthias

OK about using 123D. I guess it makes things easy, but don’t trust Autodesk. So I have to use OpenSCad (which is not easy)

Actually, I have a fully legal copy of 3DS Max (Autodesk) which I bought many many years ago. I suppose I could use that, but the version I have, was written long before the invention of 3D printing, so I don’t know if it has output to STL. (And I don’t currently even have it installed)

Re: RF

I have a Tamiya RC car chassis and motor, which is around 20 years old, but it is not operational.
When I bought the car, it had a mechanical speed control, which used a servo to control a multi position switch which added resistors in series with the motor to control the speed.
I built my own PWM speed controller for it, using discrete IC’s, but I kept blowing up the power FETs, as 20 years ago, the FET’s were not so good as they are today, and it needed a lot of FETs.

Since them the 27Mhz RC control I was using, stopped working, but I now have a newer 2.4Ghz Futaba RC controller. So if I bought a motor controller, and a steering servo and a battery, I suppose I could make the car live again.

BTW.
It was very fast as well, I suspect a similar speed to yours ;-)


madias
Tue Apr 26, 2016 6:25 am
I use this ESC:
http://www.aliexpress.com/item/High-Vol … 33276.html
For sure not 320A but I think about 20-40A (peak) without problems.
You get it cheaper, if you don’t use 3S-lipos (11.1V) than search for the 2S (6.2V Version!) and maybe without “Reverse-Brake” (it’s only needed for airplanes)
You can hook this up like a servo, no magic behind that :)

RogerClark
Tue Apr 26, 2016 7:01 am
Thanks

The car used to have a NiCad (or NiMh) battery pack, but I don’t know what happened to it.

But, I have 5 lipo batteries which I salvaged from a laptop, so I’m sure I can use them. I just need to solder them together with some thick wire ;-)


madias
Tue Apr 26, 2016 8:21 am
RogerClark wrote:Thanks

The car used to have a NiCad (or NiMh) battery pack, but I don’t know what happened to it.

But, I have 5 lipo batteries which I salvaged from a laptop, so I’m sure I can use them. I just need to solder them together with some thick wire ;-)


madias
Wed Jul 13, 2016 12:02 pm
###### project closed #######
…and here comes the big warning :)
I nearly finished the project up to 98% but I stopped it because there is no relationship between costs and efficiency.
You can buy a *really good* car kit (like TeamC TR02) for about 70 Euros (without motor/servo/remote but with all gears/differential….) All parts are carbon reinforced.
Main reason: All 3d printer materials I’d tested out were too weak. (PETG, ABS, PLA) Stronger material (with carbon) would be much more expensive and the main problem is, how a “classic” 3D-printer works: With layers and this gives you a totally weakness.
I also wasn’t able to get the drive to work well: You have to be in sub-millimeters regions, otherwise all gears will torn out quickly. I bought many spare parts from “real” RC cars and as soon as possible I was FAR beyond 70 Euros for a weak car.
The weight: For a minimum stability the parts must be really thick.
So I bought a “real” kit and with my knowledge I got while concepting the 3d-car it was really easy to build it up.

…but there are many things you can do with microprocessors +3d printer in RC sports and save a lot of $$$:

My next project is a transportable multiclient lap timer:
one (or more for interim results) pillar with IR-LED’s sending a simple IR code (regular IR codes like for remote controls are too complex for reading while passing by fast)
up to 6 transmitter boxes (within the cars): MCU + NRF24L01 + IR receiver: Car is passing the pillar, decoding the IR signal and sending a ping to the master box
Master box: MCU+Display+Encoder+Buzzer+NRF24L01: Getting the signal (pong) from the transmitters calculating the individual lap time and race position. Buzzer for passing by and starting melody. There are many more things you can do (like transfer race results in realtime via BT to smartphones, laptops)
I build up a basic system with AVR’s (they are enough for IR-pillar and transmitter boxes (=space!)) maybe I’ll take a maple mini for the master box. All basic testings, circuits and 3d-prints are done so I only need to put it all together (coding)
Main feature of this concept is the flexibility: Just go a along with your friends, find a suitable “track” and put the pillar on the ground and you can race wherever you want!


RogerClark
Wed Jul 13, 2016 9:40 pm
Matthias

Thanks for the update.

I did not realise that you were printing the cogs for the gearbox etc,I thought you just printed the chassis etc.

The forces on the gears must be extremely high.

I like the idea of the lap timer.
Have you done any calculations about how fast the IR data needs to be sent ?
e.g.
How fast do the cars go, when they pass the Pillar? 50kmh ?
How wide / narrow is the beam from the IR, so that you do not get flase triggers?
What does the nRF24L01 do?


madias
Thu Jul 14, 2016 5:46 am
Dear Roger,
even for the chassis 3d-prints are too weak (mostly because of the weight of the whole car)

Laptimer:
This time I didn’t not try to invent the wheel. I’ve studied many techniques for timekeeping. On fixed race tracks there is a metal/magnetic “ribbon” on the lane, this is not suitable for temporary race tracks.
So I found this for kart racing (very much details in the link):
http://teambarnato.blogspot.co.at/2016/ … o.html?m=0
This system is not suitable for a RC car, because I’m not sitting in it :)
So I adapted some of the ideas (short IR wave code….) with ad don features:
Pillar (with minimum 3 strong IR LED’s in a row) is permanent sending a unique IR code
In each RC car there is a little box containing an AVR+NRF24L01 and an IR-receiver (this one is connected via a longer cable so the receiver is fixed on the rear spoiler). So the RC car is passing the IR signal line, collecting the “good IR code” and sends via NRF24 a short unique number (like “1”))
The master box is recognizing the “1” (or “2”….) and knows that car “xyz” is passing the line. That’s the whole magic.
To prevent false triggers you set up a fictional laptime: So if one lap is about 01:30 you set up an offset of 1:15. So only after 01:15 a triggered signal is counted as “positive”.
I’ve have to do many tests, but I think this concept is – more or less – bullet proof


RogerClark
Thu Jul 14, 2016 9:57 am
Interesting

I wonder if you could do it with Bluetooth (nRF51822) instead of the nRF24L01.

But I don’t know if a phone can connect to multiple BLE devices at the same time.
I think it may be possible with Android http://stackoverflow.com/questions/2123 … gy-devices

But I guess the problem is then that you need to write an App to handle what the main MCU + Display etc does.

There could also be latency issues with the BLE.

So I guess its probably best to stick to known technologies like the nRF24L01


madias
Thu Jul 14, 2016 10:45 am
I think BT has too much “overhead”, with the nrf24l01 I can do super fast transmissions with a totally reduced transfer protocol. Most (older) commercial systems are using the old 433mhz technology. There are a lot of benefits with the nrf24:

  • cheap
    compact size (the nRF51822 are bigger -> problem with the transmitter box, because RC cars (especially buggies has less space)
    You can manually choose the channel (bandwidth) if a frequency is blocked and/or channel hopping.
    comfortable ACK settings
    up to 6 slaves plus master in one network without creating subnetworks
    and finally: A superb library https://github.com/TMRh20?tab=repositories

So I think – for a prototype – it’s better to use the nrf24l01 and an external bluetooth-serial-module. Or use any USB-OTG cable to connect with a tablet/smartphone (successfully tested – I use often an USB-OTG cable with my smartphone (+simple serial monitor app) for debugging)


RogerClark
Thu Jul 14, 2016 10:07 pm
Matthias

I agree that the nrf24 is probably the fastest for this sort of communication, as it does not have a big communication overhead.

So building a system using the nrf24 is the best option

But in terms of size, an nRF51822 solution may be smaller as it does not need a separate MCU as the nRF51822 is a MCU with built in BLE


madias
Fri Jul 15, 2016 9:33 am
Ok, got it Roger :)
For sure a single chip solution for the transmitter box would be optimal. Maybe a chepo ESP8266 would also be an option. I only need a single external pin (for the IR receiver) in the car.

RogerClark
Fri Jul 15, 2016 9:49 am
Matthias

Yes. Esp8266 would also be an option, if you perhaps ran a web server on the phone / tablet so that the esp8266’s could connect and send data.

But ESP8266’s are quite power hungry

Anyway. Good luck with the project and let us know how you get on


mrmonteith
Fri Jul 15, 2016 1:41 pm
I remember having a 1/12 scale carbon fiber chassis car with a racing motor. Loved it when my inlaws had a 10,000sq ft building built. Had my own indoor track for a while. But the speed of that thing you run out of room pretty quick. lol I needed a runway.

A while back I was researching the NRF modules. They make some with more power and one guy tested one using a multi-element yagi antenna and got on a bicycle to see how far it would reach. It was like close to 2 miles. So one way or another you can get the range. I do know that you need a sturdy power supply with good filtering on it. Also if you get a Ham license you can run more power. Up to 1w I think. Have to check the rules to be sure.

Michael
KM4OLT


RogerClark
Fri Jul 15, 2016 11:53 pm
mrmonteith wrote:I remember having a 1/12 scale carbon fiber chassis car with a racing motor. Loved it when my inlaws had a 10,000sq ft building built. Had my own indoor track for a while. But the speed of that thing you run out of room pretty quick. lol I needed a runway.

madias
Wed Jul 20, 2016 11:10 am
Ok, I finished my laptimer!
Sadly it’s not an STM32 project, AVR only (no sense for sacrifice an ARM for this ;) )
Image

Function description:
You need at least 3 devices:
IR-generator pillow: This device contains an Arduino mini generating a very short IR code. Via 3 IR-LED’s the code is beamed permanently

Transponder box within car: Arduino Nano/mini + IR receiver + NRF24L01 module. If a IR signal code is recognised (car is passing the IR pillow) a short unique code will be send via the NRF2401 module to the master box. Up to 6 different transponder can be used (Currently only 2 are implemented)

Master Box: Arduino Nano + NRF24L01 module + Encoder + Display. Collecting the transponder data for generating lap times,…

Here is the whole project (photos, code, descriptions…)
https://drive.google.com/folderview?id= … sp=sharing


mrmonteith
Wed Jul 20, 2016 1:15 pm
As far as communication goes these look very promising.
LoRa – Long range – greater than 15 km

Michael


madias
Wed Jul 20, 2016 9:47 pm
mrmonteith wrote:As far as communication goes these look very promising.
LoRa – Long range – greater than 15 km

Michael


madias
Wed Jul 20, 2016 9:49 pm
Little update:
This project is now also on instructables: http://www.instructables.com/id/IR-24GH … r-RC-Cars/
and in the arduino forum
http://forum.arduino.cc/index.php?topic=413720
because I think it’s really offtopic in the stm32duino forum :)

RogerClark
Wed Jul 20, 2016 9:54 pm
How do you set a unique ID to each car (nRF24) ?

Does each car have different firmware? Or does the Master box send ID to each car ?


madias
Wed Jul 20, 2016 10:17 pm
I use different firmwares. So first is “1Node”, sending “1” as data, second is “2Node” sending “2” as data. Each one has a own writing pipe. Maybe not perfect, but it works. I really abuse the power of this modules for such a dumb task, but they are cheap as 433MHZ modules but much more stable.
The master box is sending nothing to the cars only getting the signal code. Furthermore I didn’t implement ACK because of speed reason (Each car sends the code 10 times with different delays, so if the first transmission failed the next starts in 1ms, than 2ms, … the master box will ignore every next signal was recognized:
So this is the flowchart:
Car passes the IR-line getting a “good IR code” sending via NRF24 the signal 10 times (with short delays) pausing at least one second (to avoid sending too much data)
The master box gets the signal and will only accept the next signal after a period of time: This can be set up in the box. So if a lap is at minimum(!) 45 seconds I set up the offset to 40 seconds. So only after 40 seconds the next trigger will be accepted.

RogerClark
Wed Jul 20, 2016 10:36 pm
OK

I presume you didn’t get each car to send via IR as you would need too many IR LEDs on the car and they have to face the “IR pillow”

(PS. Did you mean “IR Pillar”)


bianchifan
Tue Jul 26, 2016 3:17 pm
madias wrote:###### project closed #######…t I stopped it because there is no relationship between costs and efficiency.

madias
Tue Jul 26, 2016 5:33 pm
Yeah, the pollin ones are for 1:8 cars….and:
EVERY ESC I bought on aliexpress went up in smoke, they are ALL (equal if 20A or 320A (hahaha, 320A!) useless s…
Cure:
By them at hobbyking and give you a $$$ kick and buy brushless ones.
I’ve bought such a combo:
http://www.hobbyking.com/hobbyking/stor … ouse_.html
(but with 17.5t, 13.5 should be faster, but 17.5 stays nearly hand warm)
If you wanna stay at brushed motors, there is also an ESC for old brushed motors.

madias
Tue Jul 26, 2016 6:28 pm
Ok, here is the brushed ESC from hobbyking: http://www.hobbyking.com/hobbyking/stor … r_ESC.html
I use this one in my second car (got it second hand for 30 Euros with brushed motor).
I use this motor for it: http://www.aliexpress.com/item/GoolRC-5 … 123.PYgtGy
But if you need a motor also, please give you the kick and buy a brushless one, they are faaaar better, wont get hot and have an excellent live time.
If you need a radio, take this: it’s complete with a receiver with gyro (really funny) and quiet cheap.
http://www.hobbyking.com/hobbyking/stor … ated_.html

Best of it: You can use it with the radiolink receiver (without gyro), they are cheap: http://www.aliexpress.com/item/2Pcs-Ori … 116.IADGjT

for lipos I would also decide the hobbyking ones (everybody use them :) )
As charger I bought on ali a iMAX B6 Lipo NiMh Li-ion Ni-Cd RC Battery Balance Digital Charger for 13 Euros. Device is working well, but you need an old laptop power supply (or similar)

For all hobbyking orders: Choose european warehouse first otherwise you are in anger that the parts are not available in Europe.
As you can see, I like hobbyking, most things are cheap but definitely no crap.

Nowadays I buy most of the car parts (or even complete cars) second hand. You can really make a bargain for nearly unused cars. (I bought a TeamC TC02-EVO as “Roller” (without electric) + tons of spare part and upgrades, nearly unused for 70 Euros (the damper alone costs about 80 Euros!) – Believe me: If you own one , than the second one is already on road to you;) )


bianchifan
Thu Jul 28, 2016 1:05 pm
Hobbyking..NEVERMORE… NEVER! EVER!

I did 3 orders in early 2014, all were returned.
2 by unknown reasons, 1 by unvalid adress.
Service.. nothing, no response on email.
When I opened a ticket: We are so sorry..we must check..please go to chat, ticket closed.
They are brainfucked, every word more is one word toooo much.

PS: Paypal deadline 6 week that time :(

ESCs:
I ordered three versions from 2 suppliers, WP40/WP1045? clone (3S/sink/brake) and a WP-1625 clone (2S w/o brake) from ihhbäh
and a WP1060 clone from gearbest, last still on the way (ordered after wp1045?’s 2nd burning fun experience)
– WP1045?
1st burn I’m not shure, maybe due to short..I’m glad my scope survived.
Image
2nd burn immediatly after switching on – 3s on quasi dummy load..a small motor, maybe 20W
Image
-WP-1625 clone
Although only rated for 2S no probs with 3S while idle runnin’ with both, tiny 20W and Pollin-360W
Image

brushed:
For I was pregnant with the idea of building a Truggy-style-printed car I ordered a triple of the Pollin motors.
Cheapo, cheapo..so no changable brushes..so I need some spares.
And for tunring the axles some halfbridges are needed, too.
That’s all.

brushless:
Same moment when I checked that the Pollins dont fit I ordered a cheap brushless set at Banggood’s.
It arrived within 10 days, unpacked, read manual… fu.. a programming card is also needed.
I found a website where the Hobbywing 10BL60 got hacked..I build a pdf from it..;)
And – not to forget – I ordered a metal gear, too.

Receiver:
First I threw it away but at least i rescued it..shitty Flysky.
Some handful of CC2500 are lying around here ;)
I made a little ride and picked up a used Devo 7e, disassambled it and now I have some fun with moddin.. swappin.. prommin…

Imax B6:
I’m using the 50W Version for years for by bike light batteries.
Actual I ordered an 80W-plastic-housing-version.
It arrived yesterday, 24.??€ from ebay-tomtop/Hamburg, 3€ DHL shipping included.

Do you know Cheali Charger? The open source imax B6 all variants firmware?
If not, go for it!

Lipos:
I ordered two flashdeals at Gearbest, 11.1V 5200mAh 30C ZOP Power 17.87€ each.
One is still packed, the other was needed for my tests.
It worked fine but at the end of my brushless tests I decided for a closer look inside because I want to change the connector to T-type (Deans?).
Hmm… I’m still waiting on a proper set of heat shrink wrap.
Image

madias wrote:Believe me: If you own one , than the second one is already on road to you;) )


madias
Thu Jul 28, 2016 1:34 pm
Ok, it looks like you had the same “experiences” with buying RC car components. Yes, those china ESC’s are sooo bad quality (bad parts, design, pcb, soldering, layout, nearly everything you can do wrong, they did it!). Here in Austria we have a “museum for electro pathologically” this “devices” should be there in the first row.
but only one thing: If it will be a present for your grandson, you should be sure to be on the “safe side”. Even a 2s lipo with those “fire crackers” can set up a fire which can really be dangerous (not thinking about if the fire catches the LIPO’s) – but I’m sure you’ll build in the brushless combo.
Thank you for the Imax B6 hint! I’ll go for the firmware (but honestly: the build in firmware is good enough, not even one point for complaining, but let me be surprised!
Sad to hear about your hobbyking experience. I ordered about 5 times the last 6 months and I never had any problem with them (I only buy at european warehouse (based in NL), not UK or China).
Connectors: I use this one, and I’m really happy with them, but maybe not suitable with 3S: http://www.hobbyking.com/hobbyking/stor … ouse_.html
keep in mind, not to buy the cheapest connectors on ali, as hobbyking writes:
IMPORTANT: “These are not cheap copied XT60 plugs. These original Nylon XT60 plugs, manufactured by AMASS, can handle over 60A current for extended periods without exceeding 80DegC thanks to their better contact surface area. The plug is also less likely to deform or melt in comparison to copied non-Nylon XT60 plugs.”
I have experience with bad china connectors with my 3D-printer. In particular with a cheap RAMPS 1.4 board. The connectors really burned out! And this with much less Ampere as with Lipo’s.

bianchifan
Thu Jul 28, 2016 2:49 pm
madias wrote: Even a 2s lipo with those “fire crackers” can set up a fire which can really be dangerous (not thinking about if the fire catches the LIPO’s) – but I’m sure you’ll build in the brushless combo

madias
Thu Jul 28, 2016 3:48 pm
I don’t know what was really wrong with the connectors on the RAMPS, all I know I was not the only one, the net is full of pictures like this:
https://lh3.googleusercontent.com/-kU_K … /photo.jpg
http://forums.reprap.org/read.php?13,288216
My solution was easy and started with the question (as often): “Do I really need a connector?” So I soldered the cable directly on board and finish.
Wish you luck with the car and the plastic gear (even in my 250 Euro TeamC buggy there is “plastic” in the gears, but it’s made from Polyaramid.)

Leave a Reply

Your email address will not be published. Required fields are marked *