Arduino keeps resetting if pwm is enable

jpanhalt

Joined Jan 18, 2008
11,087
Maybe the 200 ns you have to protect from shoot-though is not enough? This certainly looks like both sides are on at the same time:
1576041489468.png
 

pmd34

Joined Feb 22, 2014
527
Hi Japanhalt, I think you have got the dead time in the wrong part! Your pulse train should look like this:

Pulse train.jpg

The FETs are on when the pulse is high, so you should never have 2 signals high at the same time.
 

jpanhalt

Joined Jan 18, 2008
11,087
Hi Japanhalt, I think you have got the dead time in the wrong part! Your pulse train should look like this:

View attachment 194285

The FETs are on when the pulse is high, so you should never have 2 signals high at the same time.
1) The image I posted was the pulse train from the TS's observation, not"mine."
2) It shows both on the same time. I am assuming the signals are gate voltages, but the TS didn't specify.
3) Can you be a little more detailed in what you think was wrong with my interpretation?
 

pmd34

Joined Feb 22, 2014
527
Hi Jpanhalt. The dead time is the time Between the switching OFF one fet and switching ON of the other. As they are N-Mosfets, Off is Low.. On is High

So you should have.. FET1 on... FET1 off...(deadtime).. FET2 on... FET 2 off......(deadtime).. FET 1 on... etc...

You appear to have FET1 on ... FET 2 on.....(deadtime).. FET 1 off... FET 1 on FET 2 on....(deadtime)..

With your current arangement your deadtime is actually the time when both FETS are switched on shorting you supply... so in this case no "dead time" is better!

You MUST not have both fets on at the same time.. if you do then you are shorting out your input power-supply.

Deadtime is inserted, as even though you might switch FET1 off.. THEN FET2 on, the fet will not switch off instantaneously, so to AVOID having both FETs on at the same time you wait a little while before switching FET2 on.
 

jpanhalt

Joined Jan 18, 2008
11,087
If these tracings are the gate voltages (or Ids):
1576066149674.png
then both mosfets are ON at the same time. That is why I posted the image.

How do you interpret that image?
 

jpanhalt

Joined Jan 18, 2008
11,087
Let me try to clarify what I posted in#25.

@Ðeejay Kital
1) You believe you have deadtime of about 200 ns, but your 'scope tracings do not show that to be the case (assuming they represent "on" times).
2) When you increased deadtime, it didn't fix the problem.

If you thought you had deadtime, and really didn't, how do you know that your attempt to increase it really did increase it? Did you put a scope and it and see the increase? Have you tried a really long dead time? At this point, I think you need to check your driver and show that it is actually doing what you think it is doing.
 

Thread Starter

Ðeejay Kital

Joined Mar 24, 2016
27
hi
i already adjusted the code. color blue is for lowside mosfet, yellow is for high side mosfet.
i adjusted the deadtime also as you can see from the image. but still getting reset after power on.
IMG_003.png
 

jpanhalt

Joined Jan 18, 2008
11,087
What probes are you using and how connected? The top mosfet gate should be measured relative to its source electrode. The bottom gate relative to its source too, which should be ground. If both are relative to ground, then no wonder it is not working.

When the top mosfet turns on, its source is at (supply voltage - IR drop across the mosfet's D-S). The IR drop should be very small.
 
Last edited:

jpanhalt

Joined Jan 18, 2008
11,087
So, are you saying the arduino doesn't reset as soon as you enable PWM? What did you do to fix that problem?

Garbage display on LCD (both GLCD and character) is often the result of problems with the power-on reset or settings for direction, etc. Is your interface serial or parallel? If serial, SPI, I2C, 1-wire (RE-232 type) or other?

As for inductor noise, do you mean electrical noise or something you can hear? Is it a commercial inductor or homemade?
 

JohnInTX

Joined Jun 26, 2012
4,787
I've been following the thread without much more to add to the good advice already given but a couple things that came to mind:
The nano's RESET line is pulled up but there is no filtering on it. If you're not using RESET in the circuit, consider just strapping it to Vdd as a temporary test and to eliminate noise into MCLR/ as a source of your problem.
Visit the brownout detector and make sure that you are not tripping it. Have you scoped the power lines to verify that they are stable?
Your heatsinks show that they are connected to ground. Stupid thought but you have isolated the MOSFET tabs from the heatsinks, yes?
Your LCD looks like it is using a backpack of some sort. That can introduce another source of problems. Who knows how well the backpack performs in a noisy environment?

Anyway, sorry to butt in. The guys helping you here know what they're about. Just thinking out loud.
 
Last edited:

Thread Starter

Ðeejay Kital

Joined Mar 24, 2016
27
the arduino reset for nano is already built in and i dont have to modify it. the mosfet is already isolated using thermal pads but not clear in the video. and also i just made the inductor myself. as my experience testing the circuit.
heres the situation i encountered. since i put delay about 2 seconds before entering the main loop. the inductor is so noisy before the main loop is executed. but when the coded starting to load dudty cycle to the timer. ther inductor noise is stop, but then the lcd has grabage display. but when i put scope on the pin of arduino. the pwm is working fine
 

pmd34

Joined Feb 22, 2014
527
What frequency are you using on your inductor, if you can hear it, it must be very low. Have you de-activated the divide by 8 fuse on the microcontroller?
 

Thread Starter

Ðeejay Kital

Joined Mar 24, 2016
27
What frequency are you using on your inductor, if you can hear it, it must be very low. Have you de-activated the divide by 8 fuse on the microcontroller?
i am using 50khz pwm. i dont understand about your " de-activated divide by 8 fuse on the microcontroller"..
 
Top