![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: May 2022
Location: istanbul
Posts: 3
|
Conveyor Control
Hi everyone, I'm newbie at here.I need to help.Can you share your experience to me?
The scheme is as at picture. ![]() The robot is palletizing at conveyor 1 and then send to me palletcompletedbit. After, ı must move this pallet to conveyor 2 with plc code. Also my customer want to run conveyors manually via buttons. My code is : [/ladder][/code] timer_conv2empty(in:=,pt:=t#20s); CASE MachineMode OF Man: StateAuto:=0; StateConv1:=0; StateConv2:=0; IF AlarmStatus THEN StateMan:=99; END_IF IF StateMan=0 AND bttnMode_RTRIG.Q THEN MachineMode:=Auto; END_IF CASE StateMan OF 0: (*Manual control*) IF bttnConveyor1 THEN IF NOT in_Sensor1 THEN out_Conveyor1:=TRUE; ELSE out_Conveyor1:=FALSE; END_IF END_IF IF bttnConveyor2 THEN IF NOT in_Sensor2 THEN out_Conveyor2:=TRUE; ELSE out_Conveyor2:=FALSE; END_IF END_IF IF bttnConveyorTransfer THEN IF NOT in_Sensor2 THEN out_Conveyor1:=TRUE; out_Conveyor2:=TRUE; ELSE out_Conveyor1:=FALSE; out_Conveyor2:=FALSE; END_IF END_IF IF NOT bttnConveyor1 AND NOT bttnConveyorTransfer THEN out_Conveyor1:=FALSE; END_IF IF NOT bttnConveyor2 AND NOT bttnConveyorTransfer THEN out_Conveyor2:=FALSE; END_IF 99: (*Alarm*) out_Conveyor1:=FALSE; out_Conveyor2:=FALSE; IF NOT AlarmStatus THEN StateMan:=0; END_IF END_IF END_CASE; Auto: StateMan:=0; IF AlarmStatus THEN StateMan:=99; END_IF IF (StateAuto=0 OR StateAuto=99) AND bttnMode_RTRIG.Q THEN MachineMode:=Man; END_IF CASE StateAuto OF 0: (*Stop*) out_Conveyor1:=FALSE; out_Conveyor2:=FALSE; IF in_StartButton_RTRIG.Q THEN StateAuto:=1; END_IF 1: (*Running*) IF in_StopButton_RTRIG.Q THEN StateAuto:=0; END_IF CASE StateConv1 OF 0: (*initial*) out_Conveyor1:=FALSE; IF NOT in_Sensor1 THEN StateConv1:=1; ELSE StateConv1:=2; END_IF 1: (*conveyor empty*) IF palletcompletedbit THEN out_Conveyor1:=TRUE; ELSE out_Conveyor1:=FALSE; END_IF IF out_Conveyor1 AND in_Sensor1 THEN StateConv1:=2; END_IF 2: (*conveyor loaded*) IF StateConv2=1 THEN out_Conveyor1:=TRUE; ELSE out_Conveyor1:=FALSE; END_IF IF NOT in_Sensor1 AND in_Sensor2 THEN StateConv1:=1; END_IF END_CASE; CASE StateConv2 OF 0: (*initial*) out_Conveyor2:=FALSE; IF NOT in_Sensor2 THEN StateConv2:=1; ELSE StateConv2:=2; END_IF 1: (*conveyor empty*) IF StateConv2=2 THEN out_Conveyor2:=TRUE; ELSE out_Conveyor2:=FALSE; END_IF IF out_Conveyor2 AND in_Sensor2 THEN StateConv2:=2; END_IF 2: (*conveyor loaded*) timer_conv2empty.IN:=NOT in_Sensor2 ; IF timer_conv2empty.Q THEN StateConv2:=1; END_IF END_CASE; 99: (*Alarm*) out_Conveyor1:=FALSE; out_Conveyor2:=FALSE; IF NOT AlarmStatus THEN StateAuto:=0; END_IF END_CASE; END_CASE; [code] [ladder] What should I do if the pallet stays between the sensors? What should I do if the sensors are triggered incorrectly? thank you for reply Last edited by Robocoaster; May 21st, 2022 at 02:26 PM. |
![]() |
![]() |
#2 |
Lifetime Supporting Member
|
Welcome to the forum!
If you put [/ladder] after the code and [ladder] before the code, you can keep the indentation ([/code] and [code] also works but it more limited by width):
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#3 |
Member
![]() ![]() Join Date: May 2022
Location: PA
Posts: 13
|
CASE StateConv1 OF *Disclaimer* I did not proof read the code. Quick skim. Buffer the sensor inputs with Rising and Falling edge triggers. You can use these edges for tracking purposes and proper sequence. Conveyor is loaded on the rising edge of sensor 1. The falling edge would set a "transitioning" state. You can add a timer to this bit to alarm that sensor 2 never saw a transition. If sensor 2 shows a rising edge without a transitioning flag then you have an improper sequence. Assuming I understand your layout correctly. |
![]() |
![]() |
#4 |
Lifetime Supporting Member
![]() ![]() Join Date: Dec 2004
Location: Detroit, SE Michigan
Posts: 3,781
|
In my industry, these are commonly called zone conveyors but we try to use (2) sensors per zone, pallet_entering (which you have) and pallet_present. Makes the logic easier for Sparky.
__________________
I don't always test my code but when I do, I do it in production. |
![]() |
![]() |
#5 |
Member
|
Personally, I would do this in ladder, it's easier the OP did not state what PLC & it seems a little complicated & messy.
Here is one that works (well as I assume what is required), the OP did not state if in manual the operator controls the conveyors ignoring certain things like the sensors or signal from palletiser etc. so assume not, have not included all things like that. A simple alarm if for example the conveyors run for more time than expected to move pallet from conveyor 1 to conveyor 2 sensor then it assumes stuck pallet regardless of if moved off sensor 1.
Did not add any on/off delay on the photocells, this would depend on if the natural stop of the conveyors ensured the photocells were fully covered or if the pallets would have gaps that the photocells could see. Last edited by parky; May 23rd, 2022 at 05:47 AM. |
![]() |
![]() |
#6 |
Member
![]() ![]() Join Date: Dec 2007
Location: Los Alamos
Posts: 564
|
Yes, the 'real' ladder logic will be shine in this case. I am guessing his homework requirement to be ST.
your logic is a better than the two previous two. but it wont work because of PE01 need to be broken "IF SEQ = 0 AND Pallet_Comp_Bit AND PE01 AND NOT PE02 AND Auto_Man THEN". I'd start the seq when receiving the complete bit. run it to PE01, then start Conv2 at that point.
__________________
================================================== ====
Last edited by BachPhi; May 23rd, 2022 at 07:22 AM. |
![]() |
![]() |
#7 |
Member
|
It is assumed that PE01 is made when the pallet is placed on the conveyor this works I have simulated it. It assumes that the pallet is put on the conveyor, the PE is made which tells the palletizer to do what ever it needs to do then the palletizer gives the signal to transfer it. But yes if the PE is not made & only rely on the palletizer to initiate it then it would need to be modified, I realise now that the picture of the two conveyors shows the pallets not on the PE's however, this is wrong as the conveyor 2 PE is not covered which it would have to be to stop the sequence (or rely on timers to assume pallet in middle of conveyor (very poor design if so ).when passed from conveyor 1 to 2, the OP's description is poor in regarding exactly how it should work.
Last edited by parky; May 23rd, 2022 at 07:36 AM. |
![]() |
![]() |
#8 |
Member
|
Are you saying his picture is not clear? lol.
|
![]() |
![]() |
#9 |
Lifetime Supporting Member + Moderator
|
So only one pallet to be present on each conveyor ever ?
Or can one pallet start leaving conveyor 2 when the pallet on conveyor 1 has begun to leave ? Shall the sensor at the entry of conveyor 2 also function as the exit sensor for conveyor 1 ? Can the pallet extend from conveyor 2 onto conveyor 1 without conveyour 1 running until the sensor 1 is activated ? Also, consider error scenarios, such as there is a pallet on conveyor 2, and when it starts to move but no signal from sensor 1 is received, there is possibly a blockage. Similar, the signal(s) on sensor 1 or sensor 2 stays on and does not go off. etc.. What shall be the functionality of the buttons ? Write a detailed spec of the programs functionality, and the actual code almost writes itself.
__________________
Jesper ![]() NOTICE: JesperMP can be impolite, has passive-aggressive tendencies and may use sarcasm ! |
![]() |
![]() |
#10 |
Member
![]() ![]() Join Date: May 2022
Location: istanbul
Posts: 3
|
Thank you all answers. You have been very helpful.
![]() |
![]() |
![]() |
#11 |
Member
![]() ![]() Join Date: May 2022
Location: istanbul
Posts: 3
|
Actually, every conveyor have a sensor. I dont want to lose pallet at conveyor. So, ı set persistent that conveyors state. Also, these buttons at HMI.So, I didn't use rising or falling edge.
Is this true ? |
![]() |
![]() |
#12 |
Member
|
@Jesper: My thoughts exactly, I have done many of these & in all cases the sensor is covered when pallet in place, did many systems where the pallets came in different sizes i.e. half euro, full Euro, 1.5 Euro, 2 Euro & if I remember correctly 2.5 Euro sizes, so the last two would straddle 2 of the conveyors. These were feed conveyors to a Strapper a total of 14 & two on the outlet. The pallets were measured in a number of different configurations just before the Strapper, by length, width, if pallet had bottom runners or not (if runners then swords were used to feed the straps or straps were sent between the conveyor rollers) the strapping patterns were determined by the above i.e. could be 3 or 4 straps across, if half Euro then one strap each way, full Euro 2 straps each way so about 30 strap patterns in total.
|
![]() |
![]() |
#13 |
Member
|
Based on what I did last time here is a more concise bit of code that does the same job
|
![]() |
![]() |
#14 |
Member
|
Could have done it in less lines but at my age all those brackets make my brain hurt so here is a ladder one rung, missing are the alarm for jammed pallet & the stop if switched from auto to man or back.
Just goes to show that ST is fine for calcs but for Boolean Lad is faster to code (well in my old brain) & easier to understand. |
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|