Simple XY movements using FWD RE and stop commands on each axis

A bit truth is there too I must admit that. What you mean by saying Rung 6 is immediately after Rung 5, and they had mental model of Rung6? Are you refering to thing i did not follow logic part or system, that i just did follow rung one after other by my sequence numbers?
I meant that, because Rung 5 (transition #4 to #1) was followed by Rung 6 (transition #1 to #5), you were expecting that the system would transition in sequence from #4 to #1 to #5 at some point.



X cycle is not repeated in cycles 2-6 after cycle 5 is reached.


But cycles 1/2/3/4 are executed twice before getting to cycle 5, is that correct?
 
But cycles 1/2/3/4 are executed twice before getting to cycle 5, is that correct?

Cycles 1/2/3/4 are executing until end point is reached, that end point condition was my messy Rung 6. Then is going to cycle 6 until again start is reached (my messy Rung 11) and going all over again if needed.

Also, to fix problem, one solution is to move Rung 6 in front of Rung 2, as you proposed. Also to combine Rung 2 and 6. So after first two conditions in Rung 2 I just add part of condition from Rung 6 and would have both in Rung 2. Similar like I did in Rung 3.

Solution as drbitboy suggested.

attachment.php


or combined:

attachment.php


solution1.jpg solution2.jpg
 
Last edited:
I just saw I messed rungs again on lower picture. Lower part in upper rang should be first, so if both conditions for X and Y are meet, that sequence is switch to 5. In above case that would be first switched to 2, than 5...... It would work, since that would be so fast and motors wouldn't even react, but i think is way better to have it separated like in first picture.
 
Here is a working prototype (MicroLogix 1100 ladder).

It uses bits to keep track of the raster state, and I think it is less clear than a similar approach that uses sequence numbers as @Sonus1 is doing.

  • LONG_X raster pattern cycle bit value:
    • 0: raster pattern is
      • Xmin => Xmax at fixed Y (initially Ymin),
      • then Y => [Y + pomak*] at fixed Xmax,
      • then Xmax => Xmin at fixed Y,
      • then Y => [Y + pomak] at fixed Xmin
      • repeat until finish Xmin => Xmax raster at Y >= Ymax,
      • then toggle LONG_X to 1
    • 1: raster pattern is
      • Ymax => Ymin at fixed X (initially Xmax+)
      • then X => [X - pomak] at fixed Ymin,
      • then Ymin => Ymax at fixed X,
      • then X => [X - pomak] at fixed Ymax
      • repeat until finish Ymax => Ymin raster at X <= Xmin,
      • then toggle LONG_X back to 0
* pomak is a raster displacement increment, a small fraction of the max-min range.
 
As drbitboy mentioned earlier, it is more of a thing how to get data in the table, based on user inputs than part of code which is doing running. In this case that is similar, that is why i did not went to use pointer or table.

Anyway, I did some minor changes in my code, based on drbitboy advices. Now is tested and works without problem and as expected.
 

Similar Topics

Hello again..trying something on an existing poorly written program and just wanted to double check something system is an A-B MicroLogix 1200 In...
Replies
5
Views
169
Hi all, Writng a FB in ST on Beckhoff TC for a pulser which turns on and off on a cycle, is paused by turning bControlInput to FALSE, but resumes...
Replies
6
Views
255
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
319
I have a program that does a 7 second "scan" sensor calibration routine whenever a setting (setting is called assistance level or "AL" and ranges...
Replies
3
Views
213
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
317
Back
Top Bottom