0
\$\begingroup\$

I will use the configuration below to build a zero crossing detector to connect to a PLC.

I will change the output voltage to 24VDC and the correspondig resistor to 50K.

The problem is that the input port in the PLC contains a PC817 optoisolator and I am not sure if the optoisolator will repeat the input signal.

Have you ever done this configuration connecting the output signal to an optoisolator? Will it work? If I put a LED as test light will it flash? How many optoisolators can be concatenated?

ZERO CROSSING DETECTOR

\$\endgroup\$

3 Answers 3

1
\$\begingroup\$

enter image description here

Figure 1. Here is how you would wire it for a PNP input but it probably isn't going to be much good. For NPN connect the top terminal to the input and the bottom terminal to ground.

It's not clear what you are trying to do but most PLCs have a scan time in the order of 2 to 20 ms. 50 Hz mains has a zero-cross every 10 ms and 60 Hz every 8.33 ms. As a result your PLC probably won't detect the zero-cross unless you are using a high-speed or interrupt input.

\$\endgroup\$
4
  • \$\begingroup\$ And also, the spikes here are very short - even a 1ms scan time may not be enough. \$\endgroup\$ Jan 16, 2021 at 1:10
  • \$\begingroup\$ i am using that PLC BOARD to control motor speed, is based on STC12C5A602 MCU, the only problem with those PLC BOARDS are hard to write the program: more-suns.com/product/html/?321.html \$\endgroup\$ Jan 17, 2021 at 20:13
  • \$\begingroup\$ You've linked to an ad page rather than the datasheet which I can't find. Am I right in thinking that it's a Mitsubishi FX PLC emulator? What are you making that you want zero-cross detection? That would be considered very unusual in PLC applicaions. \$\endgroup\$
    – Transistor
    Jan 17, 2021 at 20:48
  • \$\begingroup\$ those PLC boards use an STC12C5A60S2 MCU, its datasheet can be download from here: stcmicro.com/sjsc.html \$\endgroup\$ Jan 18, 2021 at 11:22
1
\$\begingroup\$

The pulse width (those spikey things in the diagram) will be of the order of 300usec if I did the trig correctly (assuming a typical CTR of 50%-- minimum is 20%-- and LED Vf of ~1.2V).

\$p_{wid}\$ \$\approx\$ \$2\sin^{-1}({1.5/24})\cdot (1/\omega)\$ where \$\omega\$ = \$2\pi\cdot f\$

If your PLC can respond to a pulse of (say) 100usec, say with an interrupt or a counter input, it should work. A normal PLC scanned input won't reliably pick anything up.

\$\endgroup\$
1
  • \$\begingroup\$ great, i will check those number first \$\endgroup\$ Jan 17, 2021 at 20:03
0
\$\begingroup\$

I'm not sure what this complication is for. All you need is literally a diode (1N4007) in series from one end of the winding to the PLC input - forward polarized for NPN inputs (active high), reverse polarized for PNP inputs (active low), and connect the other side of the winding to PLC's ground. That's all. I assume that the 24VAC winding is dedicated to the detection function.

If the winding is used to power the PLC using a full bridge, then you only need to connect one end of the winding via a diode to the PLC's input, polarized as above. The other end is already connected to the PLC's common (0V) bus via the rectifier bridge.

If the winding is not used to power the PLC, but is used for something else, then you'll need another small line-to-24VAC transformer - it can be as small as you can get it, and make sure it's either a class 2 transformer (inherently impedance protected from overloads), or that you fuse the primary appropriately. Of course you can also use a small 1:1 isolation transformer designed for line frequency operation (50/60Hz); most small audio transformers will not be suitable since their low passband's 3dB cut-off point is well above line frequency and they'll attenuate the signal too much.

The circuit you present generates a train of narrow pulses, and those are quite hard to detect with typical multi-millisecond PLC cycle times - even 1ms is not enough to reliably catch those. So instead of pulses you want a simple square wave input at line frequency, and that's what the diode provides. Simple and efficient :)

\$\endgroup\$
1
  • \$\begingroup\$ i have aleady tried that, but looks like the time the signal is "on" take all pulse time and PLC stays in the same state, that is why a pulse signal is a better option. PLC uses a oscilator cristal with 11035MHz, enougth to process 60Hz signals \$\endgroup\$ Jan 17, 2021 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.