View Single Post
Old August 5th, 2022, 08:38 PM   #5
AK5fa
Member
South Korea

AK5fa is offline
 
Join Date: Nov 2019
Location: Seoul
Posts: 6
Thumbs up

Dear drbitboy,

First of all,

Thank you so much for a very quick and very detailed reply!


I'm now in process of digesting your posts before converting them to the actual PLC logic (BTW, it's a SIEMENS S7-1500 PLC series, not Omron). A few notes and comments along the way.

Quote:
Originally Posted by drbitboy View Post
Cylinder defects

With those statements in mind, let me restate the key question in a slightly different way:
  • When the center of a 170mm cylinder is at the ejector rod, how can the program know whether there is a defect within 85mm (=170mm/2) of the ejector rod?
Stated that way, the task is reduced to two sub-tasks
  • Detect (or know or predict) when a 170mm cylinder is centered at the ejector rod
    • This can be derived from "Track the position of the lead edge of each 170mm cylinder"
  • Track the position of all detected defects
Here are some additional details which are important to consider:
  • The cylinder length detected by the entry prox. is not fixed. Due to the shape of the end of the cylinder, it may be detected as in a range between 165 to 175 mm. Also, it's possible that the machine could be handling another batch of cylinders with slightly different dimensions (somewhat shorter or longer). So, we can't assume any certain fixed length of the cylinder. Likewise, we can't assume any fixed distance between cylinders. There is certain minimum distance, which is about 70 mm and that's about it.
  • There is a prox. sensor at the end (exit) of the conveyor belt. It's located between 50 and 80 mm before the ejection rod. Sorry, I don't have the exact distance figure right now. But we can assume it is being slightly less than half of the cylinder length. I believe, it would be a proper timing to activate the ejection rod on the trailing edge of that prox. Anyway, hitting the cylinder with the ejector rod at exactly half-length point is not the issue right now. Deciding on whether to hit it or not is the issue at hand.
I really hope this helps and doesn't break your algorithm apart.

Quote:
So, if the program detected the rising edge of the entrance proximity sensor of the leading edge of a cylinder some N encoder pulses ago, then the program should be able to predict where that leading edge is now, in units of encoder pulses from the entrance prox.
Yes, it surely does. As per your assumption, the PLC gets a new value of the "actual position" of the servo motor (in units of encoder pulses) every cycle. The actual PLC cycle time fluctuates slightly, but it's in the 1.7 to 2.9 ms range.

Quote:
Likewise, if some time ago the cameras detected a defect that was located at a distance of M encoder pulses from the entrance prox, and there have been K pulses since then, then the program should be able to predict where that defect is now, again in units of encoder pulses from the entrance prox.

Note that we no longer associate the defect with a cylinder, but rather we associate independent 1D positions of both cylinders and defects relative to the entrance prox/ejector rod line.
In my opinion, that's the trickiest part. Firstly, the PLC doesn't know the exact M value that you mentioned above. Also, there could be up to 4 of these M-values, since each camera may find its own defect in the same product.
The Omron Vision system reports the exact pixel value (1D coordinate in range from 1 to 1600) of the defect for each camera. If there is no defect (or no product on the belt) a certain known "default" value is sent instead. However, this information comes to PLC in the form of serial communication messages which are fixed in time but are not synced to the entrance prox edge. It is typical for the system to receive 2 or 3 of these messages during the time it takes for the cylinder to pass through the belt. Also, please consider that other cylinders would enter the belt before the cylinder that we are "focused" on leaves.

Quote:
Model assumptions
  1. The cylinders do not move relative to the conveyor belt
  2. Any defect does not move relative to the cylinder on which it is detected
    1. By implication, if Assumption 1 above is also true, the any defect also does not move relative to the conveyor belt
  3. The interval between successive encoder pulses represents a fixed increment of motion of the conveyor belt, along with any cylinders and/or defects
  4. The PLC does not miss any encoder pulses
    1. or at least knows the count of encoder pulses since the last scan
  5. The 1D position of the ejector rod, relative to the entry proximity sensor, is known, in units of encoder pulses from the entrance prox.
These assumptions are correct with the following clarifications:
  1. 4.1 => The PLC can't get the edge of every encoder pulse, but it knows the count of the encoder pulses on each normal program scan.
  2. 5 => The position of the ejector rod is at a fixed distance from both entrance and exit prox. sensors. The ejector rod can be activated at the trailing edge of the exit prox.

I am still looking at your algorithm in detail and will reply to them later on.

Thank you so very much again for your help and all the time you put into following this issue!
  Reply With Quote