Pulse Train

Thank you so much Lancie. I tested it out and works perfectly!
You should realize that it is the same basic method that you said did not work 2 times before! The only difference was that I adjusted it for your specifc SLC 5/04's timer base 0.01 second availability. Normally it is your job to make that adjustment where you did not specify the SLC model up front.

Are you sure that your Output is O:1/18? Normally there are only 16 bits (0 to 15) in each word address, so bit 18 would be bit 3 of the next word, O:2/3.

I couldn't figure out why I was getting this error message: error: address must be specified to the word level! when typing in the output O:1/18 which is my actual solenoid output in I think the SQO or in the IOM instruction (not sure now).
The SQO instruction requires a WORD address for both the File and Desitiantion addresses, not Bit addresses as you are trying to use. For your Output O:1/15 bit, you must use the word address O:1.0. When in doubt, check the RSLogix 500 software Help file for your specific instruction. To use the SQO but only control 1 Output bit, you must use a Mask to mask out all bits except the one you want to be turned on/off by the SQO. To mask out all except bit O:1/15, use Mask 8000 hexadecimal (1000 0000 0000 0000 Binary).
SQO [Sequencer Output]
File is the address of the sequencer file. Make sure to use the file indicator (#). This file stores the reference data for monitoring inputs.
Mask is a hexadecimal code or the address of the mask word or file through which the instruction moves data. If the mask is a file, its length will be equal to the length of the sequencer file. The two files track automatically.
Destination is the address of the output word or file for a SQO to which the instruction moves data from its sequencer file.
 
Last edited:
You should realize that it is the same basic method that you said did not work 2 times before! The only difference was that I adjusted it for your specifc SLC 5/04's timer base 0.01 second availability. Normally it is your job to make that adjustment where you did not specify the SLC model up front.

Are you sure that your Output is O:1/18? Normally there are only 16 bits (0 to 15) in each word address, so bit 18 would be bit 3 of the next word, O:2/3.


The SQO instruction requires a WORD address for both the File and Desitiantion addresses, not Bit addresses as you are trying to use. For your Output O:1/15 bit, you must use the word address O:1.0. When in doubt, check the RSLogix 500 software Help file for your specific instruction. To use the SQO but only control 1 Output bit, you must use a Mask to mask out all bits except the one you want to be turned on/off by the SQO. To mask out all except bit O:1/15, use Mask 8000 hexadecimal (1000 0000 0000 0000 Binary).

It wasn't that they did not work, only that they were not giving me the waveform I was after. I'm positive about the output been 18. The plc output card I'm using has 32 transitor outputs and is inserted in slot 1. By the way, out of the 32 outputs, about 25 are relying on timers (TON's and TOF's) mostly to energize pneumatic valves. Is it ok to leave it like that (it's been working fine so far) or should I better replace the timers for one master timer and your GEQ and LES approach? I want the best timing accuracy possible from the plc...
 
Here is a solution using an STI to do the timing, which appears to be a critical element in this "application". I have favoured the counter approach over the SQO, as it is more easily understood, and infinitely easier to modify the pulse timings.

The timing is produced by counting 10mS intervals in an STI, so a Pause of 1.5 secs = a count of 150. The subsequent ON and OFF timing is calculated from stored values, allowing the system to be "tuned" to be most effective in displacing those coffee beans (granules?). Calculating the trigger points is done in the main code, to minimise the execution time of the STI itself.

I make no apologies for attempting to optimise this code for fastest execution, as it is a relatively fast STI I didn't want it to have too much impact on the scan time of the remainder of the code, hence the -(TND)- on the first rung of the STI code.

I could have used the "start pulsing" trigger bit to latch enable the STI Enable bit (S:2/1), so that STI's would not be generated at all unless needed. Completion of the output pulsing would then automatically turn off the STI Enable bit.

Using Timer(s) is always going to be subject to the scan time of the main code, and will always produce variable results, as has been observed by the OP. Using timers to pulse an output for 100mS, in an application with a reasonable scan time, would be impossible. Using the STI is the only way to guarantee those pulses are consistent.

EDIT : Sigh!! There is a mistake in the code I have posted, Rung 3 of the STI file should have an OTU of the output bit, not an OTL. I might get round to actually testing this code, but my training rig is being used with the ControlLogix chassis in it, and I have urgent work to do.
 
Last edited:
The plc output card I'm using has 32 transitor outputs and is inserted in slot 1.
Why were you keeping that a secret until the very end? Every piece of information is important to set up the program correctly. There are a million different PLC models and configurations, and if you want a good solution, the more you tell, the better it will be.

I assume then they your Output module is a 1746-OB32. If so, then for Output O:1/18, your SQO destination would be "O:1.1" (the 2nd word in O:1), and your Mask should mask out all except Bit 2, or 0004h (0000 0000 0000 0100 Binary).

I seriously doubt that the timing for a solenoid is all that critical. Spring-return solenoids do not have an accurate rate of return to home position in the first place, so using highly-accurate timers will not add much. If you allow plenty of time for the spring to retract after energization, then the ON pulse width will not be that critical. A solenoid being used as a vibrator will probably work better if it is NOT consistent, but instead has variation. My experience with vibrators for unsticking fertilizer in bins and chutes is that if the vibrator frequency starts out low and goes higher, more material will be shook loose. Stirring should work better if it creates chaos in the cup.
 
Last edited:
I seriously doubt that the timing for a solenoid is all that critical. Spring-return solenoids do not have an accurate rate of return to home position in the first place, so using highly-accurate timers will not add much.

If you allow plenty of time for the spring to retract after energization, then the ON pulse width will not be that critical.

