Encoder Following Logic

JJH

Member
Join Date
Oct 2015
Location
South Carolina
Posts
57
Hey group!

I am working on a project that has a machine that forms cartons that will drop the cartons into a cleated conveyor after they are formed. The forming machine needs to be synchronized with the cleated conveyor so that the formed cartons will drop in between the cleats as they pass under the forming machine. So, in essence, the conveyor will be the master and the forming machine will be a slave to the conveyor and match its position accordingly.

Initially, it was proposed that the conveyor utilize a CIP encoder so it could be set up as a motion axis, but the customer declined that option as they didn't care for using CIP encoders (can't really blame them!). So, a slightly cruder proposal of using two 1024 count encoders was proposed, which they accepted. However, your friendly programmer here isn't quite sure how to make that work!

I think the basic concept is encoder following but but I can't seem to find anything online that really describes the actual process or logic for this. The RA Sample Code site doesn't seem to have anything on there but maybe I just haven't entered the right search keywords.

The forming machine has the following notable components:

  • 5069-L310ER
  • 5069-HSC2xOB4
  • PowerFlex 525 drive
  • 1024 count incremental encoder

As noted, the idea is to have a 1024 count encoder mounted on the conveyor with some sort of ratio so that the counts will run the pitch of the cleats 508 mm). Some trickery will have to worked in to get them to sync at the right time but for the time being, I'm just looking for a method to do the encoder following and asking the group if anyone has some ideas, or better yet, a method, of how to accomplish that.
 
Compactlogix supports motion. I would think you could use the MAG instruction to setup the lead/follow relationship and adjust the ratio as necessary.
 
Unfortunately it was decided to stick with the L310ER, so there's no motion controls with this processor. That would have been nice, though!
 
PLC programs are about time.

At any given sample time i.e. on some scans, we will have a pair of encoder counts, one count from the forming machine, and one count from the cleated conveyor.

For any single box, we want the encoder on the forming machine to hit a particular end count (e.g. when the box will drop) at the same time the encoder on the cleated conveyor hits its corresponding particular end count (e.g. when the box will drop between two cleats).

Leaving aside for the moment the calculation of those two particular counts, the remaining counts for each system until those end counts can presumably be calculated, and as you note a ratio can be calculated. As long as that ratio remains constant from sample to sample, the two systems' end counts will occur at the same time, and the box should drop in between the cleats.

Part of the problem will be the discrete nature of the counts-remaining integer values, which will add stochastic noise (from aliasing) into the ratio calculation; discriminating between that sample-to-sample noise and an actual secular drift (variation) of the ratio will be a challenge.

There is a current thread in this forum about alpha-beta and alpha-beta-gamma (α-ß-γ) filters, which may be able to generate an estimate of signal sans noise from the available data. Part of the problem in this application is that, as the moment to drop gets closer, the remaining counts' values become smaller, and the noise that contributes to the ratio will increase. With an α-ß or α-ß-γ filter, that can be compensated for by adjusting the gains, or perhaps the PLC would simply stop trying to correct for the ratio once the drop point is near (whatever "near" means). @Peter Nachtwey has at least one youtube video about these filters, and I recently found an interesting tutorial about them here. For me, looking at the code for an α-ß-γ filter told me what I needed to know, and implementing same in a PLC would not be a complex task, certainly not as complex as applying said filter to this particular problem.

Once we have at least an α-ß filter, we will have a reasonably smooth estimate of the ratio's velocity, and a PID or other control algorithm using the VFD speed reference (CV) to drive that velocity (PV) to zero (SP) may - may - do the trick; of course, there will be various problems, e.g. non-linear system gains, but that is in the bookkeeping.

That said, and this may be an interesting exercise, but almost certainly upgrading to a PLC with motion control, where this wheel has already been invented and implemented, would be a better, and cheaper, and faster path (all three ;)) to a robust solution.
 
Last edited:
Agreed. As we all know, lead times for anything microprocessor are long, so the idea/hope was to use an existing machine that's been built in our manufacturing facility to cut down on the throughput time. A motion PLC would alleviate a good bit of this.
 
