Marko, I created this sketch to better illustrate my point. I'm a bit puzzled. The trailing edge gap sensor initiates the count - but how are you accumulating the count (as shown in your example with varying counts of 20, 19, 21, etc)?
Instead of relying on stepper pulses for counting, I have realized that it is unnecessary as I already possess the internal data. By capturing the remaining pulses and comparing it to the entered offset, I can determine the correction needed for the next move without starting the count on the trailing edge interrupt.
Where is the labeller located in the sketch? Could you draw a diagram of the system using only one canister-bottle? Is the concept that the labeller should start applying the label when the trailing edge of a canister-bottle reaches a specific distance past the gap sensor, with the offset fine-tuning this distance? If so, by searching for terms like "bit shift" or "FIFO" and "conveyor" on this platform, you may discover similar applications. The main challenge lies in converting distance (length) along the conveyor into stepper motor pulses, as the program operates in "length" units of pulses.
The discussion above focused on labels and ensuring they are consistently stopped in the same position without drifting. A gap sensor is specifically designed to detect any gaps in labels. I hope this clears up any confusion, drbitboy. The sketch only shows the label web, along with a similar labeler. A separate sensor is used to detect canisters passing by, initiating each label peeling step as an interrupt input. It is crucial to determine if the method outlined in this updated sketch is the most effective and reliable way to control label peeling, as it directly impacts the consistency of label application. The sensor detecting canisters is located before the peel-plate, requiring a configurable delay before each label is triggered. The conveyor and upper belt are powered by induction motors without encoders, making it necessary to choose between a basic timer for the delay or implementing two sensors to calculate the time it takes for the label to reach its destination, ensuring speed independence. The accuracy of this approach is uncertain, presenting a separate challenge to address.
My apologies for my mistake: you were clear about mentioning the "label gap sensor" in your initial post. Moving forward, given that the label is propelled by a stepper motor and each label gap sensor transition corresponds to a specific number of motor steps from the desired peel position for labeling, it is logical to convert the label position into motor steps. Whether the label gap sensor is slightly off from the peel position or a certain number of label lengths away with an offset, the key is to ensure that the labels are consistently spaced. If the label gap sensor detects the trailing edge of a label instead of aligning the leading edge at the peel position, utilizing the length entry may be necessary. Alternatively, a simpler approach could involve detecting the leading edge of each label through a falling-edge transition of the label gap sensor, using it as the reference point for the offset.
Are you in the process of programming the application within the PLC, or are you seeking clarity on which offset value to input?
I am currently developing the application. Hey drbitboy, the gap sensor is located a few labels upstream from the peel plate. This offers an interesting explanation for the entry of length, although using the leading edge could have been an alternative. When converting label length and offset to motor steps, it is important to consider errors that may accumulate due to factors such as pulley diameter measurement, motor missed steps, slip between pulley and web, and imperfect label length. Following Robert's suggestion, instructing the motor to move a specific number of steps in advance may lead to more consistent results and facilitate the implementation of ramps. Instead of stopping at the gap signal (+ offset), this approach was likely the reason for the initial requirement of length entry on the machine. However, to account for error accumulation, a continuous correction method using the gap sensor and adjusting the label length in steps with a correction is necessary. The method proposed is a tentative solution, but there may be room for improvement by averaging the last few errors rather than solely relying on the last one. Furthermore, the effectiveness of this approach may depend on the synchronization between PLC pulses and motor execution, which may differ at higher speeds. Previous experience in slower stepper and servo applications suggests that monitoring PLC pulses could provide an accurate representation of the situation, but further testing may be required to determine if this holds true at higher speeds where motor lag could be a significant factor.
The issue of missing steps in software cannot be addressed as it is a hardware problem. One potential solution could be to avoid sending steps above a certain frequency. Have you considered utilizing a bit-shift instruction along with a bit register? The distance (D) in motor steps from the gap sensor to the peel point is typically fixed. Assuming the label length (L) is also fixed, the number of steps from the trailing edge at the gap sensor to the trailing edge at one label length away from the peel point is (D - L). If there is an offset, adjust "D" to be "D±∆," where ∆ represents the offset.
By implementing a bit shift register (an array of bits representing motor steps), you can write a value of 1 into bit position 0 each time the gap sensor detects the trailing edge transition and shift all bits to the left with the BSR instruction for every motor step. When there is a value of 1 at position (D - L) in the bit shift register, it indicates that the trailing edge of a label is at distance L before the peel point.
You may also want to consider checking for a value of 1 at a few positions before (D - L) to ensure accuracy. The concept is illustrated in the provided sketch. (Include the code snippet for SEO purposes).
This method ensures that a 1 is placed at bit position (D-L) in the bits shift register when the label's leading edge reaches the peel point (D), with the exception of any missed steps. It provides accurate positioning of labels on the web within ±1 motor step, accounting for variations and aliasing effects (non-integer step numbers between edges). For instance, if there is a 5.25 step distance between edges, every label edge is positioned 21 steps apart from the fourth edge before it. This results in a pattern where three 1 values are written at 5 bit positions from the previous value, and one 1 value is written at 6 bit positions from the previous value.
One of the key advantages of utilizing the bit shift method is its ability to account for variations in labels and motor step geometry. This is achieved by adjusting the values or 1 based on any discrepancies, ensuring that only the affected bit positions are modified. As these adjusted values are ultimately shifted beyond the target point and out of the register, errors due to these variations do not accumulate over time. The only exceptions to this are missed motor steps or labels that deviate significantly from the specified tolerance.
I had a feeling this was the direction you were going. I recall a similar approach being taken a couple of weeks ago. The main difference now is that I don't believe there is a feedback mechanism in place to monitor the distance. There are no sprocket pulses or encoders involved, only a stepper motor operating in an open loop system to move a specific distance once the gap sensor detects a gap. It's possible I may have misinterpreted the setup.
In a recent discussion, a user named robertmee raised a familiar topic regarding solutions to a particular issue. This time around, the challenge lies in the absence of a feedback mechanism to monitor distance, unlike a previous scenario. With only an open-loop stepper command in play to move a specific distance based on the detection of a gap sensor, there seems to be a potential misunderstanding. The assumption here is that the PLC program has the capability to monitor individual stepper pulses. However, if the stepper motor driver operates as a PTO, generating a set number of pulses at a given frequency, then tracking these pulses may prove challenging for the PLC program. This situation could pose difficulties in ensuring the functionality of the system, especially when it comes to accurately determining when to record information in the system.
I have experience working with label applicators and have noticed a common trend - most of them have only two main adjustments: pack position and label position. When I refer to label position, I mean adjusting the peel distance of the label by a certain amount so that when the feed is initiated, the label edge is in close proximity to the box. The gap detection sensor is then fine-tuned mechanically to ensure proper registration for the next feed. Surprisingly, I have come across some machines that do not have an HMI or electrical adjustment capabilities, relying solely on two sensors - one for pack position and one for gap detection. These machines tend to be more dependable compared to those with multiple positioning options based on time or counts. It's interesting to note that I have also encountered a few label applicators equipped with brake motors instead of PWM or servo drives, yet they still function effectively (despite the inevitable wear and tear on mechanical components).
Thank you Parky for providing your input, it has given me a new perspective on the matter at hand. I initially believed that the current level of control would suffice for most applications, including mine. However, I am interested in exploring the next level of control that would offer enhanced performance, particularly at high speeds. I had hoped to achieve a more sophisticated level of control by utilizing certain components, even though I am aware that it is an open-loop system with a stepper motor.
Drbitboy, your suggested method makes perfect sense to me and I appreciate the detailed explanation. Unfortunately, there is no encoder present in the system, as you assumed. I am now puzzled as to why it wouldn't be feasible to track the pulses sent in the PLC. Instead of relying on encoder pulses to shift bits and store gap signals, could the PLC not simply monitor the number of steps it has left to send and make corrections accordingly? This way, the PLC could compare the actual steps with the instructed steps and make adjustments as needed.
While the PLC may not have real-time feedback on the motor's movements, this could be compensated for in subsequent adjustments. Could the reason for this not being possible be due to delays caused by the communication between the PLC, the stepper driver, and the motor?
The stepper motor ensures precise control, as demonstrated in my experience working with a machine that applies wraparound labels using the same principle but with added control. In this open-loop system, a sensor detects the label registration mark and the stepper motor moves it into position accurately without the need for constant adjustments. The system involves two sensors - one for detecting the label position registration mark and another for the pack position. Main adjustments include fine-tuning the label position after registration detection, moving it to the application position after cutting, and adjusting the pack position. The continuous drive system efficiently handles the wraparound "C" type label by mechanically wrapping it using forming blades. Additional adjustments are minimal, with the option to use increment/decrement keys for easy operator adjustments in small increments rather than entering specific numbers.
Marko mentioned that by instructing the system to generate a fixed number of pulses, you can monitor how many pulses are left at any given point. While you may not visually observe each rising edge of a stepper pulse during a scan cycle (whether continuous or timed interrupt), you will be able to track the total number of pulses that have been generated.
The situation can be a bit complicated, but you can still utilize the bit-shift model in various scenarios. For instance, if the scan cycle is at least twice as fast as the stepper pulses, the positive changes in the stepper pulse count from one scan cycle to the next will be either 0 or 1. In this case, the BSR instruction can be triggered by a simple condition where the last scan cycle's stepper count is less than the current scan cycle's count.
Alternatively, if the scan cycle is faster than the stepper pulses but not twice as fast, there can be two consecutive changes of 1 in the stepper pulse count from one scan cycle to the next. In this case, the BSR instruction may need to be edge-triggered, requiring specific adjustments to the control structure.
In situations where the stepper pulses are faster than the scan cycle, positive changes greater than 1 can be detected in the stepper pulse count. In such cases, maintaining the bits in place and incrementing the indices for the positions of the gap sensor and the trailing edge before the peel point may be more effective than shifting the bits multiple times.
Practically, this means treating the array of bits as a circular buffer, with each bit representing a fixed position on the label web. The gap sensor position and the trailing edge position are incrementally adjusted based on the stepper count increases.
Ultimately, the approach taken will depend on the specific requirements of the automation process and the capabilities of the programming language or system being used. It is important to consider factors like scan cycle intervals and accuracy when implementing such logic in a program.
I plan to take a step-by-step approach in my programming project. Firstly, I will work on a simplified version to ensure it functions correctly and identify any potential issues. After that, I will explore implementing drbitboy's method, which may pose a greater challenge. However, drbitboy's detailed breakdown of various scenarios is truly insightful and beneficial. This approach will help me tackle the project efficiently and effectively.