In a project using an Atmega328, I am controlling two electric motors, two relays and a glow plug (RC model engine glow plug).
Attached you can find the circuit controlling the glow plug.
The circuit is being powered by a 2S LiPo battery (7.4 - 8.4 V). The controller part with the Atmega receives it's power from a 5V regulator (7805 or 2940).
Under these conditions the PWM value to drive the glow plug is about 15 (out of 255).
The main problem is, whenever I activate the glow plug PWM, the microcontroller resets itself.
I think this is due to decreasing input voltage of the 5V regulator.
What I have tried;
- BOD levels OFF, 1.8V, 2.7 V, 3.6(?) V --> didn't change anything
- Different values for the series resistor to the MOSFET gate. 75 ohms, 470 ohms, 1 k, 2.2k, and these with or without the 47k resistors to ground. If I use a 2.2k resistor, there is no problem. The circuit works as expected. But the MOSFET gets too hot. In this case the required PWM value to drive the glow plug is also higher. This leads me to think that the higher resistor value does not allow the MOSFET to conduct fully. This in turn prevents sudden drop in the supply voltage but this also leads to a higher voltage drop at the MOSFET heating it up.
- Different MOSFETs. Logic level MOSFET IRL540N and regular MOSFET IRFZ44. IRFZ44 works better and cooler than the "logic level" counterpart.
- Starting with a PWM value of 1 and increasing it up to 15 in 500 millisecond periods. That means it takes about 7 seconds for the PWM signal to reach it's maximum value. Most of the time the microcontroller hangs or resets during this part of the code.
- If I do not connect the glow plug there is no reset or hang up. This finding strongly suggests that this is a power supply issue.
I have added a capacitor of 100 uF before the 5V regulator, a 100 uF capacitor after the 5V regulator, a 10 uF capacitor just at the VCC pin of the Atmega and a 10 uF capacitor just at the AVCC pin of the Atmega. I have used a fully charged 2S LiPo of 3500 mAh. The nominal current of a glow plug is about 3 - 4 Amps and I don't think that this current can collapse the voltage of a fully charged LiPo battery.
I am planning to run a last test. I will use a separate LiPo for the logic part of the circuit.
In the menatime I am open to any suggestions...
BTW there is a similar problem when I try to control the two motors using PWM but there are no problems with the relays (all of them have a similar MOSFET drive setup):
PS: I have done my best to describe the problem clearly but please feel free to ask if there are obscure points.
Attached you can find the circuit controlling the glow plug.
The circuit is being powered by a 2S LiPo battery (7.4 - 8.4 V). The controller part with the Atmega receives it's power from a 5V regulator (7805 or 2940).
Under these conditions the PWM value to drive the glow plug is about 15 (out of 255).
The main problem is, whenever I activate the glow plug PWM, the microcontroller resets itself.
I think this is due to decreasing input voltage of the 5V regulator.
What I have tried;
- BOD levels OFF, 1.8V, 2.7 V, 3.6(?) V --> didn't change anything
- Different values for the series resistor to the MOSFET gate. 75 ohms, 470 ohms, 1 k, 2.2k, and these with or without the 47k resistors to ground. If I use a 2.2k resistor, there is no problem. The circuit works as expected. But the MOSFET gets too hot. In this case the required PWM value to drive the glow plug is also higher. This leads me to think that the higher resistor value does not allow the MOSFET to conduct fully. This in turn prevents sudden drop in the supply voltage but this also leads to a higher voltage drop at the MOSFET heating it up.
- Different MOSFETs. Logic level MOSFET IRL540N and regular MOSFET IRFZ44. IRFZ44 works better and cooler than the "logic level" counterpart.
- Starting with a PWM value of 1 and increasing it up to 15 in 500 millisecond periods. That means it takes about 7 seconds for the PWM signal to reach it's maximum value. Most of the time the microcontroller hangs or resets during this part of the code.
- If I do not connect the glow plug there is no reset or hang up. This finding strongly suggests that this is a power supply issue.
I have added a capacitor of 100 uF before the 5V regulator, a 100 uF capacitor after the 5V regulator, a 10 uF capacitor just at the VCC pin of the Atmega and a 10 uF capacitor just at the AVCC pin of the Atmega. I have used a fully charged 2S LiPo of 3500 mAh. The nominal current of a glow plug is about 3 - 4 Amps and I don't think that this current can collapse the voltage of a fully charged LiPo battery.
I am planning to run a last test. I will use a separate LiPo for the logic part of the circuit.
In the menatime I am open to any suggestions...
BTW there is a similar problem when I try to control the two motors using PWM but there are no problems with the relays (all of them have a similar MOSFET drive setup):
PS: I have done my best to describe the problem clearly but please feel free to ask if there are obscure points.
Attachments
-
43.6 KB Views: 39