Microcontroller crash - due to spike?

Thread Starter

rscgln

Joined Sep 14, 2018
11
Hello, I have an ESP-12E micro-controller that is employed to move up an down a shutter. Trough 2 pins, I control 2 MOC3083 and they drive two BTA12-600B triacs to handle the two directions. This works fine but I have a problem: in the self contained 230V AC - 200W motor, there are embedded limit switches to stop the motor when the shutter is supposed to have reached either end.

My software is timed, but to reset from an unknown position, I move the shutter up for an excess time. In other words, when I don't know the position, to reset my timed position tracker, I give power for many extra seconds to be sure the shutter is stopped by the limit switch(es). I noticed that most of the times, when the switch opens, the micro crashes.

I reproduced the exact same problem with a 220V 50W light bulb and a manual switch: should I "software" turn on the light, as soon as I open the switch, most of the times, the micro crashes. If it doesn't crash, it may crash when I close the switch or at the next opening, but it crashes anyway very soon. In contrast, whenever I give-remove power through the triac, nothing bad happens. While I cannot see any feedback in the circuit, I can only suppose the switches generate a sort of spike in the supply. I think I have enough capacitors in the supply circuit (1000uF + 0.1uF close to the ESP).

Any better idea?
Any suggestions to avoid this problem?
Follows a reduced schematic of the circuit. Please note I cannot place anything in parallel with the embedded switches, while I could place any kind of "filter" in parallel to the supply.
 

Robin Mitchell

Joined Oct 25, 2009
819
Firstly, that optoisolator should have a resistor in series with the microcontroller to limit the current to the internal LED
Those switch spikes could be potentially avoided with the use of a capacitor and inductor near the motor but my guess is that the sudden switch off is causing a back EMF in the motor which could be fed into the 3.3V supply via its 230V input.
 

Thread Starter

rscgln

Joined Sep 14, 2018
11
Thanks! I will put the resistors in series to the photo-couplers (my bad mistake!). Can you please suggest the values/part number for the indicated chokes, capacitor and inductor? Sorry but my background is on digital but I have non experience at all on this kind of problems. Thanks.
 

LesJones

Joined Jan 8, 2017
2,731
You could try putting a contact suppressor such as this across the limit switch contacts. Another suggestion is to wire the limit switch in series with the 360 ohm resistor that drives the triac gate. That way the power will be removed from the motor at the next zero crossing rather some random point on the mains waveform.

Les.
 

ericgibbs

Joined Jan 29, 2010
11,178
As I understand the TS's description the limit switch is not accesses-able, its embedded in the motor body.
So its not possible to directly connect across its contacts.
 

LesJones

Joined Jan 8, 2017
2,731
Hi Eric,
I will have to start to read posts more carefully. Another possiblility is to add his own limit switches that opperate before the ones inside the motor or to try putting the contact suppressor (Or a varistor.) directly across the power leads to the motor as close as possible to the motor.

Les.
 

ericgibbs

Joined Jan 29, 2010
11,178
hi Les,
I did consider a Varistor across the motor input leads, but there is no varistor conduction path when the contacts are open.
The additional uSwitch seems an interesting option.
E
 

Thread Starter

rscgln

Joined Sep 14, 2018
11
As I understand the TS's description the limit switch is not accesses-able, its embedded in the motor body.
So its not possible to directly connect across its contacts.
Hi Eric,
I will have to start to read posts more carefully. Another possiblility is to add his own limit switches that opperate before the ones inside the motor or to try putting the contact suppressor (Or a varistor.) directly across the power leads to the motor as close as possible to the motor.

Les.
Let me explain how most the the shutter motors work! They have 3 wires: one is common and say we connect it to neutral. Than you must connect one (an just one!) wire to the phase to cause motor to turn one way and connect the other one to phase to torn the other way.

Never connect both to phase if you don't want to burn the motor. That said, during installation, you have to turn two endless screws to turn some internal gear that moves the cam that actuate the two limit switches. In this way, you set where the motor has to autonomously stop in the upper and lower positions. They are built to be connected to a double momentary switch and the user can raise and lower the shutter pressing one of them. Should the user insist pressing a button once reach one end, the shutter remains still and nothing bad happens.
So it is not possible to place anything in parallel to the embedded switches while the "thing" is self-contained and sealed. In addition, it is not practically possible to "add" extra switches because, those, should have to be placed on top and bottom of the window, with long wires (running where), waterproof, etc.

So, I think the best idea is to experiment the choke (or the L-C circuit) suggested in the two initial answers. I am just looking for a suggestion for the values!
 

Thread Starter

rscgln

Joined Sep 14, 2018
11
As for the initial suggestion, I found a choke of unknown value on an old board, I inserted it in the power lines to the shutter motor and the problem totally disappeared. This is fine and I thank for the suggestion.
Just to exactly understand, may it be better to insert the choke in the power line to the microcontroller? In this case, I guess it would filter out even EMI coming from other sources. Or am I totally wrong? Thanks!
 

MaxHeadRoom

Joined Jul 18, 2013
21,649
They have 3 wires: one is common and say we connect it to neutral. Than you must connect one (an just one!) wire to the phase to cause motor to turn one way and connect the other one to phase to torn the other way.
Sounds as though it is a PSC (permanent start cap) motor.
Incidentally you do have the frame of the motor earth grounded I assume?
Max.
 

Thread Starter

rscgln

Joined Sep 14, 2018
11
Sounds as though it is a PSC (permanent start cap) motor.
Incidentally you do have the frame of the motor earth grounded I assume?
Max.
Well, actually it has FOUR wires: common, up, down and ground. I didn't listed ground before because I thought it was meaningless in the discussion. And yes, even if there is no schematic at all, I cannot figure how can an AC brush motor reverse with only 3 power wires, so it should be a sort of three-phase with cap.
 

MaxHeadRoom

Joined Jul 18, 2013
21,649
and ground. I didn't listed ground before because I thought it was meaningless in the discussion. .
Not really, when discussing noise and suppression.
Does the motor in fact have brushes? As it sounds more like a PSC, a Universal brushed motor has very poor speed regulation.
Also requires four connections to reverse.
Max.
 

Thread Starter

rscgln

Joined Sep 14, 2018
11
Not really, when discussing noise and suppression.
Of course, sorry for the bad initial input.

Does the motor in fact have brushes?
I don't know. It is impossible to disassemble the enclosure without rendering it unusable. As far as I understand a brushed motor needs even more wires to revert the brush-stator connections in order to reverse speed. It is something like this:

60501_rscgln-s.jpg

https://cdn-reichelt.de/bilder/web/xxl_ws/R800/60501.png


Mods Note:
Please upload the photo to our forum otherwise when the photo lose the connection then the post will be lose the meaning, the photo had been uploaded to the forum and compressed to an appropriate size from 313498 Bytes to 114938 Bytes.
 

MaxHeadRoom

Joined Jul 18, 2013
21,649
For a precise final rpm of 15rpm I would expect a induction motor at least.
Unless there is some kind of semi-sophisticated control internally.
Max.
 
Top