Mastering Turns: Build a SPIKE Prime Car with an Electronic Differential

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

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

  • @salva8722
    @salva8722 5 месяцев назад +1

    Nice, another video with the detail about the pins used to link the spike prime port to the board and also what strings do they change, and how these are "translated" to the led strip could be great. I guess with another IDE it is possible to expand the integration with other peripheral items. I also loved the math introduction, before starting to code, a goob example of a steam educational practice.

  • @julianthemighty1
    @julianthemighty1 5 месяцев назад +2

    I... can't believe it, I'm trying to make a BuWizz-powered technic car and was struggling with this exact problem! Thanks so much for posting this video!

  • @Madalynmei
    @Madalynmei 2 месяца назад +2

    This was very informational and helped me to build my car. However with me being 11 I don't understand. I just know it makes a very successful car.

  • @FrenchMonke.
    @FrenchMonke. 2 месяца назад +1

    This guy is better than my math teacher to explaine

  • @user-in4ds8iq8g
    @user-in4ds8iq8g 5 месяцев назад

    super!!!

  • @MarekLewandowski_EE
    @MarekLewandowski_EE 5 месяцев назад +1

    Hi Anton.
    It's a nice video, but it's not right... It's a complex thing, but I'll try to go step by step:
    The front wheels (even if you build the car right, i.e. with Ackerman steering or similar, so that the inside wheel turns more into the turn) do not travel on tangents of their circles. The car needs to be turned around, but due to inertia it 'wants' to keep moving straight, so if the front wheels are to be useful, i.e. apply sideways force to turn the vehicle and not just support the weight of the front bumper, they will 'understeer' and have a sideways 'walk'. By how much? Depends on speed, surface, etc. Since you cannot predict this exactly, you cannot use speeds as set-points for the rear axle motors. What you want is not speed vectoring, but torque vectoring, i.e. you want to apply more torque to the outside wheel to actually result in net torque around the vertical vehicle axis, that will be part of the torque resulting from the front wheels being turned into the curve. Ideally these two torques should be proportion of front vs rear grip, at Spike Prime speeds it's going to be weight distribution between front and back.

    • @AntonsMindstorms
      @AntonsMindstorms  5 месяцев назад

      You are right. However, if you don't do anything, the car doesn’t turn, and this system is a simple way to have some fun with the car without a differential gearbox. What programming approach do you propose instead? Which inputs for the control system?

    • @MarekLewandowski_EE
      @MarekLewandowski_EE 5 месяцев назад +1

      @@AntonsMindstorms generally I'd experiment with two approaches: approach 1, slightly unorthodox but should be easy enough to code and might work satisfactorily, would be to run the outer motor at a given set speed and the inner motor at a percentage (below 100%) of the actual reported outer motor power, the percentage being smaller the tighter the radius of turn is. This way we use the speed controller from Spike Prime (which gives the power as output value, the 'power' being really the duty cycle of the motor power stage) and just slave the inner motor power to the outer motor. The second approach would be to make one's own speed controller and distribute its output between the left and right wheel duty cycle based on a factor proportional to the turn rate, i.e. if the requested ducy is 60%, split it 60%+x and 60%-x with x = f(steering angle).
      A good first approach is to assume you want the same total force at each wheel, assuming all wheels are identical and the weight is evenly distributed. The front wheels will only see lateral forces, the driven wheels will almost only see longitudinal forces with some lateral forces at high speed (likely irrelevant for Spike speed). Assume maximum usable force transfer is at 2% wheel slip, since we have full rubber wheels with toroidal cross section it's same sideways as in driving direction. From there you can take the math to find the maximum cornering rate at any given speed 😁
      The real torque vectoring in a vehicle is linked to the esp (electronic stability control) module and takes feedback from the vehicle IMU to compare the commanded turn rate (steering wheel input) and the actual turn rate (gyro reported) and the estimated vehicle grip limits and from there it decides what to do - use driven wheels torque, selective braking etc. Much more complex thing and very proprietary.

    • @AntonsMindstorms
      @AntonsMindstorms  5 месяцев назад

      ​@@MarekLewandowski_EE...or maybe I could extend the calculated radius by a few percent to give the front wheels something to 'do'?

    • @MarekLewandowski_EE
      @MarekLewandowski_EE 5 месяцев назад +1

      @@AntonsMindstorms it depends whether you want to teach about how it should be done or if you want a hack. The way you have coded it works, but it's a hack and the explanation in your video doesn't touch on the topic of why and how twin drive can actually improve handling. There are many solutions that work on a LEGO scale, there are many 'wrong' solutions that work for specific reasons better than 'right' solutions even on real vehicle scales (karts not having diffs, some F1 cars having reverse Ackermann steering with outer wheel turning more into the curve etc.), so it's really about what educational value you want to put in.

    • @AntonsMindstorms
      @AntonsMindstorms  5 месяцев назад

      Woah! It never occurred to me that karts don't have diffs. That's why they say it helps to lean out in a turn!