Lets start off with my original thoughts on this project.

Original Project Requirements:

  1. Add more power to the Lamborghini
    1. Add 12V battery
    2. Replace 6V motor with 12V
  2. Keep the original 6V electronics
    1. Remote control still operational
    2. Sounds still operational
    3. Lights still operational
    4. Original 6V charger still operational
  3. Keep all batteries and electronics under seat
  4. Forward and reverse should still work

The first thing I purchased was the battery and new motor from Amazon. I originally used 12V automotive relays to power the new motor. In the video you can see this working. The rear wheel spun the entire time. It was a lot of power for a 4 year old with poor driving skills.

Knowing this would be too dangerous for him, I decided to control the power. I considered just doing a simple ramping of power but the top speed was still about 12Mph. The original top speed was 3Mph! So this lead me to developing speed limits. In order for me to get the speed feedback, I had to add wheel encoders of some type.

At this point the new requirements could have been complete but I usually do unnecessary things. So I thought it would be cool to add traction control. Its only one additional wheel encoder right!?

Modified Requirements:

  1. Add more power to the Lamborghini
    1. Add 12V battery
    2. Replace 6V motor with 12V
  2. Keep the original 6V electronics
    1. Remote control still operational
    2. Sounds still operational
    3. Lights still operational
    4. Original 6V charger still operational
  3. Keep all batteries and electronics under seat
  4. Forward and reverse should still work
  5. Add power management
    1. Ramp power according to Sport or comfort modes
    2. Micro controller should be ESP8266
    3. Wireless webpage user interface
      1. Sport,  Comfort settings
      2. Top speed limiter select
      3. Report current wheel speeds
    4. Add 2 wheel encoders to detect top speed
      1. Wheel encoders will also detect wheel slip
    5. ESP8266 will limit top speed to selected value
      1. 3, 6, 8, 10, 12 Mph

I love writing code so programming the ESP8266 was fun for me. Possibly I made this project more complicated just for this reason?? Because of this personal problem, I also added graphical gauges for speed. These gauges were originally a clock tutorial I modified into a speed gauge. It can be found here:

https://www.w3schools.com/graphics/canvas_clock_start.asp

Of course you can also look at the final code if you want gauges too!

The next part of my life was not good. Trying to control the power going to the wheel was tough for me and like usual, I made it extra hard for myself. For some reason, I wanted to control the negative side of the motor with a TIP120. There was too much current going to the wheel so I changed it to a 30amp MOSFET.

The MOSEFT actually worked but blew out every time I would drive the Lambo forward and stop. I must have rebuilt this board 5 times, each adding more diodes and researching online for an answer. Eventually I understood that the MOSFET was trying to tell me to go a different direction. I went to my friend Amazon for an answer and it had one. There was a 43amp H-bridge controllers for about $15! So much time was wasted!

The H-bridge on Amazon was the HiLetgo BTS7960 43A High Power Motor Driver Module. It has a nasty huge heat sink too. Perfect for this project I could hardly wait the 2 days for it to arrive.

After changing to the H-bridge, life was good again and the sun came back out. But only for a moment. I connected the optical encoders to 5V and the ESP8266 did not agree with this. I murdered to ESP8266 before I realized what was wrong. Then I ordered 2 new ones from, yet again, Amazon. No this isn't an Amazon commercial. The ESP8266s I received were bigger than the ones I originally had so I had to rebuild the control board to make them fit. Ahhhh!!!

After the ESP8266 fiasco, I was finally able to start tuning the traction control. I originally used some 2nd order polynomial but found that a linear equation would work even better using percentage of my step value. The step value for sport is 15 while the step for comfort was 5. A step is the amount of duty cycle I increase the PWM output every 200ms.  If there was a decent amount of slip, I would hold the duty cycle output hoping the second wheel would catch up. If there was an extreme amount of slip I would decrease the output. Obviously if there was no slip the power output would increase the full 15 duty cycle percent in sport mode. The lowest the duty cycle would go is 30%. This is just over the breaking point for the motor to spin the gear set.

The performance of the traction control work surprisingly well. I was really happy with it. I know some control systems people will think otherwise. But they weren’t in my garage helping me at the time.

The final result was a sweet Lamborghini that could be tuned wirelessly with speed limits and traction control and has near-real-time feedback of the speed. I could also still drive the Lamborghini with the stock remote control and all the lights and sounds still worked. My son has a lot of fun with it and I felt better knowing I could limit the speed to 6Mph but increase it as he became a better driver.

Please check out the video and subscribe, I have more projects on the way.

 https://www.youtube.com/watch?v=sQc1SC60owo