Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Controller reset

Status
Not open for further replies.
I know it is a common question but still we cannot get rid of it. We are using stm8s003f3 in our project. An ac motor is switched ON and OFF by a 12V relay (using timer).


The controller frequently resets itself when a relay is tripped ON or OFF. We used pf on the controller pin, pulled up the NRST pin with a 10K and a pf, used 7805 instead of lm1117, and tried a few other things, but couldn't succeed.


It would be a great relief for us if anybody can provide solution for it.


THANK YOU.
 
While there are many possibilities to explain the problem, the first thing that comes to mind is the fact that an AC motor has a large surge current intake on start-up and this surge current will force a brief drop in line voltage due to the fact that your source resistance on the line is not zero. If you are powering your controller from the same AC line as the motor, then the controller will suffer a brief power dip which is likely to reset it. This problem may be dealt with by using separate line voltage sources, which may be impractical, or by adding additional filtering to the controller DC power supply prior to the voltage regulator (mainly additional capacitors on the DC after the power supply rectifiers). It may take a fairly large capacitance to resolve this.

Perhaps you can test this theory by briefly powering the controller from a battery instead of from the AC line.
 
The fact that it works fine off a battery and not your power supply implies that maybe the esr of your supply is too high, so you are seeing brown-out resets during periods of high current demand. You mention a decoupling capacitor and the schematic shows what looks like "p7" from pin 9 to ground, but no value is shown.

You may want to consider a larger capacitor (at least 0.1 uF ceramic ). Some devices that are sensitive to such glitches use a decade series of capacitor values in parallel, such as 10uF,1 uF and 0.1 uF or 1 uF, 0.1 uF and 0.01 uF. I have even seen low pass filters (i.e., RC) implemented at the MCU supply pin to smooth noisy supplies.

What value is "p7"? What value(s) did you try with no improvement?

John
 
Try a larger cap than 104 (0.1 uF?). Just for testing to localize the problem, try adding a 10 uF.

John
 
The surge current into a motor is dependent on a lot of things, but it usually lasts a fair bit of time (on the order of tens to hundreds of milliseconds). I think that a 104 cap is still woefully small to be an effective filter. I would consider upwards of 100uF or more as an experiment.
 
I really appreciate the help from all of you, but the capacitors 10,100,1000 nf also didn't work.
One more thing is that, we were using PIC controllers for the same project (single sided) earlier and there was no issue.
Now we have switched over to ST and double sided PCB, so I was wondering whether the PCB design can cause such problem (i.e. ground plane being too near or far from other layers).
 
When I suggested a large value capacitor, I did not mean at P7. The data sheet is clear that P7 should not exceed 3300 nF. My reference to a large capacitor was to put it on the rectifier output across C1.

I find your schematic is not drawn very well and is hard to follow. Does the primary power for the controller enter at TR1 and TR2 (13VAC)? What is I2? It looks like it might be a 5V linear voltage regulator.

As for the pcb design, the first question I must ask is how the connections are made from J5 to the relay RL. The motor power contacts should be very well isolated from every other conductor on your control board. By well isolated I mean with no metallic contact to your board conductors or planes, no overlap to your board planes, and at least 5 mm clearance (preferably a lot more clearance) to other traces and planes. If it were me, I would not bring the motor power onto this board at all, I would use an off-board relay to guarantee good isolation.

A 1HP ac motor, depending on what mechanical load it has, can require more than 5 kW of momentary power to start. I would use a very substantial (ie. large) relay to switch such a motor on and off.

If the current drain of the uP alone (and its I/O) is small you can put a small series resistance and large shunt capacitor in line with the 5V rail to the uP to act as an additional filter. If your total current consumption from the 5V regulator is small, such a filter is best placed on the input side of this regulator so that it's voltage drop has little effect.
 
Last edited:
When I suggested a large value capacitor, I did not mean at P7. The data sheet is clear that P7 should not exceed 3300 nF. My reference to a large capacitor was to put it on the rectifier output across C1.
Maybe I misread the schematic. It appeared to me that p7 was attached to pin9, which is VDD. Vcap, which is limited to 3300 nF, is pin8, and was also identified as c3.

upload_2017-7-28_12-19-12.png


John
 
You are correct, John. My mistake. I guess that illustrates how the schematic could be improved. I still would rather see a larger cap at C1 first, followed by an RC filter between C1 and the 5V regulator.
 
When I suggested a large value capacitor, I did not mean at P7. The data sheet is clear that P7 should not exceed 3300 nF. My reference to a large capacitor was to put it on the rectifier output across C1.

I find your schematic is not drawn very well and is hard to follow. Does the primary power for the controller enter at TR1 and TR2 (13VAC)? What is I2? It looks like it might be a 5V linear voltage regulator.

As for the pcb design, the first question I must ask is how the connections are made from J5 to the relay RL. The motor power contacts should be very well isolated from every other conductor on your control board. By well isolated I mean with no metallic contact to your board conductors or planes, no overlap to your board planes, and at least 5 mm clearance (preferably a lot more clearance) to other traces and planes. If it were me, I would not bring the motor power onto this board at all, I would use an off-board relay to guarantee good isolation.

A 1HP ac motor, depending on what mechanical load it has, can require more than 5 kW of momentary power to start. I would use a very substantial (ie. large) relay to switch such a motor on and off.

If the current drain of the uP alone (and its I/O) is small you can put a small series resistance and large shunt capacitor in line with the 5V rail to the uP to act as an additional filter. If your total current consumption from the 5V regulator is small, such a filter is best placed on the input side of this regulator so that it's voltage drop has little effect.


Yes. I2 is regulator IC.

Separate board for motor may not be possible for us, as we were running products successfully with PIC controller in the same board earlier.

The filtering you had suggested, couldn't help.
 
Also, I wanted to confirm that the problem is hardware related only or not. May there be something that we are missing in the software part? Although necessary precautions have been taken care of.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top