Slaney Posted October 11, 2019 Report Posted October 11, 2019 A colleague and I are in the process of putting together a test rig that is controlled by a Samba 7 (RA22 model). We have pretty much zero experience using PLCs, so we are putting things together in baby steps (and this might be the first of many posts). The first road block we have hit is getting the HSC to work. The rig has a motor on it that is separately controlled, but has a 0-100% pot on it and there are some people here that haven't met a knob yet that they didn't turn. We would like to have the PLC display the RPM to make the tests more repeatable. The motor has a max speed of ~1850 RPM and we currently have a feature on the coupling that we can target off of to give us 1 count/rev. The first question would be, is the HSC the best route and should we try to add more features to get the counts/rev higher? We have an inductive prox switch laying around (Pepperl Fuchs 3RG4021-0GA33-PF, 3wire, 24V, NPN, NC). We have the NPN jumper selected and have the black wire to I0, the blue to 0V and brown to common. Second question is, is that correct? The LED on the switch is lit and does go off when the tip is touched off of metal. Third question is, is a NC switch able to be used for this or do I need a NO switch? At the moment, I have the hardware configuration set for High Speed Input with a simple HSC and the second line is set for Frequency Measurement 1000msec. The MI for the counter appears to be counting when the switch is closed and stops when it is open. The MI for the frequency goes to a max of 190 when closed and 0 when open. Is there more that I need to do to get the real frequency or is this due to the NC switch? I also tried following the HSC to Freq example in the Help, but that didn't seem to work either. Any help would be much appreciated
MVP 2023 Joe Tauser Posted October 13, 2019 MVP 2023 Report Posted October 13, 2019 1850 RPM should give you a frequency of about 31 Hz. If you're getting a frequency of 190 then you're getting more than one pulse per rev. That prox has a frequency response of 900 Hz, so it's very possible that when you're running the prox is triggering a couple of times and you can't see it without a scope. The thing to consider is resolution. The PLC can't do fractional frequency, so you'll have to multiply the frequency by 60 to get RPM. Which means your RPM display will jump by counts of 60. This may or not be OK. If your setup is repeatable and you always get 190 Hz at full speed, then you can take advantage of that and multiply your frequency by 9.73 to get RPM, which will give you about 10 RPM resolution. A better way may be to run the 0-10V pot signal into an analog input and read that instead (assuming the pot is separate device and not built into a drive). Then you have 16384 counts to play with and will be able to display RPM much more precisely. Let us know how your motor is controlled. Joe T.
MVP 2023 Ausman Posted October 13, 2019 MVP 2023 Report Posted October 13, 2019 On 10/11/2019 at 10:52 PM, Slaney said: The MI for the frequency goes to a max of 190 when closed and 0 when open. If it is counting when the sensor is NOT changing state, which from your description sounds to me like it is doing, there is an error in your ladder work/physical config somewhere. Should only count on each change of state. cheers, Aus
MVP 2023 Ausman Posted October 13, 2019 MVP 2023 Report Posted October 13, 2019 Further to my ask above, look up SI0, scan time, when online. You will likely find that it will indicate that the 190 can relate to the input being counted every scan. ie scan time might be 5ms, say. On 5ms that's 200 scans/sec, but SI0 rounds things a bit, so you can see my point re 190. cheers, Aus
Slaney Posted October 14, 2019 Author Report Posted October 14, 2019 Gentlemen, thank you for the responses. Ausman does have the situation correct. I am getting counts and the 190Hz frequency unless the sensor is close enough to a target to open. I get some lower, but incorrect frequency when the motor is running. I’m thinking the problem is that we are targeting a protrusion from the coupling with a normally closed sensor, so as I think Ausman is eluding to, there is always a signal except for the brief moment the protrusion passes. We probably need a normally open sensor or move the current sensor closer so it is open and target a negative feature. Does that sound reasonable, or am I not understanding? To answer Joe’s question, the 0-10V pot is part of a purchased control panel that I guess would be considered a driver. We did have to cut the 9 wire cord that connects to the motor to put in a through wall connector. I have no idea if it’s possible, but if it is, I imagine we could isolate the correct wires to pull into an analog input. I’m a materials engineer (or metallurgist) and my colleague is a welding engineer, so I’ll have to do some research on that.
MVP 2014 Simon Posted October 14, 2019 MVP 2014 Report Posted October 14, 2019 When using the high-speed input there is dedicated hardware to peform the pulse counting and frequency calculation. This is independent of scan time. The high-speed counter input is looking only for edges (or change of state) of the input signal. So does not matter if the one pulse per rev is the closed or open state. Just to re-state again, you are registering 190Hz with the sensor in the closed state. Following from the above point, this would suggest the sensor circuit has some noise on it that is being counted. I looked again at your first post, you say "black wire to I0, the blue to 0V and brown to common". I should stop there, brown wire is positive supply and should go to 24V. The fact that you see the LED switch seems to indicate the sensor is powered correctly, but it pays to double check. The other thing you can do is replace the sensor with a piece of wire - that is, put a piece of wire into I0. If you hold the free end onto the 0V terminal or leave it open circuit you should get 0Hz. If you rapidly touch it on and off 0V you should get something like 5-10Hz (do this safely of course, perhaps a mechanical switch could be used that you can flick on and off rapidly). Hope this helps,
MVP 2023 Ausman Posted October 14, 2019 MVP 2023 Report Posted October 14, 2019 What I am alluding to is that to my eye the count is being added to each scan, the addition being reset at 1000ms. So there is something else affecting the count initiation...like an additional element that is making the count increase by 1 each scan when the sensor is closed. cheers, Aus
MVP 2023 kratmel Posted October 14, 2019 MVP 2023 Report Posted October 14, 2019 Some sensors work as an antenna.If the frequency converter is turned on, they catch its signal and generate a false signal at the output.In this case, it is advisable to try to activate the sensor with the disconnected VFD.
BluudNobbut Posted October 14, 2019 Report Posted October 14, 2019 Try activating the sensor with disconnected VFD and this may help you.
Slaney Posted October 15, 2019 Author Report Posted October 15, 2019 Looks like I have some things to check and try. I'll let you know what I figure out.
Slaney Posted October 18, 2019 Author Report Posted October 18, 2019 It was a wiring issue as Simon suggested. It appears everything is working now. I am registering counts on a change of state. I also was able to get the HSC to Freq function to work, so I have frequency in 0.01Hz increments to convert to RPM. I don't have the motor available at the moment to test it on that, but I counted the number of times I manually activated the switch over 1 min. and the rpm reading was reasonably close. I'm sure that improves with more time and consistent pulses. Thanks everyone for the assistance. Now I just need temperature and air volume control on a hot air blower, to set up some cycles to open an close a solenoid for a spray nozzle, and a counter and I will be in business.
MVP 2023 Joe Tauser Posted October 19, 2019 MVP 2023 Report Posted October 19, 2019 11 hours ago, Slaney said: I also was able to get the HSC to Freq function to work OK, I must admit I didn't even know about the existence of that function and the frequency resolution it's capable of. Excellent detective work on your part. For everyone else, it's under Utils->Immediate->Frequency Measurement based on HSC. I'm going to hook an old school analog function generator to a PLC and see how well it works at low frequencies. Well done. Joe T.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now