RC Car Traction Control with an Arduino

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 41

  • @PimpinPoptart06
    @PimpinPoptart06 2 года назад +3

    Super cool! I l forward to more videos

  • @ErichHaubrich
    @ErichHaubrich 9 месяцев назад +1

    Great work. I'm interested in this for my quad motor Latrax Rally 1:18 build, and my CineRipper AWD 1:10 Camera Car.
    I'm wondering if four-wheel traction control can work with all four ESCs.
    I'm also wondering if the capacitive touch sensor functionality on the ESP32 could be used in place of the hall effect sensors.
    Thoughts?

  • @torstonvodesil6709
    @torstonvodesil6709 Год назад

    All the stuff you are doing is what I want to do for my own diy rc car, nice to know it isn’t impossible

  • @Jasonv8z
    @Jasonv8z Месяц назад

    Nice work. Instead of measuring wheel speed, I suggest using a VESC with a brushless motor and using a PID or fuzzy logic control loop to maximize motor torque. There is already PID tuning code for the balance board support. Alternatively, you could integrate an accelerometer to the VESC (or use a VESC with built in IMU) and compare it to motor RPM. I think the accelerometer approach would be slower to respond easier to implement.

    • @IndeterminateDesign
      @IndeterminateDesign  Месяц назад

      I really want to try a VESC. It’s just hard to find them in the right form factor. I did use a 14biy magnetic encoder for my RC Hypercar project and a PI controller, and it works sooo much better. The added resolution makes all the difference.

    • @Jasonv8z
      @Jasonv8z Месяц назад

      @@IndeterminateDesign The original vesc 4 and vesc 6 design that use the 4's footprint are small. You'll probably have to use a lower kv motor and higher voltages to get equivalent power.

  • @chrisw1462
    @chrisw1462 2 года назад +1

    Regarding adding a 'slew rate' to the throttle control - A version of a PID algorithm would work great. Not sure if you'd need all three variables, but testing will give that answer.

    • @IndeterminateDesign
      @IndeterminateDesign  2 года назад +1

      Thanks! That makes complete sense. I was just adding a low pass filter to smooth the throttle, which is literally the derivative term. I'm fairly new to the control engineering and I hope this will be relatively easy to tune for different surfaces.

  • @ErichHaubrich
    @ErichHaubrich 9 месяцев назад +1

    Would you like to collaborate on a device for RC/Motorsports?
    I feel as though this could be an incredible product or open source project, especially if it were implemented on an ESP32, Which would add Wifi, BLE, and ESPNOW communication to/from sensors, ECU, ESCs, Phones, tablets, laptops, etc.
    ESP32 can also read CANBus and other data.
    This might also be able to talk to MegaSqirt or Carduino.
    It's worth a look.

    • @IndeterminateDesign
      @IndeterminateDesign  9 месяцев назад

      I'm working on this more with my RC Hypercar right now that has individual wheel motors and a 4:1 ESC. I also have magnetic encoders on each wheel. I think that's ultimately key. I implemented a bit better traction control algorithm on my last Streamliner, but it's limited by the resolution of just 24 magnets. The encoders are accurate to 0.3 degrees at 28,0000 rpm. The increased resolution allows for much finer control with these very fast reacting RC cars.
      Traction control for individual wheel motors is more complex. You can't rely on wheel speed sensors alone, you really need accelerometers and a full vehicle model to implement traction control.
      I haven't played with the capacitive touch on the ESP32 at all. I guess it would depend on their speed and sensitivity to electrical noise.

  • @Firashelou
    @Firashelou 2 года назад +1

    Great job ! I have a question why you chose not to run the tests on asphalt ?

    • @IndeterminateDesign
      @IndeterminateDesign  2 года назад +1

      I’m traveling in an RV in a very rural area so no real paved locations. I will definitely test the Streamliner on pavement with the traction control soon.

    • @Firashelou
      @Firashelou 2 года назад

      @@IndeterminateDesign ah ok i understand ! Good luck !

    • @xxxratixxx
      @xxxratixxx 2 года назад

      Thats really interesting

  • @marcinpohl3264
    @marcinpohl3264 2 года назад +1

    What was the optimal slip % value for tarmac?

    • @IndeterminateDesign
      @IndeterminateDesign  2 года назад +1

      I don’t know yet. I don’t have access to a paved testing site right now.

  • @ayhenterencio553
    @ayhenterencio553 Год назад +1

    Does adding more magnet can increase the resolution of the wheel speed data?

    • @IndeterminateDesign
      @IndeterminateDesign  Год назад +3

      Yes. I’d recommend at least 12 magnets based on subsequent testing with my streamliner project. It smooths the response considerably.

  • @dancoulson6579
    @dancoulson6579 Год назад

    I wonder if you could use 4 hall sensors. One on each wheel. And then compare the front left to rear left, and front right to rear right. This would allow for turning whilst still having traction control.

    • @IndeterminateDesign
      @IndeterminateDesign  Год назад

      Absolutely. Four wheel sensors would allow for traction control when turning. This was really a prototype for me to develop a traction control algorithm for my RC streamliner that has a single rear wheel with too much power to control.

  • @tvathome562
    @tvathome562 2 года назад

    Very cool, so you'll be using traction control sensors for the abs as well?
    Also if you are going reapply throttle in a more gradual manner wouldnt there also be gains in a more gentle easing off the throttle when slip rate is too high? (or am I over complicating again)

    • @IndeterminateDesign
      @IndeterminateDesign  2 года назад +3

      Thanks. Yes, I can use the same sensors for ABS to detect when a wheel locks up.
      For re-applying the throttle, it’s gradual until the % slip falls under the maximum threshold and then the TC turns off and suddenly the car goes full throttle again which causes the wheels to spin.
      For the gradual part of cutting the throttle, I think you want to cut the throttle as quickly as possible to prevent overruns. The TC is cutting throttle proportionally to the % slip. An example is with a 10% max slip, if you just go full throttle and spin the tires, the TC will being cutting throttle at 11% and again a bit more at 12%, and so on but it can’t keep up perfectly with the wheel spin.
      There’s a delay due to only having 4 magnets per wheel and inertia of the motor and wheels will keep the wheel spinning. In a perfect world there would be no delays or inertia and the traction control could stop the slip at 10.001%.
      So I’ve been told by another viewer I most likely need to implement a full PID controller (proportional integral derivative if you’re not familiar). The integral term in particular looks at the cumulative error over time and would help cut the throttle faster.
      I hope that made sense and wasn’t too much of a random conscious stream of thought.

    • @tvathome562
      @tvathome562 2 года назад

      @@IndeterminateDesign thanks for the reply, I agree pid could be a good fit for this. Looking forward to the next video.

  • @surfacta
    @surfacta 8 месяцев назад

    how do you deal with front wheel speed of 0? shouldnt it create infinite slip and mess with throttle when the car is idle?

    • @IndeterminateDesign
      @IndeterminateDesign  8 месяцев назад

      Traction control doesn’t turn on until I think 25 rpm is sensed. The whole setup would be better with more magnets. My later implementations use either 24 magnets or an encoder. The finer the resolution of the wheel speed, the faster and more accurately the traction control can react, particularly at low speed.

  • @leighpettipas8601
    @leighpettipas8601 Год назад

    Question about your code>>there is a line in the "process traction control" loop:
    if (micros() - previousTractionControlMicros > tractionControlInterval)
    I don't see the previousTractionControlMicros ever being updated. When I do similar, i make the previous = current at the end of the loop. Just trying to figure out how yours works, and if I'm missing something. Thanks for the video and the code.
    My biggest take away is to evaluate TC every .01s....I think that was the key I need to make mine work. Mine is on a v8 race car, and im going to cut ignition and my inputs are throttle, rpm and gps speed....

    • @IndeterminateDesign
      @IndeterminateDesign  Год назад +1

      Good catch, that was a bug. I made some last minute fixes. I just pushed out a new version of the code. I haven't really played with it much since the video but I do have a couple of lessons learned. There really needs to be an integral term to get the traction control to react faster, the version of the code that I just committed has this.
      On the race car you may need something more accurate than GPS for traction control based on tire slip ratio. I've seen it done with a combination of GPS and inertial measurement units, but it's a lot of work fusing that data together. Wheel speed sensors like I had on my RC car are generally the easiest and most accurate for 2wd cars.
      For drag racing you can get away with a rate based traction control which just looks at the rate of change of either wheel speed or driveshaft speed.
      You might look at how companies like Megasquirt and Haltech implement their traction control.

    • @leighpettipas8601
      @leighpettipas8601 Год назад

      Thanks for replying so fast, I’ll check out your new code…
      Yup, I’m trying to do it very simple…don’t want to add a lot of sensors. It’s a road race car, and I’m just messing around. I tried slew rate rpm, but I only get rpm from my aim dash at 50hz - it’s pretty slow. I’ve been studying some data from a wet session, and believe it or not (I didn’t at first), but rpm/gps speed shows pretty accurately wheel slip. We will see, I’m gonna write the code and tune it this race season. I did manage to implement no lift shift. I have a rev limiter with a hi limit and low limit, and with pwm, I can set the limiter anywhere in between - so I use it to shift cut and for pit speed. Hopefully I can make a simple tc system as well, that I can build on.

  • @fredericpierron6999
    @fredericpierron6999 Год назад +1

    Hi, at the end do this project is working fine? Do you have any update on the code? You did a really good job, the code is crystal clear and well commented :D thank u

    • @IndeterminateDesign
      @IndeterminateDesign  Год назад +1

      I haven't made any changes as of yet. I have integrated it into another project and it's worked well. The biggest improvement comes from using more magnets (12+). The cars are easier to tune and much better performing when you have more accuracy.

    • @fredericpierron6999
      @fredericpierron6999 Год назад +1

      @@IndeterminateDesign Thanks for your answer, i analysed well the source and i don't arrive to figure out how the EMA fonction can work in your context because you never fill the "previousPercentSlip" static float? This stuff i don't understand ! but really nice work

  • @lennart188
    @lennart188 24 дня назад

    Hey, it would be nice if someone could verify that my setup for a traction control could work. (no fundamental flaw)
    I have a 1/10 RWD short course truck, 4 digital latching hall sensors, 10 magnets on a rotor on the wheel hubs, and an Arduino nano every. The PWM from the receiver goes into the Arduino and gets adjusted...
    Can this Arduino accurately measure the time between each magnet pulse on all four wheels?

    • @IndeterminateDesign
      @IndeterminateDesign  24 дня назад +1

      Absolutely. If your code is efficient and you use ISRs it should work fine.

  • @beachboardfan9544
    @beachboardfan9544 2 года назад

    If that hall effect sensor is what enables slip detection, how does it detect slip when 90% of the rim has no magnet on it?

    • @IndeterminateDesign
      @IndeterminateDesign  2 года назад +4

      There are 4 magnets on the front and rear wheels with the sensors. The sensors change state every time a magnet passes the sensor. The traction controller is updating every 1/4 turn of the wheel which is fairly often. Even at 3mph, or human walking speed, the wheel speed will be updated every ~0.1 seconds. The speed of the wheel doesn't change significantly in that time frame.
      If you notice the car when stopped has a tiny bit of tire spin before the traction control kicks in. More magnets would allow for finer resolution. A small amount of wheel spin initially can be beneficial. If you try in this in a full size car with traction control you'll notice the same thing, that the wheel will spin some before the traction control kicks in (Modern cars update between 20-25 times per wheel revolution).

    • @beachboardfan9544
      @beachboardfan9544 2 года назад

      @@IndeterminateDesign O damn, missed that, thought from that one shot it was just one magnet on the wheel.

  • @adamyassine4210
    @adamyassine4210 2 года назад

    Does this traction control compensate for the front left wheel spinning faster than the rear left wheel during a turn? The car's center of turning circle is coincident to the rear axle, meaning that the front wheels have a larger turning radius than the rear wheels and hence cover a larger distance (think of the Ackermann steering geometry)

    • @IndeterminateDesign
      @IndeterminateDesign  2 года назад +1

      No, I touch on it in the video but this was setup primarily for straight line acceleration so that I could use it on my RC streamliner. It could definitely benefit from a more complex traction controller that takes into account steering angles and has wheel sensors on all 4 wheels.

  • @1danny2k
    @1danny2k 6 месяцев назад

    I want to use this for a real 4x4 car. To use brakes on a wheel when it starts slippin

  • @bryanhutson6741
    @bryanhutson6741 Год назад

    Could be a good place to implement a PID.