In and Out Solenoid Program

One thing the OP has not stated is what type of solenoid (bet they do not know) it can make a difference in which way you write the code, for example if a 5 port valve then there is no need to keep the coil energised it only needs a pulse, In that situation I normally keep it on until it reaches position (or alarm timeout). not that it probably matters but holding a solenoid on (assume back while machine at standby) can cause premature overheating of the coil reducing it's life span.
Going back to small code, It will also depend on which order you put AND/OR logic.
Example Siemens:
A M0.0
A(
OR M0.1
OR M0.2
)
= M 0.3

However,
OR M0.1
OR M0.2
A M0.0
= M0.3
is the same thing but less instructions.
Melsec

LD_STL.png
 
One feature the solutions provided not addressed is the stop button aborts the cycle wherever it's at. Hard to tell from the OPs homework if that was intended or not. In the real world, might be an app where it is desired to complete the cycle and always park at the retracted position.
 
My last post has an unnecessary instruction, so we are down to 12 instructions (10 visible for the mono-rung;)).

Also it does not matter if the forward limit sensor NC contact is on the seal-in branch (State Coil/Fault Coil pattern) or if it is on the main rung (Start/Stop Circuit pattern).


See annotations below.


So it reduces to the same approach as post #7 without the unnecessary [start & reverse switch] branch on rung 0001.

I did think of another way though; more later.
cyl_off_fwd_limit.png
 
@ robertmee, My second one did wait until it got back, I too saw that as important, but as the cylinder would only be out for a very small time probably would not matter that much.
 
@parky's approach, that reverse is [NOT forward] when running, can be extended symmetrically with both forward and reverse by ANDing the [NOT at_limit] bit for each. Still 12 (or 10) visible instructions.

Whichever solenoid's rung logic immediately follows the Run Start/Stop Circuit the direction in which the cylinder will initially move when the cylinder neither limit switch is activated and the start pushbutton is pressed.

cyl_symmetric_forward_start.png cyl_symmetric_reverse_start_end.png cyl_symmetric_reverse_start_mid.png
 
Last edited:
One feature the solutions provided not addressed is the stop button aborts the cycle wherever it's at. Hard to tell from the OPs homework if that was intended or not. In the real world, might be an app where it is desired to complete the cycle and always park at the retracted position.


On the reverse solenoid rung logic, remove the NO/XIC Run_Lamp, and replace it with NC/XIO Reverse_Limit_Switch, if not already present.

This will immediately reverse the solenoid if it is extending but not fully extended, so it's not exactly like windshield wipers on a car, but it will do the job.
 
On the reverse solenoid rung logic, remove the NO/XIC Run_Lamp, and replace it with NC/XIO Reverse_Limit_Switch, if not already present.

This will immediately reverse the solenoid if it is extending but not fully extended, so it's not exactly like windshield wipers on a car, but it will do the job.

I know we're getting into the weeds now on a homework project, but I wouldn't like that, as the cylinder has the potential to move at anytime on inadvertent loss of the reverse signal. At least when you push the stop button, it's already moving and if it retracts and parks, that's expected. But i wouldn't want the reverse solenoid armed and ready all the time.
 
I know we're getting into the weeds now on a homework project, but I wouldn't like that, as the cylinder has the potential to move at anytime on inadvertent loss of the reverse signal. At least when you push the stop button, it's already moving and if it retracts and parks, that's expected. But i wouldn't want the reverse solenoid armed and ready all the time.


I agree*.

I was thinking feed the stop pushbutton input (or not [stop input], if the stop PB is NC) into a TON with a preset of 5-10s, then if the TON expires (/DN is 1) it is because the operator is holding the stop pushbutton pressed, which will then allow the cylinder to retract as long as the reverse contact is not made, even though the system is not latched into run mode.

* (about the weeds too) It's never to early for newbies to start thinking about big picture, especially regarding safety.
 
* (about the weeds too) It's never to early for newbies to start thinking about big picture, especially regarding safety.


I think that's the best way to learn this field.


Do THIS but instead of the normal way of using an encoder you have to do it with 6 proxy switches and a motion detector that we have on the shelf so we don't have to pay for an encoder.


Or a bunch of discreet pressure, limit and flow switches so we don't have to buy an analog IO card.
 

Similar Topics

I have a SC9-LS24-3 surge protection solenoid cable from automation direct...
Replies
9
Views
1,356
Hi Experts! I'm trying to control a solenoid valve (don't have part number, but I've been told its a 24V DC 30 watt coil) with a PLC output card...
Replies
15
Views
6,612
Hi All, Solenoid bank controls air to 8 cylinders. We used to able to move cylinder up and down by hand no problem but now there is a small amount...
Replies
5
Views
2,433
We have a new system here at our facility that is using Mechanical Relays to control 24 VDC solenoid valves in a hydraulic system. Our relays are...
Replies
13
Views
4,224
Hello, I am trying to make an Automatic Coolant Dispensing station for my client. This unit will be stationed next to a CNC Machine to monitor...
Replies
56
Views
14,532
Back
Top Bottom