STM32 getting very hot. Can't connect (ODrive 3.6)

Over the last days I built my first ODrive test setup. After testing that the encoder’s output is being read fine. I connected the break resistor and motor today. After powering up, I couldn’t connect to the ODrive anymore. I checked the temperature around the board and the STM32 as well as the DRV8301 of the output the motor was not connected to are getting very warm. The Motor and encoder are separated by a motor coupling with a plastic isolator. I used the default settings. I only changed the encoder CPR for M1.

How warm is very warm? :face_with_raised_eyebrow: Is it too hot to leave your finger on?

I’m not sure exactly what is going on between your various boards there (some kind of wiring diagram would be useful :stuck_out_tongue: ) but it’s possible that you had a ground loop with one of the other boards, perhaps…?

What are you trying to do?

How warm is very warm? :face_with_raised_eyebrow: Is it too hot to leave your finger on?

It is way too hot to keep my finger on it.

I’m not sure exactly what is going on between your various boards there (some kind of wiring diagram would be useful :stuck_out_tongue: ) but it’s possible that you had a ground loop with one of the other boards, perhaps…?

Most of the boards have no connection to the ODrive. There is power coming from the PSU and USB from the Jetson Nano. The Jetson Nano is powered by the same PSU so there could be a groundloop there… I’ll draw a wiring diagram…

What are you trying to do?

I’m trying to get the motor to spin :smiley: This is my first time using the ODrive.

That doesn’t sound good… It’s probably fried in that case, and you’ll need to desolder and replace the chip, and then re-program it with an ST-link… :frowning:
Can you check that the 3.3V rail is 3.3V?

What are the other two boards for, then? I understand you having a PSU, Jetson Nano and an ODrive, but you have two other boards that I don’t recognise. Are they in-circuit or disconnected?

It’s possible that your PSU outputs very slightly more than 24V, where 25V is the absolute maximum for the 24V ODrive. I personally use the 56V version all the time, even if I am running on 24V.
Still, I wouldn’t have expected that to fry the STM32.

You have a somewhat unusual encoder…
Normally I ground my motor chassis in case the motor has an internal short to the casing, which can conduct through some types of encoder and fry the ODrive.

Other than that, the only other thing I can think of that could damage the chip in your case, is ESD…
Do you ever get static shocks in your workspace?

Can you check that the 3.3V rail is 3.3V?

It is 3.15V. The 5V rail is at 5.12V.

What are the other two boards for, then? I understand you having a PSU, Jetson Nano and an ODrive, but you have two other boards that I don’t recognise. Are they in-circuit or disconnected?

One of the boards is a Smoothieboard (for axis coordination and driving other stuff) the other board is a MKS TMC 2160 stepper driver for a third axis. I will use them to drive a 3 Axis machine using the ODrive for the X and Y axis. For now I’m only checking that everything works on its own before installing it into a finished machine.

It’s possible that your PSU outputs very slightly more than 24V, where 25V is the absolute maximum for the 24V ODrive. I personally use the 56V version all the time, even if I am running on 24V.
Still, I wouldn’t have expected that to fry the STM32.

I measured it at 23.8V at the outputs.

You have a somewhat unusual encoder

It is a cheap 600 CPR encoder for testing. It won’t make it into the final machine.

Normally I ground my motor chassis in case the motor has an internal short to the casing, which can conduct through some types of encoder and fry the ODrive.

Everything will be earthed in the final machine. This was just a quick test setup to check whether the motors were working. As mentioned the motors were electrically isolated from the encoder.

Other than that, the only other thing I can think of that could damage the chip in your case, is ESD…
Do you ever get static shocks in your workspace?

I am aware of ESD and take the necessary precautions. I have a ESD safe workplace. The floor is grounded and I use an ESD wristband.

1 Like

If this was caused by a ground loop through the Jetson Nano, how should I hook it up then? The final control will be 2x Step/For from the Smoothieboard and Uart from the Jetson Nano… Isolating all of those signals will be quite complicated (high speed).

I also don’t understand why the driver IC I haven’t used yet is getting warm now… It didn’t do that before.

  1. Do you have plastic isolators between the screws/nuts & the PCB?
  2. M0’s DRV chip supplies 5V to the circuit with a buck converter, so you probably have a short somewhere that it’s struggling with. It’s easy to end up with a ground loop that fries the STM32 if you’re using UART or step/dir and another board, unfortunately. ODrive v4 will have isolators for this reason.
  1. Do you have plastic isolators between the screws/nuts & the PCB?