I beg to differ... a single solenoid (and i agree there will be differences between solenoids) will have a large degree of consistency. If you don't have consistent output timing, then you won't get a consistent response by the solenoid. It sounds like you are placing the blame on the hardware, not the software. Please explain why a spring-return solenoid doesn't have a repeatable return rate... what other factors may slow it down or speed it up.

You're working this backwards... The ON pulse width is critical, the solenoid needs to fully extend before the voltage is removed to allow it to revert to its "home" position, otherwise it hasn't achieved full travel, and hasn't done it's job.
 
Hi Everyone,

I am a new user for this forum. I am very interest this forum and like very much a new information from this post.

Thanks
Mecton Training
 
...what other factors may slow it down or speed it up?
Variable friction changes the speed. In this case, the solenoid armature is vertical, so sometimes it will retract straight, other times at a slight angle due to the necessary gap between the bearings and the armature. If at a slight angle, the retraction time will be longer, and then the next pulse can not drive it as far or as hard because of the angle. Household door chime solenoids are a good example. As the mounting rings wear, eventually the armature is so loose in the bearings that it is leaning so much that the coil can no longer drive it hard enough to strike the chimes (due to the increased friction).

The ON pulse width is critical, the solenoid needs to fully extend before the voltage is removed to allow it to revert to its "home" position, otherwise it hasn't achieved full travel, and hasn't done it's job.
My experience with trials on various spring-return solenoids was that there is a minimum voltage and time needed to make the armature overcome the spring tension (depending on mounting direction). Above that, there is a wide range of ON times where the armature will travel faster and harder as the pulse width increases.

I think Carlisn tried longer pulses, first at 0.2 seconds, and found that that caused the armature to strike the cup too hard. Then there is an upper limit of ON time, where the speed and striking force will not increase, no matter how long the solenoid is left ON. Any ON time between the lower limit and upper limit will make the solenoid operate.
 
Last edited:
Dust, grease, and other foreign material on the solenoid armature can slow it down. Corrosion of the armature or the bearings can also cause it to slow.
 
Why were you keeping that a secret until the very end? Every piece of information is important to set up the program correctly. There are a million different PLC models and configurations, and if you want a good solution, the more you tell, the better it will be.

I assume then they your Output module is a 1746-OB32. If so, then for Output O:1/18, your SQO destination would be "O:1.1" (the 2nd word in O:1), and your Mask should mask out all except Bit 2, or 0004h (0000 0000 0000 0100 Binary).

I seriously doubt that the timing for a solenoid is all that critical. Spring-return solenoids do not have an accurate rate of return to home position in the first place, so using highly-accurate timers will not add much. If you allow plenty of time for the spring to retract after energization, then the ON pulse width will not be that critical. A solenoid being used as a vibrator will probably work better if it is NOT consistent, but instead has variation. My experience with vibrators for unsticking fertilizer in bins and chutes is that if the vibrator frequency starts out low and goes higher, more material will be shook loose. Stirring should work better if it creates chaos in the cup.


Correct, the card is a 1746-OB32. While I don't see differences (but I'm sure there are differences) between my old TON's and TOF's timing implementation to energize the solenoid, I like the GEQ and LES implementation because the ladder looks cleaner and less instructions are needed to do same function. I'm using a solenoid for the ability to act as a small actuator and vibrator at the same time. Right when the ground coffee is been dispensed into the cup, the solenoid lifts up the cup so it prevents the coffee from scattering around. Then, is used to softly hit the cup several times in order to disperse the coffee inside the cup and flatten the small hill that normally forms when dispensed.
 
I like the GEQ and LES implementation because the ladder looks cleaner and less instructions are needed to do same function.
Then you might like to use one LIM instruction for each PAIR of GEQ and LES to do the same job (4 LIMs replacing 8 instructions).

If you decide to try the LIMs, your Lower and Upper Limit values may not be the same as they were with the GEQ and LES, but you can arrive at values that will give you a ON range of exactly 0.1 second, the same way as the GEQ and LES.

For the LIM, it goes true when the Test Value is between the limits OR equal to either one. So for your first range, your Lower limit could be 150, but your Upper Limit needs to be 1 less than 160, or 159, to achieve exactly the 0.1 second ON time (because it goes ON at 150 and stays on through 159). An Upper LIM of 160 would keep the solenoid ON from 150 to 160 inclusive of both end points, or 0.11 seconds. (In reality the extra 0.01 seconds would not make any noticable difference in your stirring)!

While I don't see differences (but I'm sure there are differences)...
There will not be much difference in the timing error between using 1 timer or 4 timers. The main error with a PLC timer is caused by the scan time of the program that is being run. If your program is fairly short, the scan time will be small, in the 4 to 10 milisecond range, so the timer error will also be very small, so small that for this application it is a waste of time to try to reduce that error by using the STI (Selectable Timed Interrupt) function - only would add program complexity for a small unneeded error reduction.
 
Last edited:

Similar Topics

I would like a sanity check on an application i am working on. I have a proximity switch counting pulses with a Mark/space ratio of 1:1 on a...
Replies
2
Views
1,886
Hello, I am using pulse train output to a stepper driver to control a stepper motor. It seems to work fine except when I use a Control Stop...
Replies
16
Views
3,348
Hello All I have a system using the ML 1400 plc. I have an encoder on HSC:1 input 4. I want to pass this signal out on a FET output to another...
Replies
5
Views
1,965
Dear Expert, I am doing troubleshooting positioning control in Servo amplifier Mitsubishi MR-J3-A. He get pulse train input from FX1N. PLC...
Replies
1
Views
1,679
Hi, i already make a program CP1E with pulse train ouput (PLS2) to control stepper vexta. Can i use work online simulator in cx-programmer to see...
Replies
1
Views
1,471
Back
Top Bottom