Guest Guest_steve cheung Posted November 15, 2004 Report Posted November 15, 2004 Dear All, We have a project that need to count the pulse of the Flasher Lamp at QC production line. For example the pulse measure: ON is about 0.378 second. The pulse OFF is about 0.745 second. The Pulse voltage is 0 - 10VDC. I was choose the FX2N PLC using timer T246 1 ms timer to measure the pulse. It work, but seem it not precision. The measure pulse always more or sometime less. It's make us confuse, is it because of the Scan time or not, but the program is only 100 address more. For example the machine show 0.377s, but our FX2N measure 0.379s or sometime 0.376s, always change, not stable. (The existing machine have it PC base system that show the pulse count. Our FX2N is additional system is compare to measure the existing PC base system.) Anyone know how to solve this problem? Thank you & I waiting for you reply early. Thanks & best regards Steve e-mail: stev@cbn.net.id Quote
panic mode Posted November 15, 2004 Report Posted November 15, 2004 You can always try to see what is achivable using interrupts but if you ask me I would try to use PLC output (or anything else, maybe quartz oscillator) to generate clock signal that is fast enough (1.0kHz for example) and then feed it to high speed PLC inputs through an AND gate (or maybe solid state relay if the transitions are fast enough) triggered by your 10V input signal. So if you get 0.378s long pulse, counter would get value 1000x0.378=378. If you use 50.0kHz, you would get value 50000x0.378=18900 pulses. You would have to scale it in your program (like multiply by two to get 37800) and this should be precise enough. If you get occasionally one count more or less you should be able to round it down to number of significant digits you require. The simple AND gate can be made using just one diode and resistor. If you invert input signal and repeat the same with another high speed input (FX plcs have up to 6 high speed inputs) you should be able to get the "off" part of the signal as well. Quote
Guest Guest_Steve Cheung Posted November 20, 2004 Report Posted November 20, 2004 Hi Panic mode, Thank you for your advice. But, would you please to explain more detail, I have not using the High speed counter before. I was check at site again yesterday. I check again the pulse using the machine ( I was paralell with the machine analog input 12bit 0-10VDC (PC104) to our Analog module FX2N-4AD. As I use the 0.1ms timr M8099 to measure the on off pulse. I was get the length of the pulse, its ok. But, the pulse measure is not stable, it changable, not like the display at the machine. Our measure On Off pulse is most likely with display data from the machine. The machine one is stable. The display is show: Turn On Rate: (example 50.4%) Turn On Time: (example 60 Cylce/Minute) Turn on Rate is: ((Pulse B-Pulse A )/ Pulse B ) x 100% Pulse A = on pulse Pulse B = periode of pulse Turn on Time is: 60 / Pulse B --------> Frequency As example measure in PLC: Pulse A=0.312s Pulse B=0.753s Result = (0.753-0.512) / 0.753 x 100% = 58.56% This result always change because plc measure pulse A & B is change, for example 0.312, 0.412. If this value is change, then we will get the Turn on rate different, example 57.4&, 58.5% etc. I donot know why the measure value is changeable, although what is show in display machine is stable. Is it because of the timer or hardware, or because the wrong ladder? For Hardware Fx2N-4AD is 12bit and also the PC104 is 12bit. For ladder we design using compare. If the analog input > the value, then I turn on the bit. I use PLS & PLF to mov the 0.1ms timer to data register. I just think to try the signal input to the High speed counter. But, I donot know shoud I wire it +10VDC & 0V to the X0 & X1? Need it to wire to input COM? What do you think for my case, what should I do? Thanking you in advance Best regards Steve Quote
panic mode Posted November 21, 2004 Report Posted November 21, 2004 steve, no wonder you have problems because of effects of scan time and analog conversion speed (analogs are tipically the slowest signals). 12-bit resolution affects how precisely you can measure signal which is not changing (or at least not changing fast) but conversion time affects how often you get the result of measurement. inputs using averaging are further slowed down... compare instruction in PLC program is too slow as well because it depends on scan time and overhead (communication etc.) both scan ime and conversion speed are in the order of few miliseconds. i hope picture below explains the idea (that's all it is - working solution will require some work). the whole idea is to use measurement system that is: 1. independant from scan time and 2. fast enough to get good precision (in the order of 0.1ms or better) this is why I recommend high speed counters. they are not only fast but run independant from PLC scan time. same applies for reference clock signal which can be generated like this: PLSV K1000 Y0 M8000 this is possible if your PLC has high speed transistor outputs (like FX2N-MT....). Faster clock should reduce effects of +/- 1 pulse so you can use PLSV K32000 Y0 M8000 and then in PLC program divide results by 32. Quote
Guest Guest_Steve Cheung Posted November 22, 2004 Report Posted November 22, 2004 Hi Panic mode, Thank you very much for your help. I was estimate that there is something wrong at the Analog input. But, I need more your explanation for the picture you attach. I dont know too clear regarding the connection Yo and X0 at your picture. Waiting for your reply. thank you. Best regards Steve Quote
Guest Guest_Steve Cheung Posted November 22, 2004 Report Posted November 22, 2004 Hi Panic mode, Here I am again. I just thought if possible to replace the FX2N-4AD (that its speed is 6ms) with FX2N-2AD (speed: 2.5ms) or FX2N-8AD (its speed 500us). Is it possible to got the more precision signal input? Our PLC FX2N-32MR input channel have only one "COM" for 16 input (Japanese standard). Its have also one "+24" at input channel. COM & +24 is supply by internal PLC 24VDC power supply. How to connect with High speed input to X0? Special thanks to the expert. Steve Quote
panic mode Posted November 22, 2004 Report Posted November 22, 2004 using faster cards can help reduce error but not solve problem because logic using it is still going to be scan dependant. FX2N-MR_ PLC has relay outputs which are not good for example above. Question: Do you have manuals such as: - JY992D88101 (FX Programming Manual II) - JY992D66301 (FX2N Hardware manual) You can download them here. Quote
panic mode Posted November 22, 2004 Report Posted November 22, 2004 As far as I know all FX PLCs have inputs that can work either with sink or source sensors (see terminal S/S). Terminals labeled 0V and 24V are from internal 24V power supply. We never use this.... Quote
Guest Guest_Steve Cheung Posted November 22, 2004 Report Posted November 22, 2004 Hi Panic mode, Yes, I have those manual. Please check page 5-2, there is a FX2N Japanese series that dont have s/s. Ah yes, I dont understand the picture you attach. Would you please to explain, especially the source that have solid state relay. How can analog voltage be convert to digital input? Please help. If our PLCcould only supply source 24VDC from inside PLC, can I used your the application you describe? I also check, FX2N have High speed counter FX2N-1HC, is it possible to use it? Thanks & best regards Steve Quote
panic mode Posted November 22, 2004 Report Posted November 22, 2004 Steve, This is already post #10 in this topic and I still have no idea what PLC do you have or which manual you refer to when mentioning chapter 5.2. If you are talking about JY992D66301-J (FX2N Hardware Manual) then chapter 5.2 is for AC inputs. I cannot come up with more detailed answers if I don't know details of the problem and if you posted more details, I'm sure more people would participate in the topic trying to help you. I would recommend to start with registering and stating your location (so we know what standards you might be familiar with, because relay presentation above is common in North America for example), experience (do you understand timing diagrams?) full part number of the PLC, spec of the signal source, schematic etc. My previous post was showing following: 1. how to generate reference clock signal using output Y0 (known frequency) 2. how to bring this signal to PLC input 3. how to use 10V signal to control which input gets pulses and when Since the signal from Y0 has known frequency, it is possible to tell duration of the input signal (the one you have currently connected to analog card) by simply counting pulses. More pulses detected by counter - 10V input signal was longer. Faster reference clock (more pulses per second) - better accuracy. Quote
Guest Guest_Steve Cheung Posted November 23, 2004 Report Posted November 23, 2004 Hi Panic mode, I used PLC FX2N-32MR. with FX2N-4AD. The plc standard is Japanese, so the input wiring have no s/s as UL standard. It has one COM, one +24 and 220VAC power source, and all the input start from X0, X1. I have print screen the FX2N Hardware manual but cannot attach here, would you tell me how to? Yes, I saw, the FX2N Hardware manual of yours is different with us (Japan and Europe series). As your last post, I dont understand how to apply to my application. I understand PLC wiring, timing diagram, but I donot know where the voltage input 0-10VDC come from, also what is the model of solid state model? I know it convert the voltage to output contact relay, but cannot find out the used in my application. Do you mean I must change the analog input signal to Digital input signal? If yes, would you please to inform me more detail about solid state relay and the model is? I never have this experience before. Sorry to trouble you. By the way, Can High speed counter Module FX2N-1HC be used for my application? Thanks & best regards Steve Quote
Guest Guest_steve cheung Posted November 23, 2004 Report Posted November 23, 2004 Hi Panic mode, I have register but forgot my password. I have reset it and got the email reply, but it not acknowledge my new password. Quote
panic mode Posted November 23, 2004 Report Posted November 23, 2004 to tell the truth i don't know. is sure sounds like it, but i don't have time to read more manuals. It is common practice to call distributor and ask them to setup demo etc. if they sell it, they should have some working knoweledge on it. Quote
Steve Cheung Posted November 28, 2004 Report Posted November 28, 2004 (edited) Edited November 29, 2004 by Steve Cheung Quote
Steve Cheung Posted November 29, 2004 Report Posted November 29, 2004 Hi Panic mode, Now I was understand a bit your picture describe. I have make a connection from ouput Y0 to input X0 using PLC FX2N-32MR (I have order the FX2n-32MT, but not ready yet). I try to seek Solid state relay with NO and NC contact, but can't found it. I have the one with only NO contact. But could you let me kinow any sample ladder logic to count the On pulse and Off pulse from X0 & X1? I can only count the Input X0 with 1ms timer interrupt, but cannot count the Off Pulse of X1. I have no idea to do it, can you show me some ladder sample as your picture describe? I have never used the High speed counter before, please help. Thanks & best regards Steve Quote
panic mode Posted November 30, 2004 Report Posted November 30, 2004 steve, it looks like this way over your head. i suggest to read everything one more time and - more carefully. also you have to do some research and study specs of components you are using. you might want to answer some of the questions above or ask more specific questions. you are asking for a complete or very detailed solution. sorry but this is something i'm not going to do - you have to do it yourself or pay someone to do it for you. we mentioned that if your plc part number starts with fx2n-mr it means that built in outputs are relay type. relays are mechanical devices that utilize contact that phisicaly moves every time relay is turned on or off. it can do maybe some 5Hz at best (turn on and off 5 times per second - but not 30000 times!!!). if you intend to run one of them even this fast (some 5Hz), it's probably going to make a lots of noise and die maybe by the end of shift. you cannot expect mechanical device to turn on and off 30000 times per second, maybe transistor in the plc that controls this relay can do it so fast but relay is simply not going to move (it would stay on because the stream of pulses is too fast). now, there is another problem with relay outputs. they are more robust and forgiving than transistor outputs but they lack not only speed, they do not produce clean signal (do a research on "debouncing" and find out why is required and what is remedy). again, i mentioned solid state relay to explain concept of pulse counting as method that can solve problems with the scan time (counting with HSC is asynchronous) or resolution - but i never wrote that i would use solid state relay myself in this application or that this would be prefered technology for this little task. the intention of reply was to give you something to think about so you can do it yourself. here is something more to think about (remember, it's just idea...) first drawing shows basic idea (this time it uses gates instead of SSRs). since your plc doesn't have high speed output to generate clock, there is simple drawing that shows own little oscillator using schmidt nand gates. to get better prcission, you can of course use xtall (32.768kHz is very common for example). if you use logic gates, think about interfacing, operating voltage etc. (4000B series should work with higher voltages but not with 24V). third one shows something very similar to forst drawing but it uses optocouplers instead of solid state relays. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.