No I don’t have isolating washers. I will get some and add them.

  1. M0’s DRV chip supplies 5V to the circuit with a buck converter, so you probably have a short somewhere that it’s struggling with. It’s easy to end up with a ground loop that fries the STM32 if you’re using UART or step/dir and another board, unfortunately. ODrive v4 will have isolators for this reason.

I already started designing a optical isolator board for these connections.

If I desolder the STM32 and then power up the board to check whether the M0 DRV stays cold could something misbehave? Or would this be a safe test?

Check the schematic, but I believe all the important interfaces (PWM gate drive signals, enable etc) have the appropriate pull up / pull down resistors, so they won’t be floating. It should be a safe test.
Probably, the current drawn by the blown up STM32 (causing it to get hot) is also causing the buck converter to get hot, but the DRV chip should be robust against that situation.

Ideally, get the ones with a ridge that prevents the metal screw from fouling against the inside of the hole, where it could contact one or more copper layers. Plain nylon flat washers aren’t enough.

1 Like

After speaking with Oskar, he also suggested putting maybe 3k ohm resistors in series with the STM input pins that you’re using, if you don’t want to go to full isolation

It’s not easy to isolate the USB, and from what I saw it looks like that was the only ground loop connection right? The only 100% safe way to avoid ground loops is to use a dedicated power supply for motor power, and use a separate power supply for logic power. Best case the PSU is isolated from mains earth (check with multimeter for no connection between V- and PE (mains protective earth)).

I use the included plastic standoffs. This shouldn’t be a problem.

I designed an isolation board. Will put it in production tomorrow :smiley: This should solve all of this.
I won’t use USB in the future. https://github.com/SG-O/Isolator

3 Likes

Ordered the PCBs and components. If you are interested in this you can get the design and manufacturing files from my GitHub https://github.com/SG-O/Isolator.
It is licensed under the MIT license, so no strings attached :smiley:

1 Like

Here is the circuit diagram of the setup that failed:

And here is what my current design looks like:

This requires that the Step Dir Pins can be moved to GPIO3 and GPIO4.

@Samuel added support for UART on GPIO 3/4 just a few days ago.

Note: The user-facing name is UART1 but will probably be renamed to UARTB
To use it you have to:

odrv0.config.enable_uart0 = False
odrv0.config.gpio1_mode = GPIO_MODE_DIGITAL
odrv0.config.gpio2_mode = GPIO_MODE_DIGITAL
odrv0.config.enable_uart1 = True
odrv0.config.gpio3_mode = GPIO_MODE_UART1
odrv0.config.gpio4_mode = GPIO_MODE_UART1
odrv0.reboot()
1 Like

Thanks for the information! That is awesome! :grinning:

Now everything seems to work! Thank you very much!

Here is the almost finished controller board:


The electrical isolation seems to do the trick. Communication over UART1 works and I am controlling M0 with Step/Dir. M1 is still untested but this shouldn’t cause any issues. Once everything is done, I’ll share it in a new thread!

I have a few of the isolator boards (unpopulated) left. I’m willing to send them to anyone interested for the manufacturing cost of the board + shipping. If you want one (I hope this is fine with the Owner :D) write me a message.

Again thank you very much for all of your help!

Wow, that capacitor bank… :exploding_head:
Do you know if that is necessary? If so, how did you decide how much capacitance to add? Or was it a case of “as much as would fit” :joy:

It was a case of how much fits in 100 x 100mm with the caps being as cheap as possible while not using crap caps. The total capacitance is 47mF 50V. The total cost for it is 15$

Fair enough. Were you getting “DC Bus undervoltage” errors before? Or did you add this just because “you can never have too much DC Bus capacitance”?
Just fyi, there is such a thing as “too much capacitance” on a SMPS output. They can trip out on overload on start-up, and they can become unstable, especially with a low-ESR capacitor bank.
That said, it’s probably fine if it worked once already.

Also, you are sort of “asking for trouble” if you ever get another short-circuit. Normally, if there is a short on the DC Bus, a power supply like yours would either trip off or go into current limit. Whereas that capacitor bank will store 50 Joules, more than enough to blow a large hole in any PCB. :stuck_out_tongue: