The following is a description of a recent control system I designed, completed in May, 2014. A rubber manufacturing company was having trouble with speed control of five conveyors and and a festoon. Unusual events had caused loss of program documentation of the PLC (programmable logic controller) which controlled the conveyors. It became evident that redesigning the program from scratch would be easier and less expensive than trying to decipher the old program without its descriptive documentation. So that was done. The most challenging part of the design is explained referring to the sketch below.

The speed of CONV #1 is adjusted as needed by an operator, speed range being between 30 and 80 fpm. The entire conveying system responds automatically. CONV's #2 and #3 change speeds with #1, but just enough faster than #1 to avoid stock pile up. The speed of the festoon changes automatically as required to maintain the the stock loop length as set. The loop length is set by an operator to any length between a half foot and six feet. This adjustment is made at anytime by turning the knob of a potentiometer mounted in the door of the control panel. The speed of CONV #4 changes automatically as needed to stay in sync with the festoon. CONV #5 changes speed automatically as well, to a value just slightly faster than #4.
When the speed of CONV #3 changes the festoon must also change speed if the stock loop length is to remain constant. The program calculates the required festoon speed to maintain the loop length set point. The calculation is made based on CONV #3 speed and the distance between the festoon bars. I had the enjoyable task of deriving the program formula to accomplish the calculation.
The required speed of CONV #4 is calculated based on the festoon speed, the spacing between festoon bars, and the length of the stock loop at CONV #4. The distance between the bars is a constant. But as previously stated the festoon speed is a variable, as is the stock length. All three are factors in the formula used to calculate the speed set point for CONV #4. Again, I had to (actually "got to") derive the necessary program formula.
At times a natural limitation on the length of the stock loop comes into play. This will happen when an operator changes to a short loop length set point when long lengths are arriving at CONV #4. CONV #4 can run no faster than 130 fpm. This puts a limit on how fast the festoon can run based on the length of the stock loop at CONV #4. On these occasions there has to be a minimum allowable value for the stock loop length set point. The minimum limit is calculated and when necessary overrides the potentiometer setting for the loop length. I "got to" derive this formula also.
Another pleasant challenge was programming the PLC to calculate and remember the length of each stock loop formed by CONV #3 and the festoon, then have that length enter the calculation of the speed set point of CONV #4 when that loop arrives at CONV #4.
All of this was accomplished successfully as intended.