Regenerative braking broke my motion controller. Here’s how to protect yours (with schematics)

Sdílet
Vložit
  • čas přidán 2. 08. 2024
  • Regenerative braking sounds like the futuristic technology that we all need, but it’s not all sunshine and rainbows. Incorrectly configured, regenerative braking can result in devastating voltage spikes that destroy expensive equipment such as motion controllers.
    In this video, we run a few experiments to demonstrate the effects of regenerative braking, and talk about a protection circuit that could save us from a trip to the electronics graveyard.
    Sources mentioned in the video:
    Jantzen Lee’s (@jtlee1108) video on regenerative braking: • Optimal Regenerative B...
    Phil Frost’s explanation of regenerative braking: electronics.stackexchange.com...
    Geckodrive’s returned energy dump circuit: www.geckodrive.com/support/re...
    ODrive 3.5 schematics on GitHub: github.com/odriverobotics/ODr...
    Chapters:
    00:00 Introduction
    00:16 What Happened
    01:39 What is Regenerative Braking
    04:18 Boost Converter
    06:35 Regenerative Braking with Servo
    07:53 Protection Circuits
    08:35 Schematics
    09:52 Protection Circuit Test
    10:33 Conclusion
  • Věda a technologie

Komentáře • 106

  • @xM0nsterFr3ak
    @xM0nsterFr3ak Před 5 měsíci +20

    I completly missunderstood the Thumbnail 😂 "Regen" means "Rain" in my native language and i thought rainwater destroyed your Controller 😅

  • @DrTimmay
    @DrTimmay Před 5 měsíci +15

    Very informative, but gotta say: that transition from 3D eCAD to physical PCB at 9:37 floored me! Really well done; pretty clear that took a lot more effort than the smooth transition suggests. Going to try to mimic that in a video of my own at some point. Great stuff, got yourself a new sub! :D

    • @engineerbo
      @engineerbo  Před 5 měsíci +2

      Thank you! I did that transition on a whim and it took far longer than it should have.

  • @tze-ven
    @tze-ven Před 5 měsíci +4

    (At 8:36) Although kind of irrelevant to the subject you are talking about, but I couldn't resist telling you that there is a small issue with your in-rush current limiter. When the capacitor bank reaches its steady state, the PMOS turns off bypassing the in-rush current resistors. However, if a power surge from your circuit lowers PVDD enough, the TL432 will turn off the PMOS, thus enabling in-rush protection when power is most needed. One way to overcome this is to pull up FB1 higher than 2.5V with a PNP transistor once GATE1 goes low. This effectively prevents the TL432 from responding to PVDD dip after the steady state.

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      Thanks for the heads up! I haven't stressed the power supply enough to cause a big enough voltage drop, but yes that's definitely something that can be improved.

  • @wez50
    @wez50 Před 5 měsíci +7

    I had a similar experience with my CNC milling machine Z axis with home made DC drives (1000kg axis + table) I even made a dump circuit with a IGBT….
    My hard lesson was selecting the correct wattage resistor and heatsink !!! I made all the load dump tests in winter (cold machine and thicker slideway oil)
    In the summer my 100w power resistor went BANG ! Thin oil and less friction!
    I now have a correct 500w resistor and a thermal switch on the heat sink that is in the E-stop circuit!!
    Enjoyed the video! It brought back memories 😂

    • @engineerbo
      @engineerbo  Před 5 měsíci +2

      Glad you enjoyed the video! If the power resistor is the only thing that blew up, I'll consider it pretty good luck!

  • @MrAnalogmonster
    @MrAnalogmonster Před 5 měsíci +15

    This video and your last were fantastic! You explain some complicated topics in an engaging way. Got me subscribed.
    Please continue documenting the development of your diy servo. I know you said you are currently unhappy with it, but critical analysis and communicating your plans are often more interesting than just describing a finished project

    • @engineerbo
      @engineerbo  Před 5 měsíci +2

      Thank you! The project is pretty big, so I've to figure out how to break it down into suitable chunks and to keep it interesting.

  • @christossideris7402
    @christossideris7402 Před 5 měsíci +5

    Subscribed, more diy servo videos plz. Also i love that you take the time to explain the theory

  • @csongor48
    @csongor48 Před 5 měsíci +1

    Thanks for the video! Cant wait to know more about the servo and its motion controller and driver!

  • @KidCe.
    @KidCe. Před 5 měsíci

    really love this kind of in depth project videos!

    • @engineerbo
      @engineerbo  Před 5 měsíci

      Thank you! There are more project videos to come!

  • @jozo314
    @jozo314 Před 5 měsíci +4

    I really enjoy watching your videos. I can't wait to see the source code of your BLDC driver.

    • @engineerbo
      @engineerbo  Před 5 měsíci +2

      Thank you! The algorithms can get pretty technical, but that's where all the interesting bits are (to me). I'll have to figure out how to explain them without the video becoming a lecture.

    • @chrismorrison8510
      @chrismorrison8510 Před 5 měsíci +1

      @@engineerboI'd probably watch the lecture too. Thank you for tanking the time to make the videos. I appreciate you explanation style.

  • @HyperMakes
    @HyperMakes Před 5 měsíci

    I am glad i found this channel. I watched the previous video and was quite intrigued. Subbed.

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      Thank you! Glad you found the videos interesting!

  • @zoeyzhang9866
    @zoeyzhang9866 Před 5 měsíci

    Informative tutorial👍

  • @eryksokolowski8706
    @eryksokolowski8706 Před 5 měsíci +2

    The problem is simple, your power supply is a single quadrant power supply it means it can source but not sink power, thus this power has nowhere to go and rises the voltage, this doesn’t happen if you have a :
    1. battery which can sink or source power
    2. Expensive 2 or 4 quadrant power supply
    3. Big load capacitor on the input allowing to absorb the excess power for a short time

    • @engineerbo
      @engineerbo  Před 5 měsíci

      Sounds good in theory. Options 1 and 3 are similar, but there are limits to the amount of energy that can be absorbed, and the rate of absorption might also be a concern.

  • @alexeastabrook3579
    @alexeastabrook3579 Před 5 měsíci +3

    This is a really good video. I've started making an "ODrive Clone" - So I am going to "Lift" their power resistor implementation. But the way you have done it with it being independent from the microcontroller is a great idea.

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      ODrive's solution is firmware dependent, so it's actually a far more complex method. Are you using their firmware as well?

    • @alexeastabrook3579
      @alexeastabrook3579 Před 5 měsíci

      @@engineerbo ( I think youtube had an issue with something in my reply ) -
      Its early days right now. I have a KiCad Schematic that is almost complete, I have an order by LCSC that is in progress ( Albeit delayed by China New Year )
      Its going to be an STM32FSomething with 2 TI DRV80somethings.
      It would be great to get some of the last open source version of the Odrive working on my board because 1 ) Gives me access to cheaper boards for robotics, but 2 ) Its all mainly tried and tested.
      But I have read on the forums, it seems that ODrive keeps a little bit in reserve for Robotics, not "Full Driving" for something like "Running a hoverboard motor at 100%"
      So yeah, It would be nice to use their FW, I am however totally pinching their Aux Mosfet for DC Load resistor.

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      Sounds like a fun project! I think ODrive's aux output is configured as a half bridge, so maybe it's used for more than a power resistor?

    • @alexeastabrook3579
      @alexeastabrook3579 Před 5 měsíci

      @@engineerbo It’s a generic half-bridge power output, i.e. it can be driven to VBUS or 0V or neither.
      With enough effort it could be used for any application where you want to provide VBUS, Variable voltage (DAC) with a Cap or Pull down to ground.
      However, in the current firmware, its function is to dump power via the brake resistor when necessary, to prevent the VBUS voltage rising above 56V or whatever limit has been configured.
      BUT it relies on 1 ) The micro being alive to track these transient voltages and 2) fast enough to do so - So no blocking code !

    • @engineerbo
      @engineerbo  Před 5 měsíci

      I only had a glance at the schematics for the aux output, and was confused why the braking resistor needed a half-bridge. So I'm guessing maybe it's just there for future-proofing, which is also why it's called "aux" instead of "braking resistor".
      Regarding the conditions, I agree. Even though the firmware can be designed to make it respond very quickly, I just feel safer keeping it simple (and separate).

  • @shashikantsingh6555
    @shashikantsingh6555 Před 5 měsíci +3

    I've never learned about regen braking in this detail before..😮🙌 excellent video because you talked about that part of regen braking which everyone ignores... ♥️♥️
    Keep it up pal!!!

  • @omd_0
    @omd_0 Před 5 měsíci

    Finally i found its work, i got an e-scooter and i want to improve it!

  • @tudbut
    @tudbut Před 5 měsíci +1

    The production quality here is AMAZING! How do you have this few subscribers??
    Anyways, I'm curious: Why didn't you want to use the regenerative braking protections that's built into your driver?

    • @engineerbo
      @engineerbo  Před 5 měsíci

      Thank you! My servo driver's pretty bare bones at the moment, so it doesn't have built-in regenerative braking protection like the ODrive. They're also usually used at least in a pair, so it feels unnecessary to have duplicated protection circuits.

  • @Tech2C
    @Tech2C Před 5 měsíci

    Cheers Bo

  • @Drakoman07
    @Drakoman07 Před 5 měsíci

    The subliminal messaging at 7:38 literally worked. I had this inkling that I needed to subscribe. So I did. Great video, I loved the detail you went into for your post mortem. I’ve killed a RAMPS board from a similar situation with a back driven motor. I’m glad you helped me think through my past mistake lol.

    • @engineerbo
      @engineerbo  Před 5 měsíci

      Thank you! Glad you enjoyed the video!

  • @larryslobster7881
    @larryslobster7881 Před 5 měsíci +1

    Subscribed, could you talk about BEMF sensing for encoding and FOC. Two good hard topics I think you would nail.

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      Thank you for the suggestions!

  • @mrechbreger
    @mrechbreger Před 5 měsíci

    there's another thing that has to be taken care about -- noise. This might become a serious problem in a system. I used some integrated servo before and the noise induced by the regenerative energy into the controller made it lose the position. Motor power and controller power were supplied through the same line - an energy dump was not implemented in between.
    Anyway after some time I switched to high voltage servos with separate driver, I'm not going for integrated ones anymore (they're okay for low speed though).

    • @engineerbo
      @engineerbo  Před 5 měsíci

      Can't speak for other servo designs, but to get mine to lose position from regenerative spike, it'll probably have to be a big enough spike to destroy the controller itself. As long as the microcontroller and encoder are functional, it'll be able to read the position. The communication between the encoder and microcontroller is also reasonably robust to noise, because every frame is verified with an 8-bit CRC.

  • @JeromeDemers
    @JeromeDemers Před 4 měsíci

    I saw glare on your PCB, turn that polarize filter bro! haha Btw, I did finish installing the filter on my microscope, its amazing, thank you! Wrote little article on my website about this.
    Back to your video, this is insane work, I love how you present topics. Keep making them. My big question is why not use a Zener? Would love to compare that to scope @ 10min24

    • @JeromeDemers
      @JeromeDemers Před 4 měsíci

      I just saw your reply about TVS. Those peaks are in nano second right? Peak power will be short then. Again, it depends of the end application, if the pick and place moves ultra fast with big load, this generates lots of peaks and could stress the TVS. Can you parallel TVS diode so they all absorb energy? But not sure if they will catch spikes at different time due to manufacturing tolerance.

    • @engineerbo
      @engineerbo  Před 4 měsíci

      Just looked up the article on your website, nice write up!
      The peaks in this video are really "demonstration" peaks, so I've limited it to something safe. I've seen people talk about parallel TVS diodes, and that seems theoretically fine, as long as the specifications line up. I'm guessing there are situations where TVS diodes are preferred, e.g. if ultra fast protection is needed.

  • @dzee9481
    @dzee9481 Před 5 měsíci +1

    Bo Very well done video. I would be curious how the DC servos you find from Stepper online and/or Gecko compare to the same sort of analysis.

    • @engineerbo
      @engineerbo  Před 5 měsíci

      I'm guessing all permanent magnet motors will exhibit some form of regenerative braking. Perhaps expensive controllers have some way of absorbing the energy. I'd love to find out, but those things can get pretty expensive.

  • @lezbriddon
    @lezbriddon Před 5 měsíci +6

    about 10 yrs ago on an ebike I had regen braking, saved a lot of brake pads, one morning on a full battery going downhill it was braking fine, till it pushed the battery voltage upto its maximum, and stopped braking, the resulting excess voltage with no where to go took out the mosfets so it was a walk home..... (regen, added 5-10% to my range, not worth the effort unless you have it for free)

    • @engineerbo
      @engineerbo  Před 5 měsíci

      Doesn't the controller have an overvoltage cutoff? Well, if it's just the MOSFETs that failed, it could be a relatively cheap repair.

    • @lezbriddon
      @lezbriddon Před 5 měsíci +1

      @@engineerbo 99.9% of controllers have direct wired fets. it was a cheap repair for me but a normal user would be buying a new one.

    • @artisticyeti22
      @artisticyeti22 Před 5 měsíci

      Is it not possible to redirect such energy into some empty capacitors and high power inductors so as to prevent other sensitive components from frying?

    • @engineerbo
      @engineerbo  Před 5 měsíci

      That's similar to letting the regenerative braking current recharge the battery pack. To prevent the battery pack (or capacitor bank) from being over-charged, a protection circuit is still required.

    • @lezbriddon
      @lezbriddon Před 5 měsíci +1

      @@engineerbo your suggesting a solution of a protection circuit that no manufacturer fits as (a) it would be another link in the chain that could break and (b) increase costs. I agree they should, but it's never going to happen.
      The only viable solution currently is to make sure the mosfets being used can handle the open circuit / no load back emf' voltage of the motor, and to incorporate a software solution of using the MOSFETs to apply a very small amount of regen 'at all times' when not accelerating to dump said back emf'. Unfortunately that would require software development time and as all these motor controller box shifters do is steal each others code from 2010 and use it on 2008 chipsets were not getting anywhere.....

  • @teardowndan5364
    @teardowndan5364 Před 5 měsíci +1

    If all you need is shunting a known amount of energy from regen braking, then you can take care of the voltage spike by simply adding a capacitor large enough to absorb the regen energy within the allowed voltage rise. If you have a 1kg mass moving at 3.16m/s, that is 10 joules of energy. If your nominal voltage is 24V with a 28V absolute maximum, you would need a ~100mF (0.1F) capacitor, preferably in the form of 2-3x smaller capacitors in parallel for reduced ESZ. Of course, having a shunt regulator to clip anything above 28V and also trigger a warning/alarm would still be a good idea in case the capacitor bank wears out.

    • @ikbendusan
      @ikbendusan Před 5 měsíci +1

      ah yes the ubiquitous 40 V-rated 100000 µf capacitor; the first thing that should spring to anyone's mind 😎

    • @teardowndan5364
      @teardowndan5364 Před 5 měsíci

      @@ikbendusan If you cannot source 100mF caps for a reasonable price, just replace it by an equivalent amount of parallel caps.
      If you want to brake and accelerate 10J of kinetic energy in 20ms at an average rail voltage of 26V, you need to handle an average of 38A in and out. Huge caps are only rated for 20-25A of RMS ripple, so you'd probably want to split that current between 2-3 smaller caps at a minimum for longer life.
      You can also go all-in on being budget-minded and just lump 15x 10mF caps together to achieve ~60A RMS rating for cheaper than a single high-current 47mF cap.

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      1 kg mass moving at 3.16 m/s is about 5 J. To absorb 5 J (i.e. magic perfect regeneration) and have the voltage rise from 24V to 28V requires "only" about 48 mF. To size the capacitors we'll want a safety margin, then adjust for derating and ESR etc. Overall, it's doable, but the braking resistor is likely cheaper.

    • @teardowndan5364
      @teardowndan5364 Před 5 měsíci

      @@engineerbo Sorry, forgot the divide by two there. Makes it twice as doable and half as harsh on caps.
      I wasn't suggesting capacitors for the cost, though large power resistors aren't exactly cheap either. More for the efficiency, reduction in power supply peak loads, eliminating the need for the PSU to cope with massive fast transients, 100% passive simplicity and no hot dump components to worry about. Also, when capacitors go bad, you usually get progressive tell-tale signs before failure (ex.: leaking caps, sensor misbehaving from electrical noise and controllers crashing from noisy power) instead of immediate catastrophic failure when a shunt fails to do its job.
      You can build a 50mF capacitor bank out of 15x3300uF Nichicon YXS caps for about $25 which would have ~1mOhm of ESR and 60A RMS ripple capacity.
      At that point, wiring ESR/ESL would be a bigger concern than the capacitors'.

    • @engineerbo
      @engineerbo  Před 5 měsíci

      I personally quite like capacitors, and in the protection circuit's PCB in the video, I actually did include a small bank of them. Having a large capacitor bank doesn't instantly mean the system is simplified though. For example, there might now be an high inrush current when powering on.
      There are also several failure modes for capacitors, and for sure catastrophic failure (e.g. venting) is one of them. I'd also imagine it's not necessarily better to experience gradually worsening system reliability in non-catastrophic cases.

  • @candas1
    @candas1 Před 5 měsíci

    I am using an ideal diode usually used for solar panels. I am not sure if it's the best solution but my power supply is alive. I need to check on the oscilloscope as you did

    • @engineerbo
      @engineerbo  Před 5 měsíci

      Where do you install the diode? It sounds like a diode could be protecting one side of the diode at the expense of the other side.

    • @candas1
      @candas1 Před 5 měsíci

      @@engineerbo Between the psu and the controller. So you mean I would still blow the controller but not the psu

    • @engineerbo
      @engineerbo  Před 5 měsíci +2

      Yes, the diode will stop the reverse current into the power supply, but the voltage spike will still build up on the other side of the diode.
      If you're using a diode, you still need something to dump the energy, like the returned energy dump circuit on gecko drive's website.

  • @vietle-fr5rj
    @vietle-fr5rj Před 5 měsíci

    I'm about to go to college, can you suggest me what major I should study to have skills like yours? I really admire what you are doing.

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      Thank you! I don't have any specific recommendations, since it really depends on your objectives. While there's a lot to be learnt at university, many skills ultimately need to be picked up and practised on your own. Usually that means you need to really enjoy doing it, to be able to keep at it long enough to get good.

  • @cadsonmikael9119
    @cadsonmikael9119 Před 5 měsíci

    What about a zener or a few maybe? I have them both at the gates themselves and at the motor-phases, as well as on the dc side.

    • @ikbendusan
      @ikbendusan Před 5 měsíci

      a tvs diode would be more appropriate

    • @cadsonmikael9119
      @cadsonmikael9119 Před 5 měsíci

      Yeah, and what is a TVS diode, actually inside?@@ikbendusan

    • @ikbendusan
      @ikbendusan Před 5 měsíci

      @@cadsonmikael9119 i know they are basically the same thing but good luck finding a 600 W/1000 µs rated zener diode

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      @cadsonmikael9119 A Zener diode as a voltage clamp is also one of the recommended protection methods. The problem is you'd have to use a Zener that is rated for the full current.

  • @rockman9h02m
    @rockman9h02m Před 5 měsíci +1

    I wonder how the Servo Drive will fare on a 3d printer...

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      I am also curious about this. I'm thinking of running some simple experiments to see if there are problems with coordinated motion and/or positioning accuracy. Could be interesting!

  • @tomapc
    @tomapc Před 5 měsíci

    Servo motors and SKR1.4???? What am i missing?
    SKR1.4 is for stepper motors, not servos, so....

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      The SKR V1.4 uses the step/dir interface. Stepper motor drivers, and any other drivers which support that interface will work. Both the servo42c and my own design support the step/dir interface.

    • @tomapc
      @tomapc Před 5 měsíci

      @@engineerbo OK, so using stepgens, nice.

  • @AdjustinThings
    @AdjustinThings Před 5 měsíci

    Did you try get Klipper-CNC running?

    • @engineerbo
      @engineerbo  Před 5 měsíci +1

      Nope, haven't tried it yet. I'll have another look at it when I next have a suitable project.

  • @pingwinvonjelen6586
    @pingwinvonjelen6586 Před 5 měsíci

    Even though I know exactly how regenerative braking works, I don't understand what the problem is. In applications where we have no way to store this energy, regenerative braking is pointless and the motor should be braked by applying current to it.

    • @engineerbo
      @engineerbo  Před 5 měsíci

      Applying a reverse current works, but the kinetic energy still needs to go somewhere. If the energy isn't dumped into a dedicated resistor, all other components (e.g. motor, wires, switches, power source) will need to absorb or dissipate it.

  • @jvandervyver
    @jvandervyver Před 5 měsíci +1

    Why is it bait and switch? Bait and switch is a **scam** where you promise one thing, then when it arrives it is another lesser thing. In engineering that analogy doesn't quite make sense to me. Electronics operating in multiple modes or like multiple devices, etc. is not a bait and switch because it isn't a scam. The scam part is the critical point in a bait and switch scheme. Anyway maybe I'm just misunderstanding why this is like a scam. But using that logic I feel like I can call a bunch of mathematics a scam too because it is unusual from what you expect (ie. the analogy doesn't carry well outside of a societal context IMO)

    • @engineerbo
      @engineerbo  Před 5 měsíci

      The analogy isn't meant to be technically rigorous. That said, I think the analogy has some merits (literally using a switch to cause current to flow and redirect it where it normally wouldn't). It's understandable if you disagree.

    • @jvandervyver
      @jvandervyver Před 5 měsíci

      @erbo ok.. Bait and switch refers to a fishing line. You throw out bait, and then when a customer bites and buys something, they get something other than what they paid for.
      IMO it doesn't make sense in the English language to use it they way you are, it makes it sound like you don't understand the phrase or the language. But I mean if you want to keep using that analogy 🤷‍♂
      Maybe read: en.wikipedia.org/wiki/Bait-and-switch

  • @SIM31r
    @SIM31r Před 3 měsíci

    Can I just put a big capacitor? Just take approximately 1 J of energy. I’ll answer it myself - I need to test it And there is some danger 😀

    • @engineerbo
      @engineerbo  Před 3 měsíci +1

      Yes if you have a sufficiently large capacitor and a sufficiently low impedance path, then it'll limit the voltage ripple enough to do the job.

    • @SIM31r
      @SIM31r Před 3 měsíci

      @@engineerbo Varistor for an operating voltage of 13-15 volts, the simplest and cheapest method ))

  • @user-gu1xm7wc9u
    @user-gu1xm7wc9u Před 5 měsíci

    And why not just use a simple TVS diode?

    • @engineerbo
      @engineerbo  Před 5 měsíci

      A TVS diode will theoretically work fine, provided you can find a model with a voltage rating that suits the rest of the system (I don't think I've seen an adjustable TVS diode), and is able to survive the power/energy from regenerative braking.

    • @user-gu1xm7wc9u
      @user-gu1xm7wc9u Před 5 měsíci

      @@engineerbo
      Just one search result and there you can find TVS diode with various nominal voltage and power ratings, up to several kilowatts. If there are no other specific parasitic characteristics these diodes apply on the circuit I don't see why making the search a whole lot more complicated focusing on sourcing many parts including IC's instead of just a single component to do the job.

    • @engineerbo
      @engineerbo  Před 5 měsíci

      I can perform a similar search for components, and I don't think I will easily find a TVS diode that will satisfy all my requirements. The TVS diode needs to be rated so it doesn't conduct during normal operation, but clamp the voltage before anything else is damaged. That in itself is not a trivial requirement to satisfy.
      When you say these diodes are rated to several kilowatts, I'm guessing you're referring to the "peak pulse" power rating. That is not the same as the power rating as with a power resistor. There's a reason the 300W braking resistor I showed in the video is about the size of a brick, but a "300W" TVS diode might come in an SOT-23 package.

  • @James-un6kx
    @James-un6kx Před 5 měsíci

    buck boost = bait and switch. LOL

  • @klazzera
    @klazzera Před 5 měsíci

    F = m.a

  • @nathansmith7153
    @nathansmith7153 Před 5 měsíci

    You need to have a supply that can sink current.