Does the cleated conveyor need to move continuously?


Because if we can predict the conveyor encoder count when it will be in position to receive a newly-formed box, and we can also predict the forming machine encoder count when the next newly-formed box will drop, then we can move quickly to the that conveyor count before the box drops, and then wait for the box to drop when the forming machine reaches that encoder count, and then make the next prediction and repeat.
 
5 years ago I wanted to synch two existing conveyors on two entirely different machines and my research led my to the power flex 525 with an encoder and purchased the drives and encoders but they were stolen with my car (long story) and I never got around to try them out.
But I recall they were promising.
But for my application the customer preferred going with high end Emerson Unidrive, I think 700 series or something with a 7 in it but that was quite expensive and would negate whatever savings you got on your choice of controller.


Another choice was a Yaskawa drive with some special software for and encoders that also seem d promising.


Point is, it is doable and your drives with encodes my very well do a satisfactory job. Do your research and see what you find.
 
So, when I wrote PF525 with encoder I should've added "cards".
The drive seems quite capable and I just looked at my old notes and thinking I should buy another pair to test them out. With encoders, they can be commanded with PWM which should give you excellent speed control of both drives, they other functions tied to presence of encoder cards which include positioning and PID. Have a look at the manual and just go straight to encoder card and it's options.
 
5 years ago I wanted to synch two existing conveyors on two entirely different machines and my research led my to the power flex 525 with an encoder and purchased the drives and encoders

Point is, it is doable and your drives with encodes my very well do a satisfactory job. Do your research and see what you find.

I don't think the PF525 can take an encoder signal, can it? It thought that was the PF527? Or is it just that the PF527 can do motion?

Interesting point, I will review the PF525 manual to see what can be done there. The PLC system has a high-speed counter card so I was thinking I'd just utilize that but maybe if the PF525 can handle encoders, I can try that angle.
 
Ouch - Software overcoming wrong hardware

I have found over time that the cheaper solutions in hardware require huge amounts of time in programming and commissioning and even then do not always get the result that the customer (and supplier) wants

I have done this type of thing in other plc's and drives, however, it is much, much simpler when motion control is available.
It is possible to do but depends on the accuracy required
My first comment, maximise the counts / rev for the cleat encoder to the limits of the hardware (eg 4096 without exceeding the input frequency of the HSC or drive) it helps in the smoothness of the carton forming machine

A number of questions to start off the solution process

What is the accuracy required between the box and the cleats? (eg the gap between cleats [508 mm(pitch) - Cleat size] compared to maximum box size?)
needed to determine if the hardware is totally wrong​
what is the speed of the cleats (m/min or ft/s) or highest boxes per minute rate?
What is the communication method between the pf525 and the compact logix PLC (Ethernet (fingers crossed))?
Do you have sensors to detect each cleat and each "box" and where are they wired to (eg straight to the HSC)? [for the measurement of phase and counts per box or cleat]
Can the forming machine run without forming cartons (ie must every cleat have a box)? this leads to start up and shutdown questions and downstream process questions

Your system will firstly have to follow accurately the dynamic speed of the cleats (easiest is probably using the drive if the drive hardware supports it) then "trim" the speed to get the phase correct using the sensors detecting the cleat and box
 

Similar Topics

I'm using an A-B quadrature encoder with open collector (2000 pulses / rev) to supply pulses to a Automation-Direct STP-DRV-4850. The drive is set...
Replies
6
Views
2,454
Hi, I have a 2098-DSD-100X-HV indexing ultra3000 that I want to follow the speed of an auxiliary encoder. The encoder is a 2500ppr, single ended...
Replies
29
Views
9,793
Sorry in advance for the long post, but this requires a little back story. I work in a facility with a couple hundred VFDs Most are in a web...
Replies
14
Views
151
I have an application using an incremental encoder and then I convert it to degree (0-360) using calculation program. For a while, the calculation...
Replies
7
Views
242
Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
1,003
Back
Top Bottom