News:

  • April 16, 2026, 06:56:07 PM

Login with username, password and session length

Author Topic: One Shot function  (Read 14089 times)

wilkerson29847

  • Newbie
  • *
  • Posts: 6
One Shot function
« on: March 25, 2011, 10:51:53 AM »
I need some help here on the correct way to make a one shot (PD) work. I have a chute that pivots left and right. I want an input (let's say X23) to come on, and if the chute is in the left position, I want it to pivot to the right position, and if it is in the right position, I want it to pivot to the left position, when that same input comes on. I have Limit Switches (X3 left and X5 right) as inputs to tell whether the chute is in the left or right position, which can be used to stop the pivot motion. Can anyone help me out on how to program this to work correctly?

Thanks,

David

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: One Shot function
« Reply #1 on: March 25, 2011, 02:51:04 PM »
You will need some extra logic added to cover for the situation where the chute was not making either of the limit switches. I hope that this helps:

PLC 06

// Rung 1
// Address 0
STRPD X23
AND X5
OR Y0
ANDN X3
PD Y0

// Rung 2
// Address 5
STRPD X23
AND X3
OR Y1
ANDN X5
OUT Y1

// Rung 3
// Address 10
END

// Rung 4
// Address 11
NOP

// Rung 5
// Address 12
NOP


#BEGIN ELEMENT_DOC
"X3","L.S. Left","",""
"X5","L.S. Right","",""
"X23","Swing Chute P.B.","",""
"Y0","Swing Left Sol.","",""
"Y1","Swing Right Sol.","",""

#END
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

wilkerson29847

  • Newbie
  • *
  • Posts: 6
Re: One Shot function
« Reply #2 on: March 26, 2011, 10:26:05 AM »
Ok...one more question. On Rung 2, should the OUT Y1 be PD Y1? So it would look like this:

PLC 06

// Rung 1
// Address 0
STRPD X23
AND X5
OR Y0
ANDN X3
PD Y0

// Rung 2
// Address 5
STRPD X23
AND X3
OR Y1
ANDN X5
PD Y1

// Rung 3
// Address 10
END

// Rung 4
// Address 11
NOP

// Rung 5
// Address 12
NOP


#BEGIN ELEMENT_DOC
"X3","L.S. Left","",""
"X5","L.S. Right","",""
"X23","Swing Chute P.B.","",""
"Y0","Swing Left Sol.","",""
"Y1","Swing Right Sol.","",""


Thank You!!

David

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: One Shot function
« Reply #3 on: March 26, 2011, 12:13:52 PM »
To wilkerson29847 - we are making a major assumption about the actuating device(s) (that which moves the chute). Can you give us information about this? Otherwise there is a lot of guessing going on.

Please describe what will happen if, when the system is turned on, the chute is not making either limit. Will something happen just by nature of power being applied?. Do you want the system to take a default action? Or do you want to wait for the X23 input, but then, which way would the chute move?
« Last Edit: March 26, 2011, 12:16:19 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

wilkerson29847

  • Newbie
  • *
  • Posts: 6
Re: One Shot function
« Reply #4 on: March 26, 2011, 12:54:56 PM »
The actuating device is a motor that drives a sprocket via chain to pivot this chute. I want no action to be taken on power down/power up. I want to either wait for the X23 input, which is used in auto mode, or you use pivot right and left push buttons (X4 and X2 respectively) in manual mode. So what I was trying to do was control the pivot chute depending on the position of the auto/manual switch. Such as below:

PLC 06

// Rung 1
// Address 0
STRPD X23
AND X5
OR Y0
ANDN X3
PD Y0

// Rung 2
// Address 5
STRPD X23
AND X3
OR Y1
ANDN X5
PD Y1

//Rung 3
//Address 10
STR C0
ANDN X17
AND X2
ANDN X3
ANDN Y0
OUT Y1

//Rung 4
// Address 16
STR C0
ANDN X17
AND X4
ANDN X5
ANDN Y1
OUT Y0

Rung 1 and 2 is for auto made and rungs 3 and 4 are for manual mode. C0 is on for E-stop circuit OK and X17 is the auto/manual selector switch (on for auto)

Does this make sense?

Thanks!!



plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: One Shot function
« Reply #5 on: March 26, 2011, 01:03:27 PM »
wilkerson29847, Like b_carlton said, The example I gave is making a lot of assumptions. The program I gave you would be to run for example a hydraulic self centering spool valve, when you want to swing the chute left you power the solenoid on one end of the valve until the chute actuates the limit switch and then remove power from the valve. If you are using a valve with detents then you would want to add a timer on the outputs where the sol. was powered for a second or so(depending on the valve).Now if you are using a stepper motor then everything changes again... The program that you modified would only pulse the plc output for one scan(a few milliseconds, depending on your program)Maybe this is what you wanted? The PD inputs that I used on the push button are set up so that if the operator were to hold down the button until the chute hit the limit switch, then the chute would stop and not continue back in the other direction. there is a big difference in the result of using a pd input versus a pd output. hope this makes sense to you, give us a little more info and maybe we can be a better help. Regards
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: One Shot function
« Reply #6 on: March 26, 2011, 01:06:59 PM »
Your program will only power the output for one plc scan time when your system is in auto mode, unless you have an external latch hardwired into your system then it ill only bump the motor. why do you need a one-shot?
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

milldrone

  • Full Member
  • ***
  • Posts: 48
  • I'm changing my attitude to thumbs up
Re: One Shot function
« Reply #7 on: March 26, 2011, 01:25:37 PM »
I want it to pivot to the left position, when that same input comes on. I have Limit Switches (X3 left and X5 right) as inputs to tell whether the chute is in the left or right position, which can be used to stop the pivot motion. Can anyone help me out on how to program this to work correctly?



Here is a version from a different view point/ end user

PLC 06

// Rung 1
// Address 0
#BEGIN COMMENT
"I need some help here on the correct way to make a one shot (PD) work. I have a chute "
"that pivots left and right. I want an input (let's say X23) to come on, and if the chute is in "
"the left position, I want it to pivot to the right position, and if it is in the right position, I want "
"it to pivot to the left position, when that same input comes on. I have Limit Switches (X3 "
"left and X5 right) as inputs to tell whether the chute is in the left or right position, which "
"can be used to stop the pivot motion. Can anyone help me out on how to program this to "
"work correctly?"
""
"Thanks,"
""
"David"
#END
STR X23
AND X3
PD C0

// Rung 2
// Address 3
STR X23
AND X5
PD C1

// Rung 3
// Address 6
#BEGIN COMMENT
"Your description did not indicate if this rung was needed"
""
""
"If the chute was in the middle of the stroke this rung will give you a one shot to swing to "
"the end of the stroke."
#END
STR X23
ANDN X3
ANDN X5
PD C2

// Rung 4
// Address 10
#BEGIN COMMENT
"In your original description  you said"
""
" "" I have Limit Switches (X3 left and X5 right) as inputs to tell whether the chute is in the "
"left or right position, which can be used to stop the pivot motion."""
""
"This implies that it is a motorized swing and the limits are needed for overtravel."
""
""
"PS I took the liberty of adding the neither position one shot to this direction. you can "
"delete if not needed"
""
""
#END
STR C0
OR C2
OR Y0
ANDN X5
OUT Y0

// Rung 5
// Address 15
#BEGIN COMMENT
"In your original description  you said"
""
" "" I have Limit Switches (X3 left and X5 right) as inputs to tell whether the chute is in the "
"left or right position, which can be used to stop the pivot motion."""
""
"This implies that it is a motorized swing and the limits are needed for overtravel."
""
""
#END
STR C1
OR Y1
ANDN X3
OUT Y1

// Rung 6
// Address 19
END

// Rung 7
// Address 20
NOP


#BEGIN ELEMENT_DOC
"X3","","","LS left"
"X5","","","LS right"
"X23","","","change position PB "
"Y0","","","swing to right  "
"Y1","","","swing to left"
"C0","","","Change position from the left parked position  OS"
"C1","","","Change position from the right parked position OS"
"C2","","","move if chute is not in              either position         OS     "


#END
Vaughn

milldrone

  • Full Member
  • ***
  • Posts: 48
  • I'm changing my attitude to thumbs up
Re: One Shot function
« Reply #8 on: March 26, 2011, 03:24:01 PM »
The actuating device is a motor that drives a sprocket via chain to pivot this chute. I want no action to be taken on power down/power up. I want to either wait for the X23 input, which is used in auto mode, or you use pivot right and left push buttons (X4 and X2 respectively) in manual mode. So what I was trying to do was control the pivot chute depending on the position of the auto/manual switch. Such as below:

PLC 06

// Rung 1
// Address 0
STRPD X23
AND X5
OR Y0
ANDN X3
PD Y0

// Rung 2
// Address 5
STRPD X23
AND X3
OR Y1
ANDN X5
PD Y1

//Rung 3
//Address 10
STR C0
ANDN X17
AND X2
ANDN X3
ANDN Y0
OUT Y1

//Rung 4
// Address 16
STR C0
ANDN X17
AND X4
ANDN X5
ANDN Y1
OUT Y0

Rung 1 and 2 is for auto made and rungs 3 and 4 are for manual mode. C0 is on for E-stop circuit OK and X17 is the auto/manual selector switch (on for auto)

Does this make sense?


In the above program you posted you have committed the classic rookie mistake of multiple outs for the same address. I'm guessing you have some other type of programming experience. Below is my interpretation of the program you are wanting

PLC 06

// Rung 1
// Address 0
#BEGIN COMMENT
"I need some help here on the correct way to make a one shot (PD) work. I have a chute "
"that pivots left and right. I want an input (let's say X23) to come on, and if the chute is in "
"the left position, I want it to pivot to the right position, and if it is in the right position, I want "
"it to pivot to the left position, when that same input comes on. I have Limit Switches (X3 "
"left and X5 right) as inputs to tell whether the chute is in the left or right position, which "
"can be used to stop the pivot motion. Can anyone help me out on how to program this to "
"work correctly?"
""
"Thanks,"
""
"David"
#END
STR X23
AND X3
PD C10

// Rung 2
// Address 3
STR X23
AND X5
PD C11

// Rung 3
// Address 6
#BEGIN COMMENT
"The reason for this rung is so that the motor does not instantly reverse when in auto"
""
"PS. This rung needs to be placed before the Y0 output rung. The reason for this is "
"because the swing to the right output (Y0) is turned off after the X5 LS right is made. In "
"order for this rung to work the output needs to be on and the limit switch made. This can "
"only happen when the rung is placed before the Y0 output rung "
#END
STR X17
AND C0
STR Y0
AND X5
STR C12
ANDN Y1
ORSTR
ANDSTR
TMR T0 K20
OUT C12

// Rung 4
// Address 18
#BEGIN COMMENT
"The reason for this rung is so that the motor does not instantly reverse when in auto"
""
"PS. This rung needs to be placed before the Y01output rung. The reason for this is "
"because the swing to the right output (Y1) is turned off after the X3 LS left is made. In "
"order for this rung to work the output needs to be on and the limit switch made. This can "
"only happen when the rung is placed before the Y1 output rung "
#END
STR X17
AND C0
STR Y1
AND X3
STR C13
ANDN Y0
ORSTR
ANDSTR
TMR T1 K20
OUT C13

// Rung 5
// Address 30
#BEGIN COMMENT
"The reason for this rung is to unseal the outputs if the mode changes from auto to manual"
""
"PS. This is also one way to use a ""PD"" coil. In this case the address only has a status of "
"1 for one PLC scan. "
""
"Note that I use the contact of this address (C14) to interupt the sealin of the output rungs "
"(Y0 and Y1) "
#END
STRN X17
PD C14

// Rung 6
// Address 32
#BEGIN COMMENT
"In your original description  you said"
""
" "" I have Limit Switches (X3 left and X5 right) as inputs to tell whether the chute is in the "
"left or right position, which can be used to stop the pivot motion."""
""
"This implies that it is a motorized swing and the limits are needed for overtravel."
""
""
"I have included the auto control you mentioned earlier"
""
"I have also unsealed the the output if the mode changes from auto to manual."
""
#END
STRN X17
STR C10
ORPD X4
ANDSTR
STRPD X17
AND X3
ORSTR
STR X17
ANDPD T1
ORSTR
STR Y0
ANDN C14
ORSTR
ANDN X5
AND C0
OUT Y0

// Rung 7
// Address 48
#BEGIN COMMENT
"In your original description  you said"
""
" "" I have Limit Switches (X3 left and X5 right) as inputs to tell whether the chute is in the "
"left or right position, which can be used to stop the pivot motion."""
""
"This implies that it is a motorized swing and the limits are needed for overtravel."
""
"I have included the auto control you mentioned earlier. "
""
"I have also unsealed the the output if the mode changes from auto to manual."
""
""
#END
STRN X17
STR C11
ORPD X2
ANDSTR
STRPD X17
AND X5
ORSTR
STR X17
ANDPD T0
ORSTR
STR Y1
ANDN C14
ORSTR
ANDN X3
AND C0
OUT Y1

// Rung 8
// Address 64
END

// Rung 9
// Address 65
NOP


#BEGIN ELEMENT_DOC
"X2","",""," ""go left"" PB"
"X3","","","LS left"
"X4","","","""go right"" PB "
"X5","","","LS right"
"X17","","","auto selector switch"
"X23","","","change position PB "
"Y0","","","swing to right  "
"Y1","","","swing to left"
"C0","","","E stop ok"
"C10","","","Change position from the left parked position  OS"
"C11","","","Change position from the right parked position OS"
"C12","","","seal in when in auto and swing is at end of stroke to the right"
"C13","","","seal in when in auto and swing is at end of stroke to the left"
"C14","","","control has transitioned from auto to manual this will unseal the output if the mode changes from auto to manual             OS"
"T0","","","delay for the direction change to the left"
"T1","","","delay for the direction change to the right"

#END
« Last Edit: March 27, 2011, 02:10:00 PM by milldrone »
Vaughn