Stacker Crane starts as soon as i press play!

Hi,

Please could someone have a look at this program and help me understand why the Stacker crane moves off as soon as I press play.

Please see my YouTube video.

PLC 1200 Sort and Stack FAULT.factoryio (130.0 KB)
Stacker crane.zip (916.0 KB)

If I make a change to the code and go to download > Software (All). It will work as intended the first time. After that it drives to the first location without a pallet.

I’ve also had a problem with my load conveyor Q1.6 starting up as soon as i press play but if i stop and start it resets using i1.5 Fatory IO Running input.

Please can someone test the program.

I shut Factory IO and reopened and now it is moving differently…

If “word to shift” = 0 it should not move.


I would greatly appreciate any help with this. Thanks.

Hello @DJM45!

I tested your program and it seems that the problem with the crane happens because on Step 4 of your Block_1 you set the value for “Destination” and “O_SCr 1 Target Pos” to 1. When you stop and start the scene on Factory I/O the value for those tags is 1 and so the target position of the crane is 1. As such, the crane will move to that position. This happens because, in the program, there hasn’t been any change to that value.
What you have to do is to set the value for both “Destination” and “O_SCr 1 Target Pos” to 55, as this is the value for the rest position. Notice that if you keep the condition “Destination” := “Destination” +1, the next value will be 56, and what you want is for it to be 1, so you might need to change this part of the program.

Regarding the conveyor Q1.6, when I tested your program it always started off. However, the issue might be related to the memories you use to set Q1.6. Sometimes the PLC will detect false transitions of the sensor’s signal at the start of the simulation and that triggers the memories which, consequently, sets Q1.6 as TRUE.

I hope this helps!

Thank you for the reply @adriana.silva , It is greatly appreciated.

In network 1 I moved the value of 0 to “Destination” and “O_SCr 1 Target Pos” upon pressing the play button i1.5 “Factory I/O Running”.

This kind of works, the scene starts before the value has loaded so i have to press stop/start again. (I tried moving a value of 55 and the outcome was the same).

Now i have an issue for some reason the crane lifts at start up, i don’t see how this is possible because this is further down in the program, if the crane lifts why wouldn’t the forks move left first? It makes no sense to me.

As an experiment i used a Reset bit in network one to reset Q1.3 “O_SCra 1 Lift”

This works, however it doesn’t seem like the correct way to do it and every so often the crane does not lift a pallet, the forks go out and then come back on board it then travels to the first location!

Stacker crane_1.zip (1.1 MB)
PLC 1200 Sort and Stack.factoryio (130.1 KB)

Hi @DJM45!

I looked at the program you sent in your last reply and it seems that, in Step 3 in your Block_1 you set the variable “O_SCra 1 Left” to FALSE. However, after you set the “O_Scra 1 Lift” to TRUE in Step 2 you never set it to FALSE. So, when you start the scene more than one time the lift has the value TRUE and starts up, but the forks don’t move because they were set to FALSE in the previous run. It’s the same situation that you had with the crane moving to position 1. You’d need to also set the lift to FALSE at the start of the program or further down in your program.

The lift not raising and the crane continuing to the first location might be due to the program skipping Step 2- This happens when the program sees the conditions of Step 2 and Step 3 as TRUE at the same time and so it skips Step 2 and executes Step 3 and continues.

I hope this helps!