STM32 CANBus stops functioning when PWM driver powers more then 3A - Page 1
Forum section: electronics / general

author: Hellbender
author_rank: Newbie
timestamp: August 17, 2016, 05:01:20 pm
content: Hello All,my first question ever posted here is about a problem I am having with 2 PCBs at my work. I designed 2 PCBs. One is a controller-board with an STM32F072 controller and one MCP2551 CAN controller. The CAN controller is connected to an USBTin with about 30cm of wire ( standard 26AWG ). The STM32 drives 8 PWM signals going off to the next PCB. they are connected by a 28-lead PFC cable.The second board holds 4 dual integrated mosfets vnd7140ajtr-e. These are fed with 24V and drive a different parts of a heater. Each part of the heater requires 3.5A at room temperature.The power of the controller board comes from a power supply which delivers 5V ( about 180mA is used by the whole controller board ). It is on the same connector as the CANBus. The 24V is delivered from a seperate power supply which can deliver up to 20A close to the mosfets. Both power supplies are ground coupled at the power supplies.Ok thank you for reading this far. This is the setup i am using. Keep in mind that the ground between the two boards are 4-leads on the PFC connection.When i send a CAN command to start powering one of the eight mosfets, all goes well. I can send the command to turn off the mosfet ( pwm duty cycle 100% by the way ) and i can send a command to turn on all the mosfets.When i turn on 4 off the mosfets 10A is used, after that the CANBus doesn't respond to anything anymore. I can send any command I want but no reaction from the processor. The PWM still works as it should.Now when i take the 24V power supply and turn de current down to about 3A the CAN bus on the controller bus is reacting again and I can turn off all the mosfets again. But when I turn up the current again the CAN receiver stops responding again.I have not yet looked at the processor if it still is running or if the CANbus is still pulsing.But what I can't figure out if this is just electromagnetic messing the bus up or do I need to look at something coming over the gnd line which messes up the signal integrity.If anybody has any hints or tips they would me much appriciated.With kind regards,MichelP.S. if something is unclear ( and i can't image it isn't ) please howler.

author: Kilrah
author_rank: Unknown
timestamp: August 17, 2016, 07:05:57 pm
content: I would think a ground problem (causing excessive common mode voltage difference on the CAN lines) is most likely likely, but an accurate schematic of the whole setup and the results of checking if there's actually still an attempt at getting things across would help.If your grounds are connected at the power supply side then the voltage drop in the power-carrying ground lines will cause trouble. The ground lines your signal is referenced to should not carry current.

author: Hellbender
author_rank: Newbie
timestamp: August 17, 2016, 08:08:44 pm
content: Thank you Kilrah,i was also thinking about this, but an extra idea would help. When i get back to work tomorrow I will start measuring the ground and signal levels. I will check if I can get the currents to flow to there own groundpoint and not all over the board. Let's hope this will make the difference. If not I will post more details and schematic/pcb layout tomorrow. I will also add an extra ground lead at the end of the powerleads to make sure there is no excessive current running in the ground lead to compensate for voltage drop in the lead wires. In the endproduct one power supply with common ground will be used.With regards,Michel

author: Hellbender
author_rank: Newbie
timestamp: August 18, 2016, 09:11:33 pm
content: I have been doing some research and measurements today. The first thing I did was remove the high current return path from the groundplane and wired them directly to the 24V power terminal on the PCB. This should keep the current from flowing through to the control-pcb. To no avail.Next i did some measurements and it seemed that the following happens. The input voltage is 5v, which drops about 0.4v over the polyfuse. The digital curcuit draws about 180mA and has its return over a 26AWG wire of about 40cm long.It seems that when the current flows through the power PCB it raises the ground potential by about 0.5v on the controller plain. This is no problem for the digital logic, which runs on a 3.3v regulated from the 5v by an LDO, but the CAN drivers run of the 5v and have a cut out voltage of about 4.3v.As you guessed, the voltage drops below the 4.3v and the can drivers stop functioning.I have been playing around with the ground leads on the power supply, as you mentioned this could get me into trouble. When i do a current measurement between the two ground leads at the end of the leads, there runs about 2.5A of current ( all testleads are 2,5mm² or 4mm² ) so this really surprises me. When i disconnect the coupling groundlead from the power supply and reconnect it at the end of the testleads the voltage drop disappeares and all works as expected.In the original device, the 24V is the main power supply and a 5V is created using a buck convertor.The situation inside the device will be the following :24V PSU -> 1,5m wire 8x22AWG ( 4x 24V + 2x GND ) -> buck convertor -> 1,5m wire 8x 26AWG ( containing 2x 5V and 2x GND along with the CANbus ) -> Controller PCB -> flatflex cable of 20cm -> Power PCB <- 24V PSUAs all can see there is a ground loop over there, because to be able to control the mosfets and read the current back the 24v and 5v grounds meet at the flatflex cable. One thing in the test that also improved the situation was when i connected the testlead of the 5v directly to the pcb, effectively bypassing the 26AWG wire. Which to me means that there is to much impedance in the ground returnpath of the 5v circuit.I will attach images of the two circuits and the two PCB's. Feel free to laugh but please point out the most obvious errors, since I have no real clues about designing high power electronics. All other faults are also welcome as i am open to learn all i can.With regards,MichelP.S. All the capacitors on the power pcb have been removed due to "current limiting" issues of the mosfet drivers. ( datasheet says that they limit the current, reality says the chip disables itself )