WO1998006053A1 - System and method for materials process control - Google Patents

System and method for materials process control Download PDF

Info

Publication number
WO1998006053A1
WO1998006053A1 PCT/US1997/013553 US9713553W WO9806053A1 WO 1998006053 A1 WO1998006053 A1 WO 1998006053A1 US 9713553 W US9713553 W US 9713553W WO 9806053 A1 WO9806053 A1 WO 9806053A1
Authority
WO
WIPO (PCT)
Prior art keywords
cotton
lint
gin
processing
optimum
Prior art date
Application number
PCT/US1997/013553
Other languages
French (fr)
Inventor
William S. Anthony
Richard K. Byler
Original Assignee
The United States Of America, Represented By The Secretary Of Agriculture
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by The United States Of America, Represented By The Secretary Of Agriculture filed Critical The United States Of America, Represented By The Secretary Of Agriculture
Publication of WO1998006053A1 publication Critical patent/WO1998006053A1/en

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B13/00Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion
    • G05B13/02Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric
    • G05B13/0205Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric not using a model or a simulator of the controlled system
    • G05B13/026Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric not using a model or a simulator of the controlled system using a predictor
    • DTEXTILES; PAPER
    • D01NATURAL OR MAN-MADE THREADS OR FIBRES; SPINNING
    • D01GPRELIMINARY TREATMENT OF FIBRES, e.g. FOR SPINNING
    • D01G31/00Warning or safety devices, e.g. automatic fault detectors, stop motions
    • D01G31/006On-line measurement and recording of process and product parameters
    • DTEXTILES; PAPER
    • D01NATURAL OR MAN-MADE THREADS OR FIBRES; SPINNING
    • D01HSPINNING OR TWISTING
    • D01H13/00Other common constructional features, details or accessories
    • D01H13/32Counting, measuring, recording or registering devices

Definitions

  • the present invention relates generally to a system and method for processing materials, particularly agricultural solids such as cotton. More particularly, the present invention relates to a system and method for optimizing the processing of cotton in a cotton gin.
  • Cotton quality after ginning is a function of its initial quality as well as the type and degree of cleaning and drying that it receives during the gin process .
  • the term "cotton” is generally used to refer to either seed cotton or lint.
  • Seed cotton has the fibers or lint attached to the cottonseed, and is usually referred to as “seed cotton” .
  • After the fiber is removed from the cottonseed it is usually referred to as “lint” .
  • Ginning includes drying, trash removal from seed cotton, lint-seed separation, trash removal from lint, and bale packaging. Processing cotton in a gin is an intricate task that proceeds at rates as high as 150,000 pounds per hour.
  • Cotton ginning systems consist of several different types of processing machines, and each machine influences several physical properties of the cotton fiber (lint) .
  • the efficiency of the ginning process is strongly influenced by the quantity of moisture and trash that the cotton contains.
  • Cotton contains varying amounts of trash and moisture, and is of varying colors.
  • most cotton in the United States is conventionally processed through the same machines in a standard sequence, regardless of the level of trash in the cotton or the cotton color.
  • the amount of drying received by the cotton is also relatively constant, regardless of the actual moisture content of the cotton. Therefore, in conventional cotton processing, some cotton may be over-dried, or processed through more cleaners than necessary for the level of trash in the cotton.
  • Conventional cotton processing does not account for variations in the cotton being processed. This can result in decreased fiber quality, and increased costs and/or processing time.
  • One way to optimize the cotton processing sequence is to bypass certain machines, such as driers, seed cotton cleaners, and lint cleaners, that may not be necessary for the particular cotton being processed.
  • machines such as driers, seed cotton cleaners, and lint cleaners
  • physical properties of the cotton such as trash content, moisture content and color
  • changing the number of cleaners used in a conventional cotton ginning system requires downtime for the ginning system, as well as labor costs for changing the valve configurations in the system. At least five minutes is required to change the valves on a single gin stand lint cleaner device.
  • a gin typically has three or more sets of lint cleaners in parallel processing lines . There is also the potential for malfunctions that arise when the valves are manually changed. Other gin machines and driers do not routinely have bypass valves, requiring that valves be provided.
  • a conventional ginning system does not continuously measure the physical properties of the cotton as it is being processed, and is not capable of determining the gin machine sequence that optimizes processing of cotton having those physical properties.
  • An operator of a conventional ginning system cannot readily assess the need to alter the gin machine sequence to optimize cotton processing.
  • bypassing machines in a conventional ginning system is slow, requires operator intervention, and requires repeated starting and stopping of the machines as they are bypassed or brought back on-line.
  • a computer program product comprises a computer useable medium having computer program logic or software recorded thereon for enabling a processor in a computer system to control the processing of cotton through a gin to produce lint .
  • the computer program logic enables the processor to measure sensor data that correspond to color, moisture content, and trash content of the cotton as it enters the gin.
  • the computer program logic enables the processor to generate a gin decision matrix that includes optimum process control decisions that maximize net return from the lint as a function of the input state of the cotton entering the gin.
  • the computer program logic enables the processor to select an optimum process control decision from the gin decision matrix for an input state corresponding to the measured sensor data.
  • the optimum process control decision corresponds to an optimum gin machine sequence for cotton with the measured input state .
  • the processor is enabled by the computer program logic to implement the optimum process control decision by routing cotton through the optimum gin machine sequence.
  • the computer program logic also enables the processor to compute and store predicted values for color, moisture content, and trash content for the cotton after processing through a first portion of the optimum gin machine sequence .
  • the gin decision matrix may be generated using a plurality of tabular transition functions.
  • the gin decision matrix may also be generated using an algorithm for each gin machine in the optimum gin machine sequence.
  • Each algorithm and tabular transition function quantifies the effect of that gin machine on leaf trash, moisture content, reflectance (Rd) , turnout, length, and yellowness (+b) .
  • the computer program logic of the present invention may also enable the processor to measure second sensor data that correspond to color, moisture content, and trash content of the cotton after it has been processed through the first portion of the optimum gin machine sequence.
  • the processor may also be enabled to compare the second sensor data to the predicted values to generate an error, and to adjust the optimum gin machine sequence and the predicted values to compensate for the error.
  • the computer program logic of the present invention may also enable the processor to measure lint sensor data that correspond to color, moisture content, and trash content of the cotton after it has been processed through a second portion of the optimum gin machine sequence.
  • the processor may also be enabled to compute and store second predicted values for color, moisture content, and trash content for the cotton after processing through the second portion of the optimum gin machine sequence.
  • the computer program logic may also enable the processor to compare the lint sensor data and the second predicted values to generate a second error, and to adjust the second portion of the optimum gin machine sequence and the second predicted values to compensate for the second error.
  • a program storage device readable by a machine.
  • the program storage device embodies a program of instructions executable by the machine to perform method steps for processing cotton through a gin to produce lint .
  • the method steps include : measuring sensor data at a measurement station that correspond to color, moisture content, and trash content of the cotton at the measurement station; determining an optimum gin machine sequence for cotton entering the gin based on a physical state of the cotton at the measurement station that corresponds to the sensor data so that the optimum gin machine sequence maximizes net return from the lint; and routing the cotton through the optimum gin machine sequence.
  • the measurement of sensor data may be performed at the measurement station as the cotton enters the gin, after the cotton has been processed through a first portion of the optimum gin machine sequence, or after the cotton has been completely processed through the optimum gin machine sequence .
  • the program storage device of the present invention may include an error feedback feature that may include the following method steps : measuring second sensor data at a second measurement station that correspond to color, moisture content, and trash content of the cotton after it has been processed through a first portion of the optimum gin machine sequence; computing and storing predicted values for color, moisture content, and trash content for the cotton after processing through the first portion of the optimum gin machine sequence; comparing the second sensor data to the predicted values to generate an error; and adjusting the optimum gin machine sequence and the predicted values to compensate for the error.
  • the program storage device of the present invention may also include a second error feedback feature that may include the following method steps: measuring lint sensor data that correspond to color, moisture content, and trash content of the cotton after it has been completely processed through said optimum gin machine sequence; computing and storing second predicted values for color, moisture content, and trash content for the cotton after processing completely through the optimum gin machine sequence; comparing the lint sensor data to the second predicted values to generate a second error; and adjusting a second portion of the optimum gin machine sequence and the second predicted values to compensate for the second error.
  • a second error feedback feature may include the following method steps: measuring lint sensor data that correspond to color, moisture content, and trash content of the cotton after it has been completely processed through said optimum gin machine sequence; computing and storing second predicted values for color, moisture content, and trash content for the cotton after processing completely through the optimum gin machine sequence; comparing the lint sensor data to the second predicted values to generate a second error; and adjusting a second
  • a control system that controls the processing of cotton through a gin to produce lint.
  • a gin has a plurality of auxiliary treatment units and a duct through which entrained cotton flows .
  • the control system of the present invention comprises measuring means for measuring sensor data that correspond to color, moisture content, and trash content of the cotton.
  • Processing means are coupled to the measuring means.
  • the processing means processes the sensor data, and selects a set of the plurality of auxiliary treatment units in the gin through which the cotton is processed to produce lint.
  • the set selected by the processing means corresponds to an optimum gin machine sequence that maximizes net return from the lint .
  • Each of the auxiliary treatment units in the gin is equipped with a cotton diversion means that is coupled to the processing means.
  • the processing means activates the cotton diversion means to divert cotton to flow through each of the auxiliary treatment units in the selected set .
  • the processing means deactivates the cotton diversion means to bypass each of the auxiliary treatment units that are not in the selected set.
  • the control system of the present invention may also include second measuring means coupled to the processing means for measuring sensor data that correspond to color, moisture content, and trash content of the cotton as it enters a second stage .
  • This second stage may be a ginning stage, or a lint cleaning stage for which lint cleaner sensor data is measured.
  • a third measuring means may also be provided for measuring color, moisture content, and trash content of the lint after processing by the set of auxiliary treatment units.
  • the control system of the present invention may also be provided with cotton diversion means in the form of automated directional valves for controlling the flow of cotton through the set of auxiliary treatment units .
  • a control system for controlling the processing of lint through a mill that has a plurality of auxiliary treatment units and a duct through which lint flows.
  • the control system includes measuring means for measuring sensor data that correspond to color, moisture content, and trash content of the lint.
  • Processing means coupled to the measuring means is provided for processing the sensor data.
  • the processing means selects a set, from the plurality of auxiliary treatment units, through which the lint is processed to produce lint of a predetermined quality.
  • the set corresponds to an optimum mill machine sequence.
  • the control system also includes lint diversion means coupled to each of the auxiliary treatment units and coupled to the processing means.
  • the processing means activates the lint diversion means to divert lint to flow through each of the auxiliary treatment units in the set.
  • the processing means deactivates the lint diversion means to bypass each of the auxiliary treatment units not in the set .
  • a program storage device that embodies a program of instruction to perform method steps for processing input material through a processing plant to produce processed material.
  • the method steps comprise measuring sensor data at a measurement station that correspond to a physical state of the input material at the measurement station; determining an optimum processing machine sequence for input material entering the processing plant based on the physical state of the input material at the measurement station that corresponds to the sensor data, the optimum processing sequence maximizing net return from the processed material; and routing the input material through the optimum processing machine sequence.
  • a feature of the present invention is that it optimizes materials processing to maximize monetary return to producers, while minimizing the amount of machinery used and preserving quality of the materials.
  • a further feature of the present invention is that it provides for automated control of the gin process .
  • the present invention has the added feature that the degree of automated control can be selected by the ginner, and customized for a particular gin.
  • the display also advises the ginner of the machinery sequence being used to process the cotton.
  • the display may be located within the gin itself, as well as at other locations remote from the gin.
  • a still further feature of the present invention is that it can be adapted for use with fluid-entrained materials other than cotton, such as seeds, man-made fibers, or pharmaceuticals.
  • a still further feature of the present invention is that it provides instantaneous directional changes in the flow of fluid- entrained materials, particularly air-entrained cotton.
  • Yet a further feature of the present invention is that it can be adopted for use in a textile mill to control the processing and cleaning of lint to maximize quality of the lint.
  • An advantage of the present invention is that only the necessary machinery will be used to process a particular run of cotton, thereby saving on energy costs and minimizing waste and damage to the cotton by eliminating unnecessary processing steps.
  • a further advantage of the present invention is that it can be installed in an existing gin, as well as be included in the design of a new gin.
  • Still another advantage of the present invention is that the flow of cotton or other solids can be diverted without stopping the flow or shutting down machinery to carry out a manual valve changing operation.
  • a still further advantage of the present invention is that the flow of cotton can be diverted as necessary for cotton cleaning to provide cotton with an appropriate level of foreign matter and color. When cleaning is not necessary, the cleaning machines can be bypassed without stopping the machinery or the flow of cotton through the primary processing system.
  • a still further advantage of the present invention is that the continuous redirection of the flow of cotton occurs without choking a cotton duct in a ginning system.
  • FIG. 1 shows typical processing stages for a cotton ginning system
  • FIG. 2 shows a schematic of a small-scale ginning system in which the present invention is installed
  • FIG. 3 shows an expanded view of a sample collection installation in FIG. 2;
  • FIG. 4 shows an exemplary computer system suitable for use with the present invention
  • FIG. 5 shows a partial view of a ginning system in which the automated directional valves of the present invention are installed with a lint cleaner
  • FIG. 6 is an expanded view of the automated directional valves of the present invention.
  • FIG. 7 is a further view of the automated directional valves shown in FIG. 6 that illustrates selected valve positions
  • FIG. 8 is an expanded view of the manually-operated slide valve shown in FIG . 6 ;
  • FIGS. 9A-9D show alternate embodiments of the automated directional valves of the present invention.
  • FIG. 10 shows a block diagram illustrating implementation of the process control system of the present invention.
  • FIG. 11 shows a flow diagram of the process steps carried out for a first measurement station (Station 1) ;
  • FIG. 12 shows a flow diagram of the process steps carried out for a second measurement station (Station 2) ;
  • FIG. 13 shows a flow diagram of the process steps carried out for a third measurement station (Station 3) ;
  • FIG. 14 illustrates the error feedback process of the present invention
  • FIG. 15 shows a screen display for editing a gin configuration file
  • FIG. 16 shows a screen display for editing a decision matrix file
  • FIG. 17a shows one embodiment of a screen display for the process control system of the present invention,-
  • FIG. 17b shows an alternate embodiment of a screen display for the process control system of the present invention
  • FIG. 18 shows an output of optimum ginning decisions from a dynamic programming model of the present invention
  • FIG. 19a shows a ladder diagram for implementing an embodiment of the present invention that includes automated valves ;
  • FIG. 19b shows a ladder diagram for implementing an embodiment of the present invention that includes semi-automated valves ;
  • FIG. 20 illustrates one embodiment of a hardware interface suitable for use with the process control system of the present invention
  • FIG. 21 illustrates one embodiment of a cleaning line in a textile mill.
  • the present invention is designed for use in a system that processes fluid-entrained materials.
  • the invention will be described herein with reference to a ginning system that processes air-entrained cotton.
  • physical properties of the cotton are analyzed to determine the optimum ginning sequence to maximize return to cotton producers while producing cotton having desired fiber properties .
  • the present invention evaluates the physical properties and quality parameters of cotton before, during, and after the ginning process. Measurements of cotton color, moisture content, and trash content are made at three stations in the ginning system. A dynamic programming model uses these measurements, as well as information relative to staple length, lint turnout, cotton price structure, and energy cost to generate a matrix of optimum drying and cleaning sequences. The dynamic programming model optimizes producer profits by selecting the amount of gin machinery necessary to achieve the most beneficial market value, yet minimize the machinery used. The dynamic programming model uses the market price structure for cotton, and the performance characteristics for each gin machine, to determine optimum machinery sequences. The decision at each stage of processing depends on the state of the cotton entering that stage.
  • the decisions can be related to the state of cotton when it enters the gin.
  • the optimum decision at each stage of processing can be determined from the initial state of the cotton.
  • the objective is to maximize the net return from the lint; i.e., the revenue from the lint minus the costs of the ginning operation. Any revenues or costs that do not vary with the processing decisions (e.g., revenue from seed and operating costs of the gin stand) are not included in the dynamic programming model because they do not affect the optimum decision.
  • the present invention allows a ginner to process each increment of cotton through the minimum machinery necessary to achieve maximum returns, rather than processing all cotton identically.
  • Fiber quality factors such as moisture content, color grade (yellowness and greyness) , and trash content (area, number, shape, and type of trash particles) are measured before the gin process (Station 1 in FIG. 2) . These measurements are used to ascertain the optimum seed cotton cleaning machinery, and drying temperature and exposure time, to produce specifically desired fiber properties that maximize monetary returns to cotton producers .
  • Color is subdivided into two components for use in the process control system of the present invention: yellowness (+b) and reflectance (Rd) . Color, trash, and moisture sensors are installed perpendicularly to the flow of cotton.
  • the cotton is forced to pause for a finite time period (typically approximately 1 second) as a sample collection means compresses the cotton against the sensors to provide a uniform measurement surface in a continuous, automatic, batch-type process. Electrical signals are transmitted from the sensors to a computer system for processing and storage .
  • Predicted values of each measured fiber property are stored in the computer system for subsequent comparison of the predicted value with the actual value after cleaning and drying of the seed cotton.
  • the change in other common fiber properties such as fiber length, length distribution, uniformity, neps (small entanglements of cotton fibers) , short fiber content, micronaire, seed coat fragment size and weight, strength, upper quartile length, mean length, coefficient of variation length, elongation, lint turnout, etc. is estimated and recorded.
  • a second measurement station (Station 2 in FIG. 2) is used midway through the ginning system.
  • a third measurement station (Station 3 in FIG. 2) is used after all cleaning, ginning, and drying has occurred to determine the final quality of the cotton, to provide error feedback to Station 2 , and to provide data that may be used in making machinery decisions .
  • Samples of cotton are captured at Stations 2 and 3, and analyzed with sensors similar to those at Station 1. Measurement data obtained at Stations 1, 2 , or 3 may be used by the computer system to determine the optimum gin processing sequence for the cotton being processed.
  • the computer system is configured to selectively activate and deactivate cotton diversion means to individually control flow through each of the selected machines in the optimum gin processing sequence. For example, a clean cotton needs almost no cleaning to achieve its best possible grade. As such, the process control system of the present invention would determine which machines were not needed, and would bypass those cleaners.
  • the present invention diverts the flow of cotton through the selected combination of gin processing machines by controlling valves, such as the automated directional valves disclosed herein.
  • the valves are configured to provide for complete flow stoppage, or unrestricted flow.
  • the opening and closing of the valves are sequentially controlled to allow cotton to clear the individual machines .
  • FIG. 1 Typical processing stages for a cotton ginning system are shown in FIG. 1.
  • the stages associated with a gin stand/feeder 150 and a bale press 170 are always required; the stages associated with the other illustrated machinery are optional .
  • the ginning machinery combination recommended by the U.S. Department of Agriculture (USDA) includes two seed cotton driers 110, three seed cotton cleaners, gin stand, and two lint cleaners 160.
  • the seed cotton cleaners typically include one or more cylinder cleaners 120, one or more stick machines 130, and one or more impact cleaners 140.
  • the processing machinery illustrated in FIG. 1 is conventional in the gin processing industry, and the configuration and operation of the machinery is known to one of skill in the relevant art. A description of this machinery can be found, for example, in Cotton Ginners Handbook, USDA, Agricultural Handbook Number 503, December 1994, the entirety of which is incorporated herein by reference .
  • the system and method of the present invention processes cotton through the minimum machinery necessary to achieve maximum returns. Rather than processing all cotton identically, the present invention provides for customized or prescription ginning of the cotton to preserve fiber quality and maximize monetary returns to cotton producers.
  • a schematic of a small-scale ginning system in which the present invention is installed is shown in FIG. 2.
  • the configuration shown in FIG. 2 has been provided for illustrative purposes only.
  • a full-scale gin may include more or less machinery, or a different arrangement of machinery, than that illustrated in FIG. 2. It is to be understood that the present invention can be used with a variety of gin configurations, and is not limited to the configuration shown in FIG. 2.
  • lint cleaner 2 includes a feed control 220 into which seed cotton is fed, two driers 110, two cylinder cleaners 120, stick machine 130, impact cleaner 140, extractor-feeder/gin stand 150, and three lint cleaners 160.
  • a condenser 230 from which lint is expelled.
  • the ginning system of FIG. 2 is equipped with the process control system of the present invention which includes a computer system 240.
  • the function and operation of computer system 240 is explained more fully below in Section 3 (Computer Program Implementation of the Preferred Embodiment ) .
  • Computer system 240 for use in the process control system of the present invention is shown in FIG. 4.
  • computer system 240 is a microcomputer such as an IBM-PC.
  • Computer system 240 preferably includes a display, keyboard, and input/output circuitry suitable for interfacing with measuring means 210 and cotton diversion means 250.
  • Computer system 240 includes one or more processors, such as processor 404.
  • Processor 404 is connected to a communication bus 406.
  • Computer system 240 may communicate with other similarly configured computer systems or with a display (not shown) via a network 418, such as an ETHERNET local area network.
  • Computer system 240 also includes a main memory 408, preferably random access memory (RAM) , and a secondary memory 410.
  • main memory 408 preferably random access memory (RAM)
  • secondary memory 410 preferably random access memory (RAM)
  • Secondary memory 410 includes, for example, a hard disk drive 412 and/or a removable storage drive 414, representing a floppy disk drive, a magnetic tape drive, a compact disk drive, etc.
  • Removable storage drive 414 reads from and/or writes to a removable storage unit 416 in a well known manner.
  • Removable storage unit 416 also called a program storage device or a computer program product, represents a floppy disk, magnetic tape, compact disk, etc.
  • removable storage unit 416 includes a computer usable storage medium having stored therein computer software and/or data.
  • Computer programs are stored in main memory 408 and/or secondary memory 410. Such computer programs, when executed, enable computer system 240 to perform the features of the present invention as discussed herein. In particular, the computer programs, when executed, enable processor 404 to perform the features of the present invention. Accordingly, such computer programs represent controllers of computer system 240.
  • the invention is a computer system operating according to software.
  • the invention is a computer program product having control logic which causes the computer to operate as discussed herein.
  • the present invention is implemented primarily in hardware using, for example, a hardware state machine.
  • a hardware state machine Any of the hardware state machine so as to perform the functions described herein would be apparent to persons skilled in the relevant arts.
  • Computer system 240 is used to measure cotton characteristics at three measurement stations, shown as Stations 1, 2, and 3 in FIG. 2.
  • Each station contains measuring means 210 for taking moisture, color, and foreign matter (trash) measurements on samples of cotton being processed.
  • Station 1 evaluates seed cotton
  • Stations 2 and 3 evaluate lint.
  • Each of measuring means 210 includes a moisture meter 214 to measure moisture content of the cotton, and a camera 212 to measure color and trash content.
  • Suitable cameras include the "Color/Trash Meter” camera made by Motion Control, Inc., and a similar device made by Spinlab, Inc., both now owned by Zellweger Uster.
  • Suitable moisture sensors include infrared moisture sensors, such as those made by Infrared Engineering, Inc. or Moisture Systems Corporation. Resistance moisture sensors may also be used. A particularly preferred resistance moisture sensor is described in U.S. Patent 5,514,973, the entirety of which is incorporated herein by reference.
  • the three channels of data from the three cameras 212 shown in FIG. 2 are connected to a video multiplexer, such as model DT2859 made by Data Translation of Marlboro, MA.
  • the multiplexer connects one of the eight input lines on the board with an output line under control of computer system 240.
  • the appropriate camera 212 for a measurement is selected through the multiplexer.
  • the output of the multiplexer is connected to a frame grabber, such as model HRT256 made by Catenary Systems of St. Louis, MO.
  • the frame grabber converts a video frame to a set of digital pixel values that indicate light and dark areas of the image. Foreign material normally appears darker than the surrounding cotton fibers .
  • the number of pixels which are dark compared to the neighboring pixels are counted to determine count data.
  • the percent of the total number of pixels which are dark is used as the percent area of trash.
  • the color meter is an instrument with two light sensors covered with different filters that approximate the ICI Standard Observer tri-stimulus values of Y and Z.
  • the light sensors with filters produce a voltage that is calibrated to correspond to Y and Z.
  • the Y and Z values are converted to the Nickerson-Hunter Rd (reflectance) , +b (yellowness) , and color code and quadrant values for cotton lint .
  • One such transformation is contained in the COLORF.C file (discussed in more detail in Section 3.a.ii. below) in the attached microfiche appendix.
  • the digital values of percent area trash, Rd, and +b are input to computer system 240 for processing and analysis.
  • FIG. 20 one embodiment of a hardware interface to computer system 240 is shown.
  • the input to computer system 240 from the three cameras 212 of Stations 1, 2, and 3 is represented by video input lines V0, VI, and V2, respectively, of a video input 2030.
  • the video multiplexer and frame grabber referred to above are contained within video input 2030.
  • a digital interface 2040 is provided that consists of two 24-bit input/output (I/O) ports. These two 24-bit I/O ports are identified as lines DI through D48 of digital interface 2040.
  • one 24- bit I/O port is the PIO (programmable input/output) portion of a CIO-DAS16 board available from ComputerBoards, Inc., Mansfield, MA.
  • the other 24 -bit I/O port is preferably a Computer Boards CI0-DI024 board.
  • the 24 PIO lines from each of the digital I/O boards are connected to a ComputerBoards SSR-RACK24 containing 24 optoisolator modules .
  • the optoisolator modules isolate computer system 240 from dangerous voltages associated with the digital I/O system, and are available from Gordos or OPT022.
  • the 24 PIO lines from each of the digital I/O boards can be programmed for either input or output on each line, and the optoisolator modules are available for either input or output .
  • a digital-to-analog (D/A) converter 2020 is provided, and in a preferred embodiment is part of the CI0-DAS16 board.
  • D/A converter 2020 may be used, for example, to control the temperature of the burners in drier 110.
  • the burners in a drier are typically controlled by a burner control that is configured to receive an analog input .
  • the voltage is adjusted on line A0 of D/A converter 2020.
  • the burner control then raises or lowers the temperature of the burners based upon this analog input .
  • the analog inputs to computer system 240 are captured with an analog-to-digital (A/D) converter 2010, such as the 12-bit A/D converter that is part of the CIO-DAS16 board.
  • A/D converter 2010 such as the 12-bit A/D converter that is part of the CIO-DAS16 board.
  • the two color output channels and two light level channels from each of the three measurement stations (cameras 212) are connected to A/D converter 2010.
  • the color cells include two lines, Y and Z.
  • the light level sensors include two additional lines, L and R. These four lines from each of the three measurement stations are input to A/D converter 2010 (lines A0 through All) .
  • the analog output of the three moisture meters 214 is connected to A/D converter 2010 (lines A12 through A14) .
  • a digital output from moisture meter 214 is used, and is input to computer system 240 as a digital, rather than analog, input.
  • An analog multiplexer 2012 such as CIO-EXP32, connects to the CIO-DAS16 board.
  • Analog signals representing the temperature of the burners in drier 110 can be connected to analog inputs on analog multiplexer 2012.
  • the sampling of cotton at the three measurement stations is controlled by computer system 240 through digital interface 2040.
  • sample collection means is used to capture a sample of cotton for measurement at each of the three measurement stations . This is achieved through the "close sample” line at Stations 1, 2, and 3 (D9, D12 , and D25, respectively).
  • Proximity sensors or switches are installed at each measurement station so that the position of the sample collection means (open, closed, or neither) can be measured by computer system 240 through digital interface 2040.
  • Station 1 uses a plunger or compression-ram type of sample collection means.
  • Station 1 can be configured with a paddle-sampler type of sample collection means, as shown in FIG. 2 for Stations 2 and 3.
  • the position of this sample collection means is input to computer system 240 on the lines labeled "Plunger Closed”, “Plunger Open”, and “Plunger Switch” (D21, D22, and D23) .
  • Stations 2 and 3 are shown in FIG. 2 as configured with a "flapper” or paddle-sampler type of sample collection means.
  • Stations 2 and 3 can alternatively be configured with a compression-ram type of sample collection means. Such a configuration is useful when Station 2 is located above the feeder shown in the lower left corner of FIG. 2.
  • the position of the paddle sampler shown in FIG. 2 at Stations 2 and 3 is input to computer system 240 through the lines labeled "sample open” and “sample closed”.
  • the position of the paddle sampler used in connection with calibration at Stations 2 and 3 is input to computer system 240 through the lines labeled "cal . open” and "cal . closed” .
  • FIG. 20 shows four output lines from digital interface 2040 (D13-D16) that are input to Station 2. These lines are used to extend and retract a short stroke air cylinder and a long stroke air cylinder. These air cylinders are used during calibration of the sensors, as described in U.S. Patent No. 5,639,955.
  • a PLC (programmable logic controller) 2050 is used by computer system 240 to control the flow of cotton through the various gin machines.
  • PLC 2050 is linked to a ginner' s control panel 2060 that includes a switch for selecting the method of valve control to be used, either automatic control or manual control. If automatic control is selected, computer system 240 and PLC 2050 automatically control switching of the valves to configure the gin machinery in accordance with the optimum gin machine sequence that corresponds to the optimum process control decision.
  • valve settings are switched by an operator to configure the gin machinery in accordance with the optimum gin machine sequence that corresponds to the optimum process control decision, or the desires of the ginner.
  • PLC 2050 reads the setting of this switch on ginner' s control panel 2060. As discussed below in Section 3.b., PLC 2050 is programmed to read this switch setting before initiating a change in the setting of the valves. In this manner, the degree of automated control can be selected by the ginner, and the system and method of the present invention can be customized for a particular gin.
  • the first line input to PLC 2050 is a computer valid line. This line is connected to a watch dog timer that is connected to line D20 of digital interface 2040. The watch dog timer switches the computer valid line to false if a monostable multivibrator is not reset by computer system 240. If the computer valid line is false, PLC 2050 defaults to a predetermined condition that safeguards the gin machinery.
  • the next two lines input to PLC 2050, LC A and LC B are used to request that either or both of two lint cleaners ("A" and/or "B") be placed on-line so that cotton is diverted to flow through them.
  • the two lines input to PLC 2050 labeled Impact Cl. and Stick Mach. (D30 and D31, respectively) are used to control selection of the seed cotton cleaners (impact cleaner 140 and stick machine 130) . Any combination of seed cotton cleaners (impact cleaners and stick machines) can be selected through D30 and D31.
  • the line input to PLC 2050 labeled valid (D19) is used as a "handshake" line by computer system 240 to signal that the changes requested on the lint cleaner and seed cotton cleaner lines are valid.
  • PLC 2050 is programmed to not output a change in selection of machinery while handshake line D19 is false. If a change to the selection of machinery is requested by computer system 240, the change will not be implemented (i.e., valve settings changed) until handshake line D19 returns to true.
  • Lines GS 1, 2, and 3 In are used to indicate which of one or more gin stands is in position for ginning cotton.
  • Lines DI through D6 are used to input to computer system 240 the number of lint cleaners actually on-line and being used. This number may differ from the number of lint cleaners requested by computer system 240 for two reasons. First, the machinery may be malfunctioning and set offline by the ginner. Second, the number of lint cleaners in actual use may differ from the number requested because automated control may have been disabled at ginner' s control panel 2060.
  • Line D8 input to digital interface 2040 identifies whether automated or manual control of the valves for routing cotton through the lint cleaners has been selected at ginner' s control panel 2060.
  • Line D7 provides an input from a proximity switch typically located on the bale press. This signal cycles once each time the bale press turns to indicate when the lint transitions from being placed in the current bale to being placed in the next bale.
  • Lines D45 through D48 input the position of the four valves used to control the flow of cotton though the seed cotton cleaners (impact cleaners and stick machines) .
  • One of the major problems with measuring physical characteristics of cotton while it is continuously moving in a ginning system is enhancing the density to such a point that a homogeneous surface is achieved in order to make accurate measurements. Inconsistent surface densities create shadows in the imaging process which greatly affects the color and trash readings of the camera. Infrared moisture measurements are also greatly affected by inconsistent surface density. Sensors that respond to changes in resistance and capacitance also respond strongly to surface and/or bulk density.
  • the present invention uses two types of sample collection means to obtain a cotton sample, and to increase the density of the cotton to enable the instrumentation to measure more accurately.
  • the first type of sample collection means is a compression ram 216, installed at Station 1 (see FIG. 2) .
  • Compression ram 216 cyclically displaces a small mass of cotton from its pathway through feed control 220 toward one of the side walls, and presses the mass against the side wall so that the mass presents a face of uniform cotton density. The mass is then analyzed for color, trash content, and moisture content.
  • These piston-type compression rams work extremely well in locations where cotton is moving very slowly such as at feed control 220.
  • a particularly preferred compression-ram type of sample collection means is described in U.S. Patent No. 5,125,279, the entirety of which is incorporated herein by reference.
  • a second type of sample collection means is a paddle sampler 218, installed at Stations 2 and 3.
  • An expanded view of the installation of paddle sampler 218 at Station 2 is shown in FIG. 3.
  • Paddle sampler 218 systematically grasps a quantity of cotton and compresses it against the sensors where measurements are made, and then releases the cotton back into the air stream.
  • the degree of pressing or compression is such that the halted cotton presents a face of uniform density on that part of the cotton which is pressed against the sensor surface .
  • the uniform density is sufficient to enable the mass to be accurately analyzed for color, trash content, and moisture content.
  • the system is typically carried out in an intermittent or cyclic manner so that a different mass of cotton is pressed against the sensor surface at specific time intervals.
  • uniform cotton density means that the face of the mass which is pressed against the sensor surface is essentially filled with cotton and impurities, but with no voids. This enables an analyzer adjacent to the flattened face to make an analysis.
  • Paddle sampler 218 is particularly suited for locations where cotton is moving rapidly, at speeds as high as 6,000 ft/min. A particularly preferred paddle-sampler type of sample collection means is described in U.S. Patent No. 5,087,120, the entirety of which is incorporated herein by reference.
  • computer system 240 uses the measurement data obtained from Stations 1, 2, and 3 to optimize the flow of cotton through the ginning system illustrated in FIG. 2.
  • computer system 240 controls the operation of cotton diversion means 250 associated with each machine.
  • Cotton diversion means 250 is used to route cotton through the optimum drying and cleaning sequence between Stations 1 and 2.
  • Cotton diversion means 250 is also used to route cotton through the optimum cleaning sequence between Stations 2 and 3.
  • Cotton diversion means 250 is used to divert cotton from duct 201 to flow through one or more auxiliary treatment units 202, which are shown in FIG. 2 as containing lint cleaner 160.
  • Cotton diversion means 250 diverts cotton to flow from duct 201, through auxiliary treatment unit 202, and return to duct 201.
  • Each cotton diversion means 250 is coupled to and controlled by computer system 240.
  • Computer system 240 activates cotton diversion means 250 to divert cotton to flow through auxiliary treatment unit 202, and deactivates cotton diversion means 250 to discontinue flow of cotton through auxiliary treatment unit 202.
  • cotton diversion means 250 includes the automated directional valves described below.
  • FIG. 5 A partial view of a ginning system in which the automated directional valves of the present invention are installed with one of several auxiliary treatment units is shown in FIG. 5.
  • a conventional low pressure source such as a fan (not shown) , moves entrained cotton through duct 201.
  • a diversion unit in the form of auxiliary treatment unit 202 is disposed adjacent duct 201.
  • auxiliary treatment unit 202 includes a lint cleaner, shown generally at 160. It is to be understood that auxiliary treatment unit 202 may include other types of cotton treatment machines, for example, a drier, a seed cotton cleaner, or an apparatus for moisture restoration, cotton combing, cotton blending, and the like.
  • the connection of conduits 505 and 507 to duct 201, and the associated automated directional valves, are shown in more detail in FIG. 6.
  • Duct valve 609 is a leaf valve having a leaf 699, and is operated by an air cylinder 629.
  • Air cylinder 629 includes a stationary end 639, and a movable end 649 connected to leaf 699.
  • duct valve 609 is mounted so that leaf 699 may be positioned in a recess 707 in duct 201.
  • Leaf 699 is recessed into duct 201 to prevent cotton from hanging on leaf 699.
  • Supply valve 611 is also a leaf valve having a leaf 791 (see FIG. 7) , and is operated by an air cylinder 621. As best seen in FIG. 7, leaf 791 is mounted in a recess 708 in supply conduit 505 to prevent cotton from hanging on leaf 791.
  • Return valve 613 is also a leaf valve, and is operated by an air cylinder 623.
  • Return valve 613 includes a leaf portion 683 that moves within supply conduit 505, and a leaf portion 693 that moves within return conduit 507.
  • Duct valve 609, supply valve 611, and return valve 613 are each operable between a fully opened position that provides for unrestricted flow, and a fully closed position for complete flow stoppage.
  • "operable between a fully opened position and a fully closed position” means that the valve has two positions of operation, a fully opened position and a fully closed position. These positions are illustrated in more detail in FIG. 7 for duct valve 609 and supply valve 611.
  • leaf 699 of duct valve 609 In a fully opened position 709, leaf 699 of duct valve 609 is positioned within recess 707, out of the cotton flow through duct 201.
  • leaf 699 of duct valve 609 is transverse or perpendicular to the flow of cotton through duct 201.
  • leaf 791 of supply valve 611 is positioned within recess 708, out of the cotton flow through supply conduit 505.
  • leaf 791 of supply valve 611 is positioned transverse or perpendicular to the flow of cotton through supply conduit 505.
  • FIG. 6 illustrates return valve 613 in a fully opened position with leaf portions 683 and 693 aligned to permit unrestricted flow through supply conduit 505 and return conduit 507.
  • leaf portion 683 is positioned transversely across supply conduit 505
  • leaf portion 693 is positioned transversely across return conduit 507.
  • return valve 613 prevents cotton from flowing through supply conduit 505 and return conduit 507.
  • leaf 699, leaf 791, leaf portion 683, and leaf portion 693 are each approximately six inches high by 15 inches wide.
  • the valve leafs are approximately 66 inches or 96 inches wide, rather than 15 inches.
  • the valve leafs shown in FIGS. 6 and 7 are preferably constructed from two pieces of 16-gauge steel, with -inch thick felt (element 713 in FIG. 7) sandwiched between to seal against the sides of the duct.
  • the steel is bolted and welded to a 5/8-inch cold-rolled steel rod that extends beyond one side of the duct to connect to the movable end of the air cylinder (see, for example, movable end 649 of air cylinder 629 in FIG. 6) .
  • a preferred air cylinder is a five-inch stroke, 5/8-inch diameter rod, 1.5-inch diameter air cylinder, such as Speedaire model 6X374, activated by a Humphrey Max-Myte model 345-4E2 solenoid.
  • a diversion mode of operation cotton is diverted from duct 201 to flow through auxiliary treatment unit 202.
  • duct valve 609 is in fully closed position 710 to completely stop the flow of cotton through duct 201.
  • Supply valve 611 is in fully opened position 712 to allow unrestricted flow of cotton from duct 201 through supply conduit 505.
  • return valve 613 is in the fully opened position to provide unrestricted flow of cotton from auxiliary treatment unit 202, through return conduit 507, to duct 201.
  • duct valve 609 is in fully opened position 709 to allow unrestricted flow of cotton directly through duct 201.
  • Supply valve 611 is in fully closed position 711 to completely stop the flow of cotton from duct 201 through supply conduit 505.
  • return valve 613 is in the fully closed position to completely stop the flow of cotton through return conduit 507.
  • Supply valve 611 and return valve 613 are opened to provide communication between duct 201 and auxiliary treatment unit 202.
  • Duct valve 609 is closed to block the flow of cotton through duct 201.
  • Duct valve 609 should be moved from fully opened position 709 to fully closed position 710 sufficiently fast to prevent cotton from hanging between duct 201 and leaf 699.
  • Supply valve 611 and return valve 613 should be opened substantially simultaneously with the closing of duct valve 609 to release the vacuum suddenly created on the upstream side of duct valve 609. This prevents cotton from being pulled around leaf 699 of duct valve 609 to avoid creating a potential blockage.
  • Duct valve 609 is opened substantially simultaneously as supply valve 611 is closed.
  • Return valve 613 is then closed after a pre-determined time delay.
  • the pre-determined time delay is necessary to allow cotton to clear auxiliary treatment unit 202.
  • the time delay may be selected by one of skill in the relevant art to allow for differences in the machinery selected for the auxiliary treatment unit.
  • a time delay of approximately five to eight seconds is suitable when the auxiliary treatment unit consists of a conventional lint cleaner, such as lint cleaner 160 shown in FIGS. 1 and 2.
  • the time required for cotton to enter and exit a machine such as lint cleaner 160 is approximately three seconds, i.e., three seconds is required to "clear" the cotton from the machine. A time delay of five to eight seconds is thus adequate to clear a machine such as lint cleaner 160.
  • cotton that bypasses auxiliary treatment unit 202 after supply valve 611 closes and duct valve 609 opens is mixed for five to eight seconds with cotton that is still flowing through auxiliary treatment unit 202. This results in a "double load" of cotton passing through return connection location 675 for approximately two to five seconds (predetermined time delay minus three seconds to clear auxiliary treatment unit 202) .
  • the pneumatic system in a typical gin should be adequate to handle the momentary overload.
  • Computer system 240 controls the opening and closing of duct valve 609, supply valve 611, and return valve 613.
  • Computer system 240 sequences the valves to transition from the bypass mode of operation to the diversion mode of operation.
  • Computer system 240 also sequences the valves to transition from the diversion mode of operation to the bypass mode of operation.
  • output signals from computer system 240 are transmitted through, for example, solid- state relays on a relay card.
  • a pressure stabilization valve may be disposed in duct 201.
  • a vacuum is produced in duct 201, cotton hangs or stagnates in the vacuum. The cotton can be released back into the flow by allowing atmospheric air to enter the duct.
  • a preferred pressure stabilization valve is a manually- operated slide valve, shown generally at 619 in FIG. 6, that allows air to enter duct 201. As best seen in FIG. 8, slide valve 619 allows air to enter duct 201 through an opening 601 in the wall of the duct.
  • a slide 821 is positioned to control the amount of air that enters through opening 601.
  • Opening 601 may be restricted by a perforated metal covering or a fine mesh screen to prevent extraneous material from entering duct 201.
  • Slide valve 619 can also be used to prevent cotton from stagnating in supply conduit 505. As shown in FIG. 6, slide valve 619 allows air to enter supply conduit 505 through an opening 605. Slide valve 619 usually remains at one setting for a particular machinery and duct arrangement. However, slide valve 619 can be equipped with vacuum switches for automatic control.
  • Auxiliary treatment unit 202 may alternatively include a seed cotton cleaner.
  • duct valve 609 and supply valve 611 may be several feet apart because the inlet and outlet of seed cotton cleaners are typically several feet apart.
  • slide valve 619 is particularly important to prevent cotton from stagnating in the duct between the valves .
  • FIG. 9A An alternate embodiment of the automated directional valves of the present invention is shown in FIG. 9A.
  • a first diversion unit is shown as machine 1, and a second diversion unit as machine 2.
  • Machine 1 is connected to duct 201 through supply conduit 505 and return conduit 507.
  • Machine 2 is connected to duct 201 through conduit 905.
  • three valves are used to divert cotton to flow through machine 1. These valves include a duct valve 909, a supply conduit valve 911, and a return conduit valve 913.
  • Duct valve 909 is operated between a fully opened position and a fully closed position by a rotary actuator 929.
  • supply conduit valve 911 and return conduit valve 913 are operated between a fully opened position and a fully closed position by a rotary actuator 921, and 923, respectively.
  • the diversion and bypass modes of operation for machine 1 are analogous to those described above in connection with the embodiment shown in FIGS. 5-8.
  • a duct valve 917 is operated between a fully opened position and a fully closed position by a rotary actuator 927.
  • a conduit valve 915 is operated between a fully opened position and a fully closed position by a rotary actuator 925.
  • cotton is diverted from duct 201 to flow through machine 2.
  • duct valve 917 is in the fully closed position to completely stop the flow of cotton through duct 201.
  • Conduit valve 915 is in the fully opened position to allow unrestricted flow of cotton from duct 201 through conduit 905.
  • duct valve 917 In the bypass mode of operation, diversion is deactivated to discontinue flow of cotton through machine 2.
  • duct valve 917 is in the fully opened position to allow unrestricted flow of cotton through duct 201.
  • Conduit valve 915 is in the fully closed position to completely stop the flow of cotton from duct 201 through conduit 905.
  • slide valves 619 are provided in duct 201 adjacent duct valve 909 and duct valve 917. Slide valve 619 is located on the upstream side of each duct valve so that, upon entry of the air, cotton is released into the upstream flow. As shown in FIG. 6, slide valves 619 are also used in supply conduit 505 and conduit 905 to prevent cotton from stagnating in these conduits.
  • Computer system 240 may be used to control the valves in the embodiment shown in FIG. 9A in a manner similar to that described above for the embodiment of FIGS. 5-8.
  • FIGS. 9B through 9D Alternate embodiments of the automated directional valves of the present invention are shown in FIGS. 9B through 9D.
  • the embodiments shown in FIGS. 9B through 9D are particularly preferred as cotton diversion means 250 for the seed cotton cleaners shown in the top row of FIG. 2, whereas the embodiments shown in FIGS. 5-9A are particularly preferred as cotton diversion means 250 for the lint cleaners shown in the bottom row of FIG. 2.
  • cotton diversion means 250 In the embodiment of cotton diversion means 250 shown in FIG. 9B, cotton enters under the force of gravity by falling though an opening 930. In this embodiment, air suction is not used to move the cotton. Once the cotton enters through opening 930, it flows through a diverted or active leg, leg 932 shown in FIG. 9B. A valve leaf 942 is in the fully opened position, allowing cotton to flow through leg 932. To close off the flow of cotton through leg 932, valve leaf 942 is rotated about a shaft 943 along an arc 952 to a fully closed position. Movement of valve leaf 942 can be done through use of, for example, a rotary actuator (not shown) mounted on a mounting 950.
  • a rotary actuator (not shown) mounted on a mounting 950.
  • Cotton is prevented from flowing through a bypassed or inactive leg, leg 934 shown in FIG. 9B .
  • a valve leaf 944 is in the fully closed position, preventing cotton from flowing through leg 934.
  • valve leaf 944 is rotated about a shaft 945 along an arc 954 to a fully opened position. Movement of valve leaf 944 can also be done through use of, for example, a rotary actuator mounted on mounting 950.
  • Valve leafs 942 and 944 are moved substantially simultaneously.
  • Valve leafs 942 and 944 may be connected by an adjustable, threaded turnbuckle, or other similar device, so that they move together. Alternatively, valve leafs 942 and 944 may be driven by separate devices .
  • a sponge rubber seal 940 is used to prevent valve leaf 942 and valve leaf 944 from vigorously impacting into the metal sides of leg 932 and leg 934, respectively, as they move to the fully opened position. Use of sponge rubber seal 940 prevents the creation of undue fatigue, as well as noise.
  • Computer system 240 controls the opening and closing of valve leafs 942 and 944. To change the leg through which cotton is diverted to flow, computer system 240 substantially simultaneously directs the valve leaf currently in the fully opened position (valve leaf 942 in FIG. 9B) to close, and directs the valve leaf currently in the fully closed position (valve leaf 944 in FIG. 9B) to open .
  • FIG. 9C A further embodiment of cotton diversion means 250 is shown in FIG. 9C.
  • the configuration of this embodiment is similar to that of FIG. 9B, and only the differences will be noted.
  • Cotton diversion means 250 illustrated in FIG. 9C is equipped with an expanded metal element 960 on leg 934 and leg 932. Expanded metal element 960 is shown in more detail in FIG. 9D. Expanded metal element 960 allows air to flow into a leg when the corresponding valve leaf has been moved away from expanded metal element 960 to the fully closed position. In FIG. 9C, valve leaf 944 is in the fully closed position.
  • suction means such as a fan, is used to draw suction in leg 934, air will flow through expanded metal element 960 and seal 940 to purge cotton from the inactive (bypassed) leg.
  • Seal 940 allows air to pass when suction is drawn on the corresponding leg, but seals against air entering the leg through expanded metal element 960 unless desired by drawing suction.
  • expanded metal element 960 is closed off by valve leaf 942 to prevent air from entering into leg 932.
  • auxiliary suction means such as an auxiliary fan
  • Computer system 240 then substantially simultaneously directs the valve leaf currently in the fully opened position (valve leaf 942 in FIG. 9B) to close, and directs the valve leaf currently in the fully closed position (valve leaf 944 in FIG. 9B) to open.
  • the auxiliary fan is powered for a time period sufficient to purge cotton from the previously active leg. This time period is a function of the length of duct in which the cotton can be trapped.
  • Motion sensors can be used to determine when to turn off the auxiliary fan, or a timer with a predetermined time delay can be used.
  • the auxiliary fan can remain continuously powered, such as when continuous changing between the active and inactive legs is occurring .
  • computer system 240 uses PLC 2050 to control the operation of cotton diversion means 250 associated with each gin machine.
  • PLC 2050 to control the operation of cotton diversion means 250 associated with each gin machine.
  • the process control system of the present invention is implemented by computer system 240 that includes control logic or computer software that directs its operation.
  • the present invention is directed to a computer program product comprising a computer readable medium having control logic (computer software) stored therein.
  • the control logic when executed by processor 404, causes processor 404 to perform the functions of the invention as described herein.
  • the present invention is directed to a program storage device readable by a machine that tangibly embodies a program of instructions executable by the machine to carry out the control process of the present invention.
  • FIG. 10 shows a block diagram illustrating implementation of the process control system of the present invention.
  • the process control system of the present invention is implemented using three software programs: (1) a process control decision and measurement program 1010; (2) a dynamic programming model 1020; and (3) a process control implementation program 1030. These three programs will be described in Sections 3. a., 3.b., and 3.c. below.
  • process control decision and measurement program 1010 and process control implementation program 1030 provide output to a display 1040.
  • Display 1040 includes the display associated with computer system 240, as well as other computer systems or CRTs communicating with computer system 240 via network 418 (see FIG. 4) .
  • the present invention preferably includes a display configured for the ginner' s use (see, for example, FIG. 17b described below) .
  • FIG. 11 A flow diagram of the process steps carried out for Station 1 (see FIG. 2) is shown in FIG. 11.
  • a sample of seed cotton is collected at feed control 220 using, for example, ram 216.
  • the seed cotton sample is measured using camera 212 and moisture meter 214 to obtain sensor data (shown as 1016 in FIG. 10) on color, trash content, and moisture content.
  • sensor data shown as 1016 in FIG. 10.
  • the staple length of the cotton and the maximum lint turnout are not measured. Rather, a reference staple length is input by the operator at the time of processing or as the cotton module or trailer comes into the cotton gin.
  • staple length and turnout are not entered into computer system 240 by the ginner, then the system of the present invention defaults to typical reference values for staple length and turnout stored within dynamic programming model 1020.
  • Such a reference staple length and turnout can be readily determined by one of skill in the relevant art based upon the variety of cotton being processed, the time of harvest, etc.
  • a gin process control decision for the optimum gin machine sequence is made in a step 1106.
  • dynamic programming model 1020 generates a gin decision matrix using cotton quality parameters 1026 and price structure 1024 that are input to a gin model 1022.
  • Step 1106 optimizes the gin machine sequence for drying and cleaning between Stations 1 and 2 for the particular cotton input into the ginning system at feed control 220.
  • Predicted values for the color, trash content, moisture content, staple length, and lint turnout for the cotton after it has undergone the selected drying and cleaning sequence between Stations 1 and 2 are computed and stored in a step 1108.
  • the predicted values are computed using the sensor data values measured in step 1104, the drying and cleaning sequence selected in step 1106, and the effect on each of the parameters by the machines actually used in the selected sequence.
  • the predicted values computed in step 1108 are used in a step 1110 during which an error feedback Error 12 is received (denoted by 1208) and processed.
  • Error 12 is the difference (denoted by ⁇ in FIG. 14) between the data measured at Station 2 for color, trash content, and moisture content, and the predicted values, computed and stored in step 1108, that each of these parameters will have at Station 2.
  • Error 12 is weighted, as denoted in a step 1112.
  • the weight accorded to Error 12 may be zero, in which case Error 12 is ignored, and the error feedback process of the present invention is disabled.
  • the predicted values for color, trash content, and moisture content are adjusted using Error 12 in a step 1114.
  • Error 12 is also used to adjust the decision for the optimum gin machine sequence in a step 1116.
  • the measured values are adjusted by Error 12 , and the decision process is iterated.
  • the error feedback process of the present invention corrects for differences in the performance characteristics of the machinery. This is needed because different machines have different efficiencies, and the performance of each machine also changes with use and over time. Additionally, the ease of removal of foreign matter and moisture differs for varying types of cotton.
  • the error feedback process of the present invention eliminates the need for precise performance characteristic tables or algorithms for each gin machine.
  • FIG. 12 A flow diagram of the process steps carried out for Station 2 (see FIG. 2) is shown in FIG. 12.
  • a sample of seed cotton is collected using paddle sampler 218 after the cotton flows through gin stand 150.
  • the seed cotton sample is measured using camera 212 and moisture meter 214 to obtain sensor data on color, trash content, and moisture content.
  • the measured sensor data is compared to the predicted values computed in step 1108 to determine Error 12 . Error 12 is fed back to Station 1 (step 1110) in a step 1208.
  • Step 1210 optimizes the gin sequence of lint cleaners for cleaning between Stations 2 and 3 for the particular cotton after processing between Stations 1 and 2.
  • Predicted values for the color, trash content, and moisture content for the cotton after it has undergone the selected lint cleaner sequence between Stations 2 and 3 are computed and stored in a step 1212.
  • the predicted values are computed using the data values measured in step 1204, the cleaning sequence selected in step 1210, and the effect on each of the parameters by the lint cleaners actually used in the selected sequence.
  • the predicted values computed in step 1212 are used in a step 1214 during which an error feedback Error 23 is received (denoted by 1308) and processed.
  • Error 23 is the difference (denoted by ⁇ in FIG. 14) between the data measured at Station 3 for color, trash content, and moisture content, and the predicted values, computed and stored in step 1212, that each of these parameters will have at Station 3.
  • Error 23 is weighted, as denoted in a step 1216.
  • the weight accorded to Error 23 may be zero, in which case the error feedback process of the present invention is disabled.
  • the predicted values for color, trash content, and moisture content are adjusted using Error 23 in a step 1218.
  • Error 23 is also used to adjust the decision for the optimum gin sequence of lint cleaners in a step 1220.
  • the measured values are adjusted by Error 23 , and the decision process is iterated.
  • the measured values at Station 3 are also used to verify predicted values for the entire system.
  • FIG. 13 A flow diagram of the process steps carried out for Station 3 (see FIG. 2) is shown in FIG. 13.
  • a sample of cotton is collected using paddle sampler 218 after the cotton has completed processing through the selected sequence of lint cleaners 160.
  • the seed cotton has now been processed into lint.
  • the lint sample is measured using camera 212 and moisture meter 214 to obtain sensor data on color, trash content, and moisture content.
  • the measured sensor data is compared to the predicted values computed in step 1212 to determine Error 23 . Error 23 is fed back to Station 2 (step 1214) in a step 1308.
  • FIG. 10 Each of the three software programs illustrated in FIG. 10 that carry out the process of the present invention will now be described. It is to be understood that the use of three software programs as shown in FIG. 10 is presented by way of example only. The functions of the three software programs could be carried out, for example, in one software program. In a particularly preferred embodiment, the three software programs illustrated in FIG. 10 are combined into a composite software program written in the C programming language. Also, the functionality described below could alternatively be achieved using hardware modules .
  • process control decision and measurement program 1010 is implemented using the C programming language, although other languages can be used.
  • Program 1010 performs the function of selecting the optimum gin process control decision, as indicated by 1012.
  • program 1010 controls the measurement of cotton being processed in the gin, as shown at 1014, to obtain sensor data 1016.
  • Sensor data 1016 includes color and moisture and trash content measurements made on the cotton as it progresses through the gin.
  • Filtering or smoothing of the sensor data measured by the system of the present invention is preferable because there is electrical and other noise inherent in the measurement process, and because an incorrect process control decision can have adverse economic impact on the farmer whose cotton is being processed in the gin.
  • Such filtering or smoothing can be carried out by taking a series of electrical signal measurements over a specific time interval (e.g., 64 measurements during 1/60 second), and using the arithmetic mean of the readings.
  • analog filters can be used to reduce the high frequency noise
  • digital filters can be used to reduce the lower frequency noise as described in R. Bibbero, Microprocessors in Instruments and Control , John Wiley & Sons, Inc. (1977). It is also preferable to require that several, or a plurality of several, consecutive gin process control decisions (1012) be the same before the decision is implemented (1032) .
  • Another preferred method of implementing hysteresis control, and controlling unwanted variability of the output is to use a counter.
  • the counter incremented after every control decision that calls for a first state.
  • the counter is decremented when the control decision calls for a different second state.
  • the first control decision is implemented.
  • the second control decision is implemented.
  • the counter is not allowed to count above or below additional predetermined limits .
  • Process control decision and measurement program 1010 implements the error feedback process of the present invention.
  • the present invention may be used in gins equipped with various configurations and types of machines made by a variety of manufacturers. These machines will also be in varying states of repair.
  • the performance of each of the machines in a particular gin may not be perfectly represented by the tabular or algorithm-based transition functions of the present invention.
  • the error feedback process of the present invention compensates for the error resulting from the difference between the actual performance of the machines in a gin and the mathematical functions used by the present invention.
  • one embodiment of program 1010 measures a set of data (color, moisture content, and trash content) at Station 1, and assigns a time to that set of data.
  • the time it takes, in seconds, for the cotton to get from Station 1 to Station 2 (and from Station 2 to Station 3) as a function of gin machinery sequence is contained in a gin configuration file.
  • the contents of one embodiment of a gin configuration file are shown in FIG. 15.
  • Program 1010 uses the clock contained in computer system 240, along with the time assigned to the set of Station 1 data and the times in the gin configuration file, to track when the cotton measured at Station 1 should be at Station 2. A number of measurements are taken at Station 2 in the vicinity of the computed arrival time.
  • the average of these Station 2 measurements is used to represent the characteristics of the cotton initially measured at Station 1 after processing between Stations 1 and 2.
  • Program 1010 compares the average of the Station 2 measurements to the values predicted from the Station 1 data to generate Error 12 .
  • a similar process may be used between Stations 2 and 3 to generate Error 23 .
  • the error may be weighted using a weighting factor from 0 to 100%. With a weighting factor of 0, the error feedback process of the present invention is "off" or disabled. With a weighting factor of 100%, the Station 2 measurement is averaged one for one with the Station 1 measurement to adjust the predicted values for Station 2 and to adjust the optimum gin machine sequence between Stations 1 and 2. Likewise, with a weighting factor of 100%, the Station 3 measurement is averaged one for one with the Station 2 measurement to adjust the predicted values for Station 3 and to adjust the optimum gin machine sequence between Stations 2 and 3. With a weighting factor of 50%, the measurement at Station l would be weighted twice that of the measurement at Station 2.
  • the measurement at Station 2 is given half the weight of the measurement at Station 1 in adjusting the predicted values for Station 2 and the optimum gin machine sequence between Stations 1 and 2.
  • the measurement at Station 3 is given half the weight of the measurement at Station 2 in adjusting the predicted values for Station 3 and the optimum gin machine sequence between Stations 2 and 3.
  • the weighting factors may be contained in a gin configuration file, such as show in FIG. 15. Measurements at each station are taken at time intervals, controlled, for example, by time delay relays at the measurement stations. In a preferred embodiment, measurements at Stations 1 and 2 are taken every 3 seconds, and once per second at Station 3. All measured data is recorded in an ASCII file.
  • histograms, means, standard deviations, and minimum and maximum values are calculated and stored for each variable .
  • staple length and lint turnout are not measured, the change in the value of these variables is calculated since these variables are affected by machinery in the gin machine sequence.
  • the measurements at Stations 1, 2, and 3 can be used to instantaneously change the machinery sequence, or the changes can be made after a selected time period, or after a selected number of consecutive decisions that require the identical machine change .
  • the machinery sequence can be changed after a pre-determined time interval (e.g., five minutes) has elapsed after the change is identified.
  • the machinery sequence can be changed after a specified number of measurements are taken that all indicate that the machinery sequence should be changed to the same new machinery sequence .
  • Changing the machinery sequence after a selected time period or after a selected number of consecutive decisions provides hysteresis control for the system.
  • four consecutive decisions to change the machinery sequence to the same new machinery sequence are required before the sequence is changed, i.e., before the decision corresponding to the new machinery sequence is implemented by process control implementation program 1030.
  • the number of decisions that are required before the sequence is actually changed is a parameter that can be made available for change by the operator, or can be pre-programmed as a fixed value. In this manner, the system and method of the present invention can be customized to meet the needs of a particular gin.
  • the machine sequence actually being used can be continuously displayed on display 1040, as well as the recommended sequence .
  • Process control decision and measurement program 1010 can also implement an override feature that allows the measurements taken at Station 3 to "override" the decision made at Station 2.
  • Measuring means 210 at Station 3 generally provides the most accurate measurements because the cotton is at the end of the processing sequence and it has been combed and blended several times.
  • program 1010 uses the level of reflectance, yellowness, moisture, and trash content at Station 3 to determine what the gin machinery sequence decision at Station 2 should have been. If the gin machinery sequence decision actually made at Station 2 was different, then the override feature can be implemented so that the gin machinery sequence determined from the measurements at Station 3 overrides the gin machinery sequence decision made at Station 2.
  • the override feature is preferably implemented as a menu option. The override feature can be particularly useful if measuring means 210 at Station 2 is malfunctioning.
  • Process control decision and measurement program 1010 can also implement an automated calibration procedure for calibrating the various instruments of measuring means 210.
  • a particularly preferred autocalibration procedure is described in U.S. Patent No.: 5,639,955 the entirety of which is incorporated herein by reference .
  • program 1010 uses a gin configuration file, such as shown in FIG. 15, to store such items as valve positions, process times for the various gin machines, weighting factors for the error feedback process, time before machine selection can change, and how often to sample or measure data at each of Stations 1, 2, and 3.
  • a screen display for editing the gin configuration file is shown in FIG. 15. The screen display of FIG. 15 is divided into three areas.
  • the area on the left consists of a matrix in which each row corresponds to 13 machines: drier 1 at levels 1, 2, and 3 (1D1, 1D2 , and 1D3 , respectively); cylinder cleaner 1 (CCl) , stick machine 1 (SMI) ; drier 2 at levels 1, 2, and 3 (2D1, 2D2 , and 2D3 , respectively); cylinder cleaner 2 (CC2) ; impact cleaner 1 (IC1) ; and three lint cleaners (LCI, LC2, and LC3) .
  • the three levels for the drier refer to the number of shelves or fraction of the drier that is being used.
  • Each column in the area on the left corresponds to a particular machine sequence character, '
  • machine sequence "R” includes drier 1 at level 1 (1D1) , cylinder cleaner 1 (CCl), drier 2 at level 2 (2D2) , impact cleaner 1 (IC1) , and two stages of lint cleaning (LCI and LC2) .
  • a stick machine (SMI) is not used in machine sequence "R” .
  • the middle area of the screen display of FIG. 15 is organized by rows corresponding to the 13 machines, and columns corresponding to various parameters of each machine .
  • the entry column contains the time in seconds that it takes the cotton to travel from Station 1 (reference point for time measurement) to the valve used to route cotton either through (diversion mode) or around (bypass mode) the particular machine.
  • the exit column contains the additional time in seconds that it takes the cotton to go through the machine (diversion mode) and reach the valve where the cotton reenters the main flow of cotton.
  • the bypass column contains the time in seconds that it takes the cotton to bypass the machine, i.e., to travel between the valve at the entrance to the machine and the valve at the exit of the machine.
  • the filter column contains the time in seconds that a particular machine must be continuously selected (diversion mode) or not selected (bypass mode) before the valve can be switched to the other mode of operation. This filters out momentary changes in the position of the valves that would otherwise occur.
  • valves such as those shown in FIGS. 5-9A, for routing cotton through or around lint cleaners, as well as for valves, such as those shown in FIGS. 9B-9D, for routing cotton through or around seed cotton cleaners .
  • the middle area of the screen display of FIG. 15 also contains a column labeled Weight % .
  • the weight % value is used when cotton diverted through the particular machine reenters the main duct and combines with cotton that had bypassed that machine .
  • the weight % value is used to weight the predicted values of moisture content, trash content, and color based on this mixing of diverted and bypassed cotton. With a weight % value of 1.00, the predicted values are based upon the cotton that was diverted through that machine, and with a weight % of 0.00, the predicted values are based upon the cotton that bypassed that machine .
  • a weight % value of 0.75 results in a predicted value that is equal to the sum of 0.75 times that of the cotton that was diverted through the machine and 0.25 (1-0.75) times that of the cotton that bypassed the machine .
  • a weight % value of 0.5 is preferably used.
  • the third area of the screen display of FIG. 15 (located at the extreme right) is organized into a section for each of measurement Stations 1, 2, and 3.
  • the rate is the time in seconds between requests by computer system 240 for the measurement of data.
  • Computer system 240 requests a new reading from measuring means 210 at a time interval equal to the rate shown.
  • the rate at the three measurement stations does not have to be the same, so that each station can have a rate that is different from the rate at the other stations.
  • Filter is the time in seconds over which the readings from measuring means 210 are averaged. Entry is the time in seconds that it takes the cotton to reach Station 2 or Station 3 from Station 1, assuming the cotton has bypassed all machines.
  • weight in this area of the screen display is used to determine the amount of the error (difference between actual and predicted values) that is fed back to the previous measurement station.
  • the error feedback is computed by multiplying the difference between the actual and predicted values by the weight value, taking the sum, and dividing by the number of sample readings. A weight value of 0.00 disables the error feedback function.
  • FIG. 16 shows one element of a decision matrix for one price structure and the transition function tables provided in Tables 1-15.
  • the gin decision matrix is a three dimensional matrix with the X axis corresponding to moisture content, the Y axis corresponding to trash content, and the Z axis corresponding to color.
  • the moisture content ranges from 3.00 to 10.00 in increments of 0.25.
  • the trash content is represented by a statistical index that ranges from 72 to 100 in increments of 2.
  • the color is represented by color code values from 31 to 73. The cell position at a particular value of moisture, trash, and color will contain a machine sequence character.
  • the machinery configuration that corresponds to the machine sequence character is contained in the gin configuration file discussed above.
  • the complete three dimensional gin decision matrix is composed of many elements, of which FIG. 16 is a representative example, that correspond to all possible combinations of moisture content, trash content, and color.
  • the first stage (Station 1 to Station 2) machine sequence character is either a ' (blank) or character from % A' to ⁇ Z' .
  • the moisture, trash, and color readings from Station 1, adjusted by error feedback if not disabled, are used to enter the gin decision matrix.
  • the first stage machine sequence character located at that cell position is used to determine from the gin configuration file which of the machines between Stations 1 and 2 will be used (diversion mode) and which will be bypassed.
  • the drier sequence character is used in a similar manner to determine the number of shelves to be used in each drier.
  • the second stage (Station 2 to Station 3) machine sequence character determines which of three lint cleaners are to be used in the second stage.
  • the moisture, trash, and color readings from Station 2 adjusted by error feedback if not disabled, are used to enter the gin decision matrix to locate the cell position for the second stage machine sequence character.
  • machine sequence V includes a cylinder cleaner (CCl) , a stick machine (SMI) , and an impact cleaner (IC1) in a first portion of the optimum machine sequence.
  • a "Y” indicates that the particular machine is used in the sequence, whereas a "blank” indicates that the machine is not used.
  • the predicted values of moisture, trash, and color at Station 2 are shown.
  • a second portion of the optimum machine sequence is machine sequence C that includes two stages of lint cleaning (LCI and LC2) . Based upon processing though such a second stage, the predicted values of moisture, trash, and color at Station 3 are shown.
  • FIG. 17a One embodiment of a screen display for the process control system of the present invention is shown in FIG. 17a.
  • This display includes the raw sensor data measured at Stations 1, 2, and 3 , the predicted values for Stations 2 and 3 , and the error feedback for Stations 1 and 2.
  • a reflectance (Rd) of 56.3 and a +b (yellowness) of 8.2 was measured at Station 2 .
  • Rd reflectance
  • +b yellowness
  • a conversion or lookup table can be used to convert between Rd, +b and color codes.
  • Such a conversion table is contained in file UPLND.COL in the attached microfiche appendix.
  • the raw measured data for trash at Station 2 is area 54 (0.54% of the pixels covered by trash) and count 31 (related to the number of pixels covered by trash) .
  • the area and count are converted to a leaf or trash code that ranges from 2 to 8; in this example , code 5.
  • the screen display shown in FIG. 17a contains a line labeled "Filtered Reading" at each measurement station.
  • the moisture reading represents the actual moisture content (percentage) measured at each station, e.g., 6.38% at Station 2.
  • the color code listed for the filtered reading at each station represents the better of the predicted color value based on the measurements made at Station 1, and the actual color measured at Station 3.
  • the most accurate reading of color is made at Station 3 because the cotton has been cleaned and the seeds removed so that a more uniform product is available for measurement.
  • the filtered trash reading is obtained by converting the area and count to a statistical trash index, such as is done by the procedures in the CONTDECF.C file of process control decision and measurement program 1010 described below.
  • the screen display in FIG. 17a also includes the error feedback values for Stations 1 and 2.
  • the error feedback provided to Station 2 (Error 23 ) is +0.14 for moisture, +0.00 for color, and +1.4 for trash. These values are computed using the difference between the predicted and actual values and the weight contained in the gin configuration file for Station 3.
  • the gin machine sequence in use is also displayed in FIG. 17a, including the first stage machines between Stations 1 and 2, and the second stage lint cleaning machines between Stations 2 and 3.
  • the decision matrix file and the gin configuration file being used are also indicated.
  • a particularly preferred embodiment of process control decision and measurement program 1010 is provided in the attached microfiche appendix.
  • This preferred embodiment can be used in a gin having a configuration substantially as shown in FIG. 2, and can be used with the hardware interface shown in FIG. 20.
  • the source code refers to paddle sampler 218 as a "flapper" .
  • This preferred embodiment of process control decision and measurement program 1010 is written to use the embodiment of dynamic programming model 1020 attached hereto in the microfiche appendix.
  • dynamic programming model 1020 algorithmic rather than tabular transition functions are used.
  • the optimum machine sequences are generated by the algorithms, rather than being stored in a table.
  • a gin configuration file is not used in this preferred embodiment of process control decision and measurement program 1010.
  • the attached preferred embodiment of program 1010 is written in the C programming language, and contains a total of 20 files.
  • This file includes a MAIN_SECTION that records the current computer screen display settings, runs a setup procedure, and runs an open menu procedure. When the program returns from the open menu procedure, this section returns the screen to the mode it was in when the program was called, and exits the program. In the setup procedure, output control lines are set to the failsafe condition for the gin, either high or low for a particular line. Files and variables are also initialized.
  • the open menu procedure is the first portion of the code that provides an interface to the user.
  • a menu is displayed so that a user can select one or more functions to be performed.
  • the functions include implementing process control and measurement, performing selected diagnostics, or performing calibrations of the equipment and sensors within the system. If the user selects "0", the system autocalibrates the sensors at Station 2, and returns to the menu. A selection of "9” autocalibrates the sensors at Station 3. If the user selects "1", the system sets the sample collection means at each measurement station for proper operation, and begins to run the data collection and control portion of the program (getdata2 procedure described below) . If the user selects "2", the digital input lines are read, and the values displayed on the screen.
  • the program outputs a varying series of bits to the output data lines as a diagnostic check.
  • a selection of "5", “6”, or “7” results in color calibration of the camera at Stations 1, 2, and 3, respectively.
  • a selection "a", “b” , or “c” results in trash calibration of the camera at Stations 1, 2, and 3, respectively.
  • the user selects "e” the values from A/D converter 2010 are displayed so that the analog inputs can be checked.
  • the user selects "f” a measurement of color and trash is immediately obtained from one of the measurement stations, and displayed on the screen.
  • the user selects "8" the use of data from Station 3 is switched on or off, and the setting is displayed on the screen.
  • a selection of "x" or "X” will exit the program to the operating system (DOS) . Additional functions are possible with the embodiment contained in the attached microfiche appendix, even though these functions are not presented to the user in the menu. For example, if the user enters "d”, the seed cotton cleaner selection is changed, even though this is not listed as a menu choice. If "d” is selected, computer system 240 passes control bits to PLC 2050 to change the selection of seed cotton cleaners. If the user enters "g”, computer system 240 requests PLC 2050 to switch to one lint cleaner. A selection of "h” generates a request to PLC 2050 to switch to two lint cleaners. A selection of "i” cycles paddle samplers 218 between open and closed.
  • DOS operating system
  • a selection of "j" cycles the position of calibration tiles used to calibrate the color and trash sensors at Stations 2 and 3. If the user enters "k” , a tag message is checked. The tag message refers to the bar code information contained on the tag for each bale being processed. A selection of "1" cycles the sample collection means at Stations 1, 2, and 3 as they are done during a data collection phase. Finally, a selection of "m” cycles an additional sample collection means which may be used for infrared moisture measurements behind gin stand 150.
  • the getdata2 procedure is the primary procedure for data collection and process control. It cycles continuously until a function key is pressed to exit the procedure. This procedure starts by clearing the screen and initializing variables. This procedure sets up the frame grabber used in the trash measurement, checks function keys, and also measures analog inputs not related to color or trash. It checks the last moisture content readings to determine if they are within a reasonable range. If the moisture content readings are within a reasonable range, they are left unchanged. If the moisture content readings are not within a reasonable range, the procedure sets them to extreme values to flag them as incorrect readings for other parts of the code.
  • the getdata2 procedure then starts data collection at Station 1.
  • the sample collection means at Station 1 is triggered to collect a sample, the most recent readings from Station 3 are added to the running total so that average values can be calculated, and a "wait closure" for Station 1 is executed.
  • the wait_ closure procedure waits for a certain period of time (time out period) , or until closure of the sample collection means is verified through the use of position or proximity sensors, whichever comes first .
  • time out period time out period
  • the location of the bit that signals whether the sample collection means (“flapper") is closed is read, along with the number of seconds for the wait or time out period. If either the sample collection means is verified to be closed, or the time out period expires, the wait_closure procedure returns to the calling program. A flag is passed back indicating whether verification of closure of the sample collection means was obtained.
  • the getdata procedure collects the data for Station 1. Similar procedures are repeated for Stations 2 and 3.
  • the getdata procedure controls color and trash data collection.
  • the code executes based upon three camera counts of 0 , 1, and 2. The code first sets up the frame grabber channel by switching the multiplexer between the three channels . Trash and color measurements are then made. The trash and color measurements are then analyzed to determine if the readings are within a reasonable range. If the readings are within a reasonable range, they are left unchanged. If the readings are not within a reasonable range, the readings are set to extreme values to flag other parts of the code that the readings are incorrect .
  • the getdata2 procedure also calculates the number of lint cleaners and the sequence of seed cotton cleaning recommended by dynamic programming model 1020. These calculations are made based upon measured values of Rd, +b, and percent area of trash. When measured values of moisture content are within an acceptable range indicating that they are reliable, actual measured values of moisture content are used in these calculations. Otherwise, a value of 5% moisture content is used in the calculations. This procedure also controls the number of decisions or readings that are required before a change in the number of lint cleaners is made. Finally, the getdata2 procedure checks the time of day, and opens a new file for data logging if the date has changed. This procedure also keeps track of when autocalibration is required at each measurement station. If the autocalibration feature is active and it is time for a new autocalibration, the autocal procedure is called.
  • the autocal procedure is written to run automatic calibrations at Stations 2 or 3. Preferably, automatic calibration is performed at Station 1 as well. It would be readily apparent to one of skill in the relevant arts how to modify the attached code to perform automatic calibration at Station 1.
  • the attached autocal procedure code is divided into two sections, one section for each station. The procedure begins by opening and closing the paddle samplers to which the calibration tiles for the sensors are attached. This removes dust that tends to settle on the calibration tiles. The calibration tiles are pulled across a section of lambs wool to clean them before calibration begins. When the calibration routine is completed, the calibration tile paddle samplers are again opened and closed several times to dislodge any cotton that may have been caught on the paddle samplers.
  • the autocalibration procedure is described in more detail in U.S. Patent No. 5,639,955, the entirety of which is incorporated herein by reference.
  • the LCADVl . C includes several procedures for keeping track of bale numbers, and for calculating the means and modes of the measured parameters for each individual bale . ii . COLORF . C
  • This file contains a collection of procedures that relate to color calibration based on a five tile procedure, to color measurement, and to measurement of other variables, such as analog moisture values and analog temperature data, using A/D converter 2010. All readings of A/D converter 2010 are made in this collection of procedures.
  • This file also contains the compute_color procedure for converting to color code from the measured Rd and +b readings .
  • the mcmgr procedure in this file is the moisture content measurement manager software. It controls data collection from the resistance moisture sensors installed at Stations 1, 2, and 3. iii. TRASHF.C
  • This file contains procedures for measurement of trash content .
  • the do_a_frame procedure takes a reading from an individual frame of the channel being pointed to by the video multiplexer that is part of video input 2030. It determines whether an individual pixel should be considered as trash. It counts the number of pixels that are trash in the complete image, and converts this reading to the percent of the total number of pixels that are in the complete image.
  • the file calls a number of library functions that deal with the frame grabber that is also part of video input 2030.
  • This file also contains a number of procedures for calibration.
  • the trsh_cal procedure is for calibration of the trash reading based upon a properly presented trash tile. Adjustments to the Y, Z, and percent area readings based on the calibration tiles are calculated in the calc_ctile_adj procedure.
  • the calc_ctmean procedure takes the mean of several readings of Rd, +b, or percent area and stores them in a matrix. This is used to check he correct readings of the autocalibration tiles. iv . CONTDECF . C
  • This file contains the procedures for calculation or selection of the optimum process control decision using the gin decision matrix generated by dynamic programming model 1020.
  • the ASCII file containing the gin decision matrix generated by dynamic programming model 1020 is opened, and the contents are read into a decision matrix within this C language program.
  • the moisture content readings, as well as those for trash and color, are converted to indices which are then used to point into the decision matrix.
  • the parea_to_clgr procedure converts the percent area measured by the trash meter to an estimated leaf value, used in the pricing of cotton.
  • the scc_lookup procedure uses the values of Rd, +b, moisture and percent area to look up the optimum seed cotton cleaning sequence (between Stations 1 and 2) based on the decision matrix obtained from dynamic programming model 1020.
  • the lc_lookup procedure uses the values of Rd, +b, moisture content and percent area to look up the optimum lint cleaning sequence (between Stations 2 and 3) based on the decision matrix obtained from dynamic programming model 1020.
  • the lc_check and rule_of_thumb procedures are similar procedures used to adjust the decision relating to the number of lint cleaners being used to ensure that revenue is maximized. These two procedures use price structure 1024, as well as color and trash data from Station 3, to refine the decision for the number of lint cleaners based upon the level of cleaning actually achieved so that revenue is maximized. These two procedures ensure that in the region of a break point in price structure 1024, sufficient cotton cleaners are being used so that revenue will still be maximized, v. DGTLIOF. C
  • This file contains procedures used in digital input and output (I/O) .
  • the main section of this code provides bitwise communication with PLC 2050, control of the sample collection means, and reading of the position sensors throughout the system. Additionally, procedures are provided for reading files on network 418 for communication with other computers that are measuring parameters associated with the gin system (kp_f_read and kp_f_write procedures) .
  • kp_f_read and kp_f_write procedures are provided for reading files on network 418 for communication with other computers that are measuring parameters associated with the gin system.
  • some gins are equipped with a gin computer into which the ginner will enter data that is contained on tags attached to the modules or trailers of seed cotton entering the gin. This tag data may include, for example, the name of the farmer, the variety of cotton, the farm number, the field number, and the harvest date.
  • the tag data can be transmitted via network 418 from the gin computer to computer system 240.
  • the kp_f read and write procedures can be used to display and record the tag data .
  • the kp_f_ write procedure stores enough data to completely describe the current functioning of the system including: the tag data, the temperature of each of the dryers, the position of each of the seed cotton and lint cleaners, whether each gin stand is "in” or "out,” the moisture content of the cotton at several places in the gin, the color and trash level of the cotton being ginned, the ginning rate, the bale number, and the mean value for the moisture, color, and trash of the last 10 bales .
  • This information can be monitored from any computer on network 418 and displayed in near real time.
  • the tag data can also be used in determining the optimum process control decision.
  • default values for staple length and micronaire can be stored in a lookup table as a function of variety.
  • the default value to be used by dynamic programming model 1020 for these two parameters can be obtained from such a lookup table after obtaining the variety from the tag data.
  • the flapper procedure is used to control the flappers or sample collection means such as paddle sampler 218 or compression ram 216. Individual flappers can be opened or closed one at a time, or all flappers can be opened and closed at the same time.
  • the calflap procedure controls movement of the flappers associated with the calibration tiles.
  • the chk_tagmsg procedure checks for a new bale tag message .
  • the bale tag message is created by a computer at the bale press that reads the bar code tag that is attached to each bale of cotton.
  • the bale tag message includes the bale number as well as the bale weight .
  • the computer at the bale press sends the bale tag message to computer system 240 via network 418. If a new bale tag message is available on network 418, this message is read and stored by computer system 240 in a file, and the network file is erased.
  • the chk_bc procedure monitors the state of a switch, usually a proximity switch attached to the bale press, to determine when bales are changed. This procedure reads the time at which the bale press turns , which is the exact moment that cotton is switched from the current bale into the next bale .
  • the procedure provides for software debouncing to accommodate the bouncing encountered with mechanical switches .
  • the chk__lcu procedure reads the current number of lint cleaners for each of the gin stands, and the number of seed cotton cleaners being used, as transmitted to computer system 240 by PLC 2050.
  • the CompOK procedure provides a safety feature so that other computers or components in the system can detect if computer system 240 is not functioning properly.
  • the code alternately switches one bit between high and low that resets a monostable multivibrator. If the code is operating properly, the monostable multivibrator will be continuously reset to the computer OK state. However, if the software stops proper operation of the computer, the monostable multivibrator is not reset, and this bit changes to an error condition that can be sensed by other computers or components in the system to detect that computer system 240 may not be functioning properly.
  • the wait_samp_open, wait_cal_closed, and wait_cal__open procedures all operate in a manner similar to the wait_closure procedure discussed above.
  • the byte and the bit signaling the opening (or closing) of the sample collection means (“flapper”; paddle sampler 218 or compression ram 216) ) , and a maximum number of seconds (time out period) the software is allowed to wait for the flapper to open, are read.
  • This procedure reads the current state of the flapper as sensed by the proximity or position sensors, checks for keyboard function key entries, signals the monostable multivibrator not to time out, and checks the time.
  • DISPLAYF.C This file displays information for the ginner on the display of control system 240 relating to the operation of the machinery, the process control decisions, how the control decisions are reached, and the bale averages for the past ten bales.
  • the showCT procedure displays, for example, the data (color, trash, and moisture contents), current decisions, and current operating conditions (gin machine sequence currently being used) .
  • the showBA procedure displays data on the last ten bales processed through the gin.
  • the showCalBa procedure displays calibration and other data in the same area where the bale average data is normally displayed. vii.
  • LOGDATAF.C This file contains procedures for logging data to hard disk drive 412 of computer system 240 and network 418. The procedures ensure that files are opened under unique names based on the date, and the files that have already been opened on that date. If a file is available on network 418 and hard disk drive 412, then the data is written to both locations. viii. ".H" Files
  • the attached microfiche appendix contains twelve ".H” files which are external files that are included into the seven ".C” files discussed above. These files are used to include other files that are part of a Microsoft C package, files that are part of a color and trash measurement system obtained from MCI , and files that are part of a frame grabber system obtained from Catenary Systems .
  • HVICONST.H contains code that defines values and structures for the MCI color and trash measurement system.
  • CAINC.H contains many of the external "includes.”
  • the three files “vicdefs.h, vicfcts.h, and vicerror.h” are part of the Victor Software Library for the frame grabber card.
  • the three files “hviconst .h, hvimain.h, and driver. h” are part of the MCI package for the color and trash measurement cameras .
  • the remainder of the files that are included in CAINC.H are part of the basic Microsoft C package. These are all files that contain drivers and software for the hardware in the system, as well as the operating system.
  • CADEF.H contains many of the "defines” used throughout process control decision and measurement program 1010. The defines in this file are addresses and unchanging variable values.
  • CAEXT.H contains declarations for all the global variables that are used in program 1010.
  • the CAPROTO.H file contains the seven "include” files that have the declaration of the types for each of the seven ".C” files . They are located in separate files that correspond to the source code files that contain the C source code.
  • the ColorPrt.h file contains the declarations for the procedures contained in the COLORF.C file. The declarations pertain primarily to color measurement and color calibration, but also include declarations of all the analog data collection that is used in the system.
  • the TrashPrt.h file contains declarations for the procedures related to the frame grabber and trash measurements used in the TRASHF.C file.
  • the ContDPrt.h file contains declarations for procedures used in the CONTDECF.C file.
  • the DgtIIPrt.h file contains declarations for all of the procedures used in the DGTLIOF.C file for digital input and output (e.g., opening and closing flappers for sample collection as well as the bitwise data transfer between PLC 2050 and computer system 240).
  • the DisplPrt.h file contains declarations for the procedures used in DISPLAYF.C to display data on the computer display in the gin.
  • the LcadvPrt.h file contains declarations for the procedures used in LCADVl.C. The declarations for these procedures are related to control of data collection, calculation of means and modes of the collected data, and execution of autocalibration procedures.
  • the LogDaPrt.h file contains declarations for the procedures contained in LOGDATAF.C.
  • FIG. 17b An alternate embodiment of a screen display for the process control system of the present invention is shown in FIG. 17b.
  • the screen display shown in FIG. 17b is representative of a display that would be provided for the ginner in a gin equipped with the preferred embodiment of process control decision and measurement program 1010 described immediately above.
  • the gin is actually equipped with three parallel gin machinery sequences, identified as Gin 1, Gin 2, and Gin 3.
  • FIG. 17b shows in the upper left hand corner, beneath the date/time display, that 1 cleaner (lint cleaner) is in operation for each of Gin 1, Gin 2, and Gin 3.
  • FIG. 17b shows 1 Cleaner Recommended, i.e., the optimum gin machine sequence requires the use of one lint cleaner.
  • Working On Station 1 indicates that color, trash content, and moisture content readings are being taken at Station 1.
  • the table in the upper right hand portion of FIG. 17b provides the current values of Color, %Area, and Moisture at Stations 1, 2, and 3. Rather than displaying the measured Rd and +b values, these values are transformed and displayed as color code and quadrant .
  • the %Area and Leaf table that appears in the lower left hand corner of the FIG. 17b display provides a simplified transformation between the %Area trash measurement values and a manual leaf grade classification standard. This is provided as a quick reference guide so that the ginner can quickly correlate the %Area readings being displayed to a standard leaf grade classification.
  • the table in the lower right hand corner of FIG. 17b provides a history of the last 8 bales for the ginner .
  • the show BA procedure discussed above is written to display the last 10 bales .
  • This procedure could be readily modified by one of skill in the art to display a history of the last "N" bales as selected by the ginner.
  • a bale is processed through a sequence such as the one shown in FIG. 2 approximately every two minutes.
  • the lower right hand table in FIG. 17b provides the ginner with data from approximately the previous 16 minutes of operation.
  • the first column identifies the bale number.
  • the second and third columns display the average values of color and leaf grade for each bale at Station 2 (Before LC - Lint Cleaner) and Station 3 (After LC - Lint Cleaner) , respectively.
  • the average moisture value for each bale at Stations 1, 2, and 3 is also displayed.
  • the screen display shown in FIG. 17b could be readily modified by one of skill in the art to display additional information for a ginner.
  • additional information could include, for example, bale weight, gin rate, and bale moisture content .
  • dynamic programming model 1020 is a program separate from process control decision and measurement program 1010.
  • dynamic programming model 1020 is implemented using the FORTRAN programming language and is run off-line to generate the gin decision matrix prior to running process control decision and measurement program 1010.
  • dynamic programming model 1020 is written in the C programming language and is incorporated into process control decision and measurement program 1010 so that dynamic programming model 1020 is running in real-time rather than off-line.
  • Dynamic programming model 1020 includes a gin model 1022 that uses price structure 1024 of the cotton as an input .
  • Dynamic programming model 1020 uses price structure 1024, cotton quality parameters 1026, and the performance characteristics for each gin machine to determine the optimum machinery sequence to maximize returns to the producers.
  • Color grade is a step function of values such as 21, 31, 41, 51, etc.
  • the present invention tracks two components of color, Rd and +b, which are continuous functions.
  • a conversion or lookup table is used to convert between Rd, +b and color grades. Such a conversion table is contained in file UPLND.COL in the attached microfiche appendi .
  • Monetary returns are a function of the quality of lint cotton after ginning, and are determined by color grade, leaf grade, staple length and micronaire .
  • the staple length and micronaire fiber qualities are established before the cotton is removed from the plant .
  • the micronaire is influenced only minimally by gin machinery, but the length is affected by the degree of drying and cleaning.
  • the color of the cotton is strongly influenced by the weathering effects in the field. Gin machines, especially lint cleaners , tend to comb and blend the cotton and have been shown to improve the color grade .
  • Lint turnout normally expressed in percent, is the ratio of the weight of lint to the weight of the seed cotton before removal of the cottonseed moisture, and foreign matter. Lint turnout is a function of the genetic characteristics of the cotton and of the amount of foreign material in the cotton. Thus, the return to a producer for a given quantity of seedcotton with a specific staple length and micronaire is a function of the lint turnout, color grade, and leaf grade .
  • Dynamic programming is used to model the ginning process to determine which combination of ginning operations maximize the return from the cotton. Dynamic programming can be applied to many problems that can be structured as a multistage system, and ginning can be considered a multistage system in which each operation represents a stage. A schematic of the ginning process is shown in FIG. 1. The gin stand 150 and bale press 170 stages are always required, and the other processes are optional.
  • the objective of dynamic programming model 1020 is to maximize the net return; i.e., the revenue from the lint cotton minus the costs of the ginning operations.
  • the variable "Fi ( RD j , PBi, LFi LNi i Ti ) " is used to represent the net return from 100 pounds of seed cotton, assuming that cotton enters the gin just before operation i, that it is in state "RDi, PB i; LF ⁇ LN i M ⁇ T A " and that optimal decisions are made at operation i and at all operations that follow it in the gin. Any revenues or costs that do not vary with the decisions (e.g., revenue from seed cotton and cost of operating the gin stand) are not included, since they will not affect the optimum decisions.
  • the operations of the gin alter the state of the cotton.
  • the state at the output of any operation i is a function of the input state and the decision (D) at that operation: i.e.,
  • T.' t, (RD, , PB, , LF, , LN, ,M,,T,, D.) ,
  • RD, ,PB1,LF!,LN! '.hi!, and T represent the output state variables.
  • the transition functions for each operation may be represented by performance tables or equations, as discussed in more detail below.
  • the output state of one operation is the input state of the following operation.
  • Fp(RDp.PBp.LFp. ip.Mp.Tp) (T p / I00)x( PRICEfRDp.PBp.LFp. ip.Mp ))x!00.
  • PRICE ( R ⁇ )p , PBp • LF , LNp ) price per pound of lint of grade
  • RDP Reflectance at the press Moving backward through the system shown in FIG. 1, the next operation is the lint cleaners.
  • the decision at this operation is to use zero, one, or two lint cleaners. The number is determined from
  • COSTE Cost per unit of electricity.
  • E L (RD L , PB L > LF L , L , M L ) the amount of electricity required to operate one lint cleaner, varies with the color, trash, length and moisture content of the cotton at the input of the lint cleaners.
  • the electrical energy consumption (W-h/kg) for the various types of gin machinery as a function of color grade, leaf grade, and moisture content is shown in Table 1.
  • COSTE is the cost per unit of the electricity. At the gin stand, no decision is to be made since the gin stand must be included. However, the gin stand changes the state of the cotton so it must be included in the analysis. Thus,
  • FG(RDG,PBG,LFG,LNG>MG>TG) FL(RDG,PBG,LFG / ,LNC , ,MC,TG),
  • RDG to (RDG . PBc . LFG , LN G . MG , To )
  • Gin model 1022 is used to solve the problem.
  • the state variables for each operation are permitted to vary over the ranges and increments shown below:
  • the optimal decision for each possible input state is stored as a six-dimensional array or matrix in an ASCII file (gin decision matrix) .
  • the program can start at the first operation (first drier shown in FIG. 1) with a particular input state, and then use the transition functions to move sequentially through the operations and identify the optimal decision for each one.
  • the optimal ginning sequence can be determined from the state of cotton when it enters the gin.
  • Table 2 illustrates the possible decisions, transition functions, and optimal return functions for each ginning operation.
  • the transition functions of Table 2 are implemented using a series of tabular values, such as those contained in Tables 3 through 15.
  • Tables 3-15 were developed using three state variables, composite grade (G) , moisture (M) , and turnout (T) .
  • USDA U.S. Department of Agriculture
  • MI moisture
  • T turnout
  • Tables 3 through 15 provide performance tables for the various types of gin machinery based on the state variables of composite grade, moisture content, and turnout.
  • Table 3 quantifies the effect of one lint cleaner by providing the final composite grade as a function of the initial composite grade and moisture content.
  • Table 9 quantifies the effect of one lint cleaner by providing the turnout as a function of the initial composite grade and moisture content.
  • Tables 3-15 can be used to generate a gin decision matrix containing machine decisions as a function of moisture and initial composite grade.
  • a typical decision matrix for a market price based on Strict Low Middling at $0.70 per pound and a maximum color grade of Middling is shown in Table 16.
  • the machinery specified by the sequence codes in Table 16 is identified in Table 17.
  • the gin decision matrix is written by dynamic programming model 1020 into an ASCII file that is read by process control decision and measurement program 1010.
  • the machinery sequence file such as that shown in Table 17, can be part of process control decision and measurement program 1010.
  • Table 18 shows a comparison of typical returns for the USDA recommended sequence and the model sequence generated by dynamic programming model 1020 and Tables 3-15.
  • the dollar values are based upon an input of 1001b of seed cotton. Typically in the United States, 1500 lb of spindle harvested seed cotton is needed to produce a 500 lb bale of lint. Thus, the increased dollar value with use of the present invention can be on the order of $7- $23 per bale.
  • dynamic programming model 1020 the six state variables of leaf, Rd, +b, moisture content, staple length, and turnout are used, and the transition functions of Table 2 are implemented through algorithms contained in subroutines of dynamic programming model 1020.
  • a particularly preferred embodiment of dynamic programming model 1020 is contained in the attached microfiche appendix. This source code uses a set of state variables as follows :
  • a suffix of "T” indicates the "INT” or initial condition of the variable
  • a suffix of "L” indicates the actual condition of the variable after processing through the respective machine
  • a suffix of "M” indicates the maximum condition of the variable after processing through the respective machine.
  • each variable Before processing by a machine, each variable has an initial value .
  • the variables are then processed through a machine using the transition functions to produce the "L" suffix variables. If the "L" suffix variable is better with the machine than without the machine, this variable then becomes an "M” suffix variable.
  • the initial value for the next machine is set to be the value that came out of the previous machine .
  • Subroutines OPT and OPTM carry out the transition and optimal return functions identified in Table 2 by cycling through the subroutines for the various machines.
  • Subroutine OPT does a complete enumeration of all possible solutions.
  • Subroutine OPTM retains the optimum or maximum values found from subroutine OPT.
  • dynamic programming model 1020 operates in an "interactive" mode by evaluating the transition functions for only one specific value of each state variable, as input, for example, by the user. The computations are made based on one value for each state variable, and the optimum gin decision for that value of the state variables is generated. In this manner, the optimum gin decisions are being generated one at a time, in real-time.
  • This embodiment of dynamic programming model 1020 is contained in file COTTON. C in the attached microfiche appendix.
  • this embodiment of dynamic programming model 1020 can be implemented in the FORTRAN programming language.
  • dynamic programming model 1020 operates in a "batch" mode by generating decisions using the entire value range for each state variable.
  • This embodiment of the program evaluates all possible combinations of state variables within the value and increment ranges given above, and generates all possible decisions which are stored in a gin decision matrix.
  • the primary difference between this embodiment of dynamic programming model 1020 and that contained in file COTTON. C is in the MAIN routine which iterates to cover the entire range of values for the state variables .
  • the MAIN routine for the batch embodiment is contained in file COTTONL.C in the attached microfiche appendix.
  • the data used by COTTON. C and COTTONL.C is contained in the attached files DRIER.DAT, GREENE. CCC, and UPLND.COL.
  • the optimum decisions for the range of input cotton properties are output to two files: LCDEC95A.OUT; and SCCD95A.OUT.
  • the data file LCDEC95A.OUT has the optimum decisions for the lint cleaner portion of the gin (between Stations 2 and 3) and data file SCCD95A.OUT has the optimum decisions for the seed cotton cleaning portions of the gin (between Stations 1 and 2) .
  • Gin control including data collection and display, is implemented through the set of "C" language instructions contained in the seven “.C” files and 13 external included " .H” files discussed above in Section 3. a, using the decisions in LCDEC95A.OUT and SCCD95A.OUT. Data on the current operation of the gin is written to the files: BDATF.DAT; BA.DAT; and 0THER.DAT. These files are also read by the control program upon initialization to determine initial settings.
  • Each machine in FIG. 2 has a corresponding subroutine in dynamic programming model 1020. If the particular machine is not used in a sequence, then the set of state variables is unaffected by that machine. If the particular machine is used in a sequence, then the subroutine contains an algorithm that indicates how the set of state variables is affected by that machine. A particular machine may not affect each of the state variables so that only the affected variables are adjusted in the machine subroutine. For example, the various cleaners do not affect the moisture content of the cotton. Consequently, the moisture after each of the cleaners (SML) will be the same as the moisture going into that particular cleaner (SM) . As another example, driers have a great impact on the moisture content of the cotton, but do not affect the color.
  • the cotton properties identified by the set of state variables are affected by a cylinder cleaner (subroutine CC) as follows:
  • the cotton properties identified by the set of state variables are affected by a gin stand (subroutine GINSTD) as follows:
  • the cotton properties identified by the set of state variables are affected by an impact cleaner (subroutine IC) as follows:
  • the cotton properties identified by the set of state variables are affected by one lint cleaner (subroutine LC) as follows:
  • the cotton properties identified by the set of state variables are affected by two lint cleaners (subroutine LC) as follows:
  • the cotton properties identified by the set of state variables are affected by a stick machine (subroutine STMCH) as follows:
  • the cotton properties identified by the set of state variables are affected by a drier (subroutine DRIER) as follows :
  • a table of values can also be used to determine the affect on moisture of the drier (see Table 19) .
  • Table 19 includes the moisture content after drying at temperatures of 65.5, 93.2, 120.9, and 131°C as a function of initial moisture content before drying. This data is accessed by dynamic programming model 1020 through the DRIER.DAT file in the microfiche appendix. If the moisture of the cotton that is input to the drier (SM) is in the range of 4-14%, then subroutine TABLI2 determines the moisture content of the cotton after drying (SML) . If the moisture is out of range, then the closest in-range value (either 4% or 14%) is used as a default.
  • the present invention can be configured to vary the temperature of the driers, for example in increments of 50 F.
  • the present invention can also be configured to bypass all of a drier, or to use a portion of a drier, for example ⁇ (6 shelves) or . (12 shelves) .
  • Dynamic programming model 1020 uses a standard subroutine
  • a subroutine CHGSYS is provided so that a user can input the status of the gin machines .
  • the present invention can be customized for use in various gins with varying configurations of ginning machines.
  • the monetary return or value of the cotton is calculated by the function CLINT.
  • One example of price structure 1024 is included in the GREENE.
  • CCC file in the attached microfiche appendix.
  • the GREENE. CCC file contains premiums and discounts that are used to adjust a base price of cotton.
  • the premiums and discounts in the GREENE.CCC file are for a given color grade, leaf grade, and staple length as set by the Commodity Credit
  • CCC Corporation
  • the base price of the cotton is coded into dynamic programming model 1020 as the cost per pound, and the values in the GREENE.
  • CCC file are divided by 100 and added to the base price. Negative entries in the GREENE.
  • CCC file represent discounts that reduce the base price.
  • Price structure 1024 may be from any source, as long as it is in a format compatible with dynamic programming model 1020.
  • FIG. 18 shows an output of optimum ginning decisions from dynamic programming model 1020.
  • "Input States" refers to the state of each of the state variables at the input to the machine listed in that row of the table.
  • Table 18a shows a comparison of typical returns for the USDA recommended sequence and the model sequence generated by dynamic programming model 1020 using the algorithms described herein.
  • the dollar values are based upon an initial input of 100 lb of cotton, having a price of $0.7960 per pound.
  • the increase in dollar value using the system and method of the present invention can be on the order of $13-$34 per bale.
  • transition functions or performance algorithms for smooth- and hairy-leaf varieties have statistically different coefficients for trash and turnout .
  • Using algorithms that take into account this cleanability characteristic reduces the need for error feedback.
  • the predicted values of the state variables more closely approximate the actual values of the state variables when separate algorithms having different coefficients are used for smooth- and hairy-leaf varieties of cotton.
  • two sets of algorithms are used, one for smooth-leaf varieties of cotton, and one for hairy-leaf varieties of cotton.
  • the variety of cotton (part of the module tag data) is input to computer system 240 either directly, or via network 418 from the gin computer (see Section 3. a.v. above) .
  • Process control decision and measurement program 1010 uses a lookup table to identify by variety of cotton, a reference staple length and whether that variety is smooth-leaf or hairy-leaf . The values in such a lookup table would be readily apparent to one of skill in the relevant art.
  • Dynamic programming model 1020 then uses the reference staple length and the appropriate smooth-leaf or hairy- leaf algorithms to generate the optimum gin decisions.
  • the smooth-leaf algorithms are obtained by modifying the algorithms, i.e., the coefficients of the state variables, given above as follows. Any equation not changed remains as given above .
  • the hairy-leaf algorithms are obtained by modifying the algorithms, i.e., the coefficients of the state variables, given above as follows. Any equation not changed remains as given above .
  • the error feedback data (Error 12 , Error 23 and associated predicted values) are used to modify the coefficients of the state variables in the algorithms. This reduces the amount of error, and Error 12 and Error 23 would eventually approach zero with predicted values equal to actual values .
  • One way to modify the coefficients in the algorithms using the error feedback data is through the use of a neural net .
  • neural net is meant a computer program that recognizes patterns and is designed to take a pattern of data and generalize from it .
  • a neural net typically takes pairs of input and output data and matches them, thereby "training" the neural net. Once a neural net has been trained, new data can be input and the net will output a learned response.
  • Process Control Implementation Program 1030 is implemented using the C programming language as part of process control decision and measurement program 1010.
  • the embodiment of process control decision and measurement program 1010 attached hereto in the microfiche appendix includes the code for carrying out process control implementation program 1030.
  • implementation program 1030 may be a separate program that is called by process control decision and measurement program 1010.
  • Program 1030 performs the function of implementing the selected optimum gin process control decision, as indicated by 1032 (see FIG. 10) .
  • program 1030 controls valves, such as the automated directional valves of the present invention, to route the cotton through the selected machinery sequence, as shown at 1036.
  • Program 1030 uses valve position sensor data 1034 to verify proper valve position. If a change of valve settings is to be made, program 1030 uses valve position sensor data 1034 to determine what change needs to be made.
  • the appropriate valve control signals 1036 are sent to cause power units, such as air cylinders, rotary actuators, hydraulic motors, electric motors, etc. to be activated to change the position of the valves.
  • PLC 2050 (see FIG. 20) is used to send valve control signals 1036 to change the position of the valves.
  • Program 1030 causes signals to be sent from computer system 240 through digital interface 2040 to PLC 2050 to control the valves that put the selected machinery sequence on-line.
  • Lines D17 and D18 output from digital interface 2040 are used by computer system 240 to request that selected lint cleaners be put on-line.
  • Lines D30 and D31 output from digital interface 2040 are used by computer system 240 to request that selected seed cotton cleaners (e.g., impact cleaners and stick machines) be put online.
  • Output line D19 is used by computer system 240 as a handshake line with PLC 2050 to ensure that the request is valid.
  • the PLC_scc and PLC_lc procedures are used to control the signals sent to PLC 2050 that control the request for seed cotton cleaning equipment and lint cleaning equipment, respectively.
  • it can either: (1) set the handshake signal (D19) to untrue, meaning the value on the request lines (D17, D18, D30, and D31) is invalid and no change should be made; or (2) set the handshake signal to true, and set the request lines for 0, 1, 2, or 3 cleaners, meaning that the value is valid and the bits represent proper data for the number of cleaners (seed cotton or lint) to be used.
  • PLC 2050 is programmed to carry out the instructions generated by process control implementation program 1030.
  • PLC 2050 is programmed to continuously check the settings of the cleaner request lines (D17, D18, D30, and D31) while computer valid line (D20) remains true, and after handshake line D19 returns to true . If the settings of the cleaner request lines have changed, and the switch on ginner' s control panel 2060 has been selected for automated control, then PLC 2050 initiates the change in valve settings required to carry out the request for the selected machinery. Once a change in valve settings is initiated by PLC 2050, further changes are not accepted by PLC 2050 until the current change is complete .
  • the ginner may turn power off to certain machinery that is usually in the bypass configuration, such as seed cotton cleaners in excess of the number typically used.
  • PLC 2050 may be programmed to check if power is applied to a particular piece of machinery before signaling the valve for that piece of machinery to change from the bypass position to the diversion or on-line position.
  • Valves are used to control the flow of cotton through the gin.
  • the valves are positioned to route the cotton through a selected machine (the diversion position with the machine on-line in the cotton flow) , or to route the cotton so that it bypasses a particular machine (the bypass position) .
  • Particularly preferred valves are the automated valves of the present invention, described above with respect to FIGS. 5-9.
  • Proximity switches or sensors are installed on the valves that control the flow of cotton. Suitable proximity switches include those that are installed on the outside of an air piston cylinder to sense the position of the piston in the air cylinder that is used to control the position of the valve (see, for example, air cylinders 621, 623, and 629 in FIG. 6) .
  • Other suitable proximity switches include commercially available reed relay and magnet switches.
  • the magnet is preferably mounted on the shaft of the valve .
  • the reed relay and magnet switches are more sensitive to valve position, more flexible in mounting position, and more sensitive for detecting a larger range of error conditions.
  • a particular valve may be equipped with more than one proximity switch or sensor so that the system could detect whether the valve is positioned in the fully opened or fully closed position. Internal sensors on the cylinders and actuators could alternatively be used.
  • PLC 2050 sends a signal to the air cylinder controlling that valve to either extend or retract, thereby changing the position of the valve in the desired manner.
  • the interface between the air cylinder and PLC 2050 can be done in a conventional manner, and is omitted for brevity.
  • PLC 2050 reads valve position sensor data 1034 to determine the actual valve position. While the position of a valve is being changed, valve position sensor data 1034 indicates that the valve is neither open nor closed. If the valve becomes jammed, or cotton prevents the valve from moving fully into the requested (open or closed) position, PLC 2050 senses an error condition. The error condition signals for operator assistance.
  • Computer system 240 controls the opening and closing of the automated valves of the present invention.
  • PLC 2050 is programmed to sequence the valves to transition from the bypass mode of operation to the diversion mode of operation, and to sequence the valves to transition from the diversion mode of operation to the bypass mode of operation.
  • the valves are transitioned without stopping the flow of cotton through the gin.
  • Computer system 240 directs PLC 2050 to change the positions of the automated valves of the present invention while cotton is flowing through the system.
  • control hardware is provided at ginner * s control panel 2060 that preferably includes a thumbwheel switch that can be set to indicate the number of lint cleaners being used. For example, a thumbwheel switch setting of "0" would indicate that no lint cleaners were being used, a setting of "1" would indicate one lint cleaner, etc.
  • the control hardware also preferably includes a push button switch to lock in the lint cleaner selection made through use of the thumbwheel switch.
  • a series of indicators is included in the control hardware . Each of the lint cleaners has an indicator that indicates whether that lint cleaner has been selected for operation. A "not ready” indicator is also preferably provided that comes on when a new lint cleaning configuration is chosen and stays on until all the valves have been set and the system is ready to resume ginning.
  • a set of switches can directly communicate with PLC 2050 to allow the gin operator to select any or all of the valve settings, overriding whatever optimum selection has been indicated.
  • FIG. 19a shows a ladder diagram for programming a PLC to sequence the valves to transition between the diversion and bypass modes of operation.
  • each line where a function or action is performed starts with a set of double lines that represents a relay or switch contact. If the contact is closed, the function on that line is executed.
  • a relay is indicated in FIGS. 19a and 19b through the use of ( res ) or ( set ) .
  • Line 01 starts by determining whether the control computer is okay.
  • Subroutine 01 is called to determine if the control switch settings have changed.
  • Line 02 starts by determining whether there is a new control switch setting. This contact is labeled "0101" which corresponds to the "new setting” relay in line 06.
  • Line 02 turns on the "not ready” light and calls subroutine 02 to decide the outputs for the new valve settings.
  • Line 03 includes a timing relay, represented by two lines enclosing a "T" and spaces for the number of the relay. Above the relay is a number for the delay time in seconds, typically 5-15 seconds.
  • the timing relay in line 03 is used to allow a delay between the changing of each valve. This prevents the valves from physically interfering with each other, and also prevents small voltage surges and errors. After the valves are set, subroutine 03 is called to check if the valves are set properly.
  • Line 04 is executed last.
  • the indicators for the lint cleaners being used are set, and the "not ready” light is turned off.
  • Line 06 includes a relay contact for the new control switch setting.
  • Line 06 also includes two logic symbols, represented by " ⁇ >". The first is a " ⁇ cmp >” that compares the new switch setting to the old switch setting. The second is a “ ⁇ sta >” that stores the new switch setting if it is different.
  • Subroutine 02 is contained in line 09.
  • Line 09 sets new outputs for the valves. This is done by providing a control signal to the air solenoids that change the position of the valves .
  • the correct sequencing of the automated valves to transition between the diversion and bypass modes of operation are carried out in subroutine 02.
  • Subroutine 03 is contained in line 12.
  • the "check valve settings" contact in line 12 represents several contacts that correspond to the proximity switches used to verify that each valve is in the proper position.
  • the process control system of the present invention can also be used in a gin that is not equipped with the automated valves of the present invention.
  • a gin that is not equipped with the automated valves of the present invention.
  • Such an embodiment is referred to herein as the semi-automated valve embodiment.
  • the existing valves in the gin are equipped with actuators or air cylinders, as well as proximity switches or sensors .
  • the actuators and proximity switches are connected to PLC 2050, in a manner similar to that described above for the automated valves of the present invention.
  • the primary difference between this embodiment and the automated valve embodiment described above, is that the flow of cotton through the system has to be stopped in order for PLC 2050 to control the changing of valve position.
  • the PLC is programmed to perform the following functions: sequentially stop gin stand 150; allow the cotton to clear the valves; redirect the valves; verify valve position; and signal the ginner to re-engage gin stand 150.
  • FIG. 19b shows a ladder diagram for programming a PLC to carry out these functions .
  • Line 01 starts by determining whether the push button switch has been pressed and released. If it has been, the contact is closed, and subroutine 01 is called to determine if the thumbwheel switch settings have changed.
  • Line 02 starts by determining whether there is a new thumbwheel switch setting. This contact is labeled "0101" which corresponds to the "new setting" relay in line 06.
  • Line 02 also includes a timing relay to delay to allow the cotton to clear the lint cleaners before the position of the valves is changed.
  • Line 02 also includes a relay to stop the gin stand.
  • line 02 calls subroutine 02 to decide the outputs for the new valve settings .
  • Line 03 includes a timing relay to allow a delay between the changing of each valve. This prevents the valves from physically interfering with each other, and also prevents small voltage surges and errors. After the valves are set, subroutine 03 is called to check if the valves are set properly.
  • Line 04 is executed last .
  • the indicators for the lint cleaners being used are set, the "not ready” light is turned off, and the gin stand is re-engaged.
  • Line 06 includes a relay contact for the thumbwheel switch. This relay contact actually represents one contact for each of the switches in the thumbwheel. For example, if a thumbwheel is used that has four switches, the relay contact in line 06 represents four contacts, one for each of the four thumbwheel switches. Line 06 also includes two logic symbols, represented by " ⁇ >". The first is a " ⁇ cmp >” that compares the new switch setting to the old switch setting. The second is a " ⁇ sta >” that stores the new switch setting if it is different.
  • Subroutine 02 is contained in line 09.
  • Line 09 sets new outputs for the valves . This is done by providing a control signal to the air solenoids that change the position of the valves .
  • Subroutine 03 is contained in line 12.
  • the "check valve settings” contact in line 12 also represents several contacts, in a manner similar to the thumbwheel switch relay contact in line 06.
  • the "check valve settings” contact represents several contacts that correspond to the proximity switches used to verify that each valve is in the proper position.
  • the computer model generates a complete set of decision codes for each machine (gin decision matrix) for reflectance (50 to 80) , plus b (5.5 to 13.5), leaf (2 to 10), moisture content (3.5 to 9.5%), and lint turnout (30 to 40%).
  • Output of the model also includes the final values for the state variables as well as the monetary returns at the completion of ginning.
  • the optimum machine sequence was two lint cleaners . Comparison of the model value to the values from the USDA-recommended machinery sequence is shown below.
  • the decisions generated by the dynamic programming model 1020 of the present invention would yield monetary returns of $28.58 for an input of 45.4 kg (100 lb) of seed cotton, whereas the USDA- recommended ginning sequence would yield $27.35.
  • the $1.32 additional return per 100 pounds of seed cotton would equate to $17.22 for the seed cotton (635.6 kg or 1400 lb) that would be necessary to produce a 500 pound bale of lint cotton.
  • Table 18a An additional example is shown in Table 18a, discussed above.
  • the process control system of the present invention results in improved fiber quality, as well as improved profitability.
  • Control of fiber moisture and elimination of one or more stages of lint cleaning improves fiber quality by: (1) increasing length; (2) reducing short fibers; (3) increasing seed-coat fragment size and improving removability at the textile mill; (4) decreasing the number of seed-coat fragments; (5) increasing measured strength; and (6) increasing fiber yield.
  • the system and method of the present invention can also be used to process lint in a textile mill. Lint, the final product of processing in a gin, is further processed in a textile mill.
  • Mill processing can include, for example, cleaning of the lint, as well as blending, carding, combing, drawing, spinning, weaving, dyeing, and finishing.
  • FIG. 21 One embodiment of a cleaning line in a textile mill is illustrated in FIG. 21.
  • the cleaning line of FIG. 21 represents a typical opening and cleaning sequence in a textile mill. It is to be understood that some textile mills use a different sequence, and some mills have more cleaning machines than shown in FIG. 21.
  • a bale opener 2102 extracts cotton from bales of lint cotton, such as that produced at a typical cotton gin, and feeds it into an airstream.
  • a condenser 2104 separates the cotton from the air steam, and feeds the cotton into a pre-mixer 2106.
  • Pre-mixer 2106 mixes the cotton from several different bales at one time and feeds it into a double-roll cleaner 2108.
  • Double- roll cleaner 2108 removes foreign matter, and feeds the cotton into a blender 2110.
  • Blender 2110 ensures that the cotton is uniformly mixed and blended together.
  • a condenser 2112 separates the cotton from the airstream, and feeds the cotton into a cleaner 2114 which removes foreign matter, and transfers the cotton to a dust cage 2116. Dust cage 2116 removes dust and feeds the cotton to a cleaner 2118. Cleaner 2118 removes foreign matter.
  • a condenser 2120 then removes cotton from the airstream, and transfers it to a card feeder 2122.
  • Card feeder 2122 feeds cotton into a card machine 2124.
  • Card machine 2124 cleans cotton, and forms a web for further processing.
  • the process sequence described above differs with manufacturers and textile mills as various combinations and models of the cleaning, separating and blending machines are used.
  • the present invention can be used in a textile mill to select an optimum mill machine sequence that maximizes lint quality.
  • Automated directional valves as disclosed herein can be used to route lint through the selected sequence of cleaners.
  • double-roll cleaner 2108, cleaner 2114, dust cage 2116, and cleaner 2118 can be bypassed. Bypassing of the foregoing machines is not possible in a conventional textile mill (without the process control system of the present invention) . Based upon the disclosure herein, one of skill in the relevant arts could readily implement the appropriate algorithms for use in a textile mill .
  • % Also includes the energy required to convey the lint cotton between machines.
  • Gm stand 1-on ⁇ P.D' t a (RD 0 .PB ⁇ ,LF 0 ,LN 0 .M..T 0 ) F a (RD a ⁇ PB 0 .LF a .LN a .M a ,T a ) - L (RD 0 '.PB 0 ',L ⁇ '. N M ⁇ 0 ')
  • Impact cleaner 0-do not use for D ⁇ 0.
  • Drier 1 0 - do nol use for D D 0.
  • the following is a computer program listing showing a computer program which can be used to practice the present invention.
  • TRUE 1 #define FALSE 0 int DR1 CCl SMCH IC1 DR2 CC2 IC2, LC; int IDR1M, ICC1M, ISMCHM, IIClM , IDR2M, ICC2M, IIC2M, ILCM; float DD[5], TM[37], TMX[5], TMY[10] r GASUSD[5]j
  • SLFLO 2. Of; SLFMAX-lO.Of ;
  • ARRAY[ IND] DUM[i] [ j ] ; ⁇ printf (" REPRODUCTION OF DRIER DATA ⁇ n ",KT); for(i-l;i ⁇ -NDIMX;i++) printf("%10.2f ",XA[i]); printf (" ⁇ n");
  • PRTSYS() /* Write out the current module status to screen */ printf(" To change the status of an operation, enter the number ⁇ n") ; printf(" in parenthesis to the left of the operation -> "); scanf ("%d",&IX); while(IX ⁇ 1 I I IX > 9)
  • printf( M ⁇ n ⁇ n ⁇ nlnitial Values t ⁇ snn”) ); printf(" (1) Base price $%5.2f ⁇ n",BPRICE); printf (" (2) " Leaf' %5.2f Range ( %5.2f - %5.2f ) ⁇ n", SLFINT,var_limit[ 2 ) , var_limit[ 3 J ) ; printf (" (3) Moisture %%55..22ff RRaannggee (( % ⁇ 5b..2 ⁇ fr - %5.2f ) ⁇ n",
  • case 1 printf( "Enter a new value for Base price -> "); break; case 2: printf( "Enter a new value for Leaf -> "); break; case 3: printf("Enter a new value for Moisture -> "); break; case 4: printf("Enter a new value for Reflectance -> n );break; case 5: printf("Enter a new value for Turn Out -> "); break; case 6 ⁇ print ( "Enter a new value for Length -> "); break; case 7: printf("Enter a new value for Plus B -> " ) ; ⁇ scanf("%f" ,&input w value);
  • IPDR-0 IPDR-0 ; IPGS-0;
  • FX-CLIN (SLFL,SM ,SRDL,STOL,SLN ,SPB ) ;
  • FX FX- (IPDR+IPGS) *9000; /* This is a penalty that applies in some cases */ if(FX > FM fi.fi, FX > 0)
  • SLF - SLFT[k] SMT[k]; SRD - SRDT[kj; STO - STOT ⁇ k); SLN ⁇ SLNT[k]; SPB - SPBT[k];
  • Data for driers are for SM ranging between 4.0 and 14.0.
  • SML TABLI2("M,TMX,TMY,DD[IDR],SM,4,9);
  • IPDR 0 ;
  • IPDR-1 IPDR-1
  • SPBL 1.50f + 0.02f *SM + 0.81f*SPB;
  • LN (int) (SLNX*32.0f+0.5); if (LG > 10
  • LG ⁇ 2) printf("*CLINT* LG outside range - LG %d ⁇ n",LG); if(LN > 37 f
  • LN ⁇ 29) printf("*CLINT* LN outside range - LN %d ⁇ n",LN); PR-IPRICE[ICR-ll][LG-2][LN-29] ; PRICE-PR/100. Of+BPRICE;
  • PRICE is set to -99 if it is not in range of data. */ if (PRICE > 0) return(PRICE*STOX/100.0f ); else return(-99.f) ;
  • PRICE is set to -99 if it is not in range of data. */ if (PRICE > 0) return(PRICE*STOX/100.0f); else return(-99. f);
  • RAY[++II ] ARRAY[i]+RATIO*(ARRAY[ i+1 ] -ARRAY[i ] ) ;
  • ISLFint*4; ISLFmax 16 /* Actual Range is 2-8 */
  • ISRDint-50; ISRDmax-80; /* Actual Range is 50-80 */ printf("Currently evaluating variable values : ⁇ n");
  • NDDRl[ISRD-50] IDR1M
  • NDSMCH[ ISRD-50]-ISMCHM NDICl[ISRD-50] -IIC1M
  • NDDR2 [ ISRD-50] IDR2M
  • NDLC[ISRD-50] -ILCM IDR1M
  • NDDRl[ISRD-50] IDR1M; NDSMCH[ISRD-50]-ISMCHM; NDICl[ISRD-50] -IIC1M; NDDR2 [ ISRD-50 ] «IDR2M; NDLC[ISRD-50] -ILCM;
  • ⁇ fgray_y fgray_y/10.0; gray_z-fgray_z/10.0 ;

Abstract

System and method for optimizing the processing of materials, particularly the processing of cotton in a cotton gin or a textile mill. Cotton moisture, color, and foreign matter measurements are made with electronic sensors (210, 1016) at three stations. For a gin, a dynamic programming model (1020) uses input information relative to the moisture and trash content, color, lint turnout, staple length, cotton price structure, and energy costs to select and optimum drying and cleaning sequence (1106) for the cotton. The dynamic programming model optimizes cotton producer profits by selecting the amount of gin machinery (1116) necessary to achieve the most beneficial market value while minimizing the machinery used. Automated directional valves (1036) are used to route the cotton through the selected optimum combination of seed cotton cleaners, multi-path driers, and lint cleaners.

Description

SYSTEM AND METHOD FOR MATERIALS PROCESS CONTROL
Background of the Invention Field of the Invention
The present invention relates generally to a system and method for processing materials, particularly agricultural solids such as cotton. More particularly, the present invention relates to a system and method for optimizing the processing of cotton in a cotton gin.
Related Art
Cotton quality after ginning is a function of its initial quality as well as the type and degree of cleaning and drying that it receives during the gin process . The term "cotton" is generally used to refer to either seed cotton or lint. Seed cotton has the fibers or lint attached to the cottonseed, and is usually referred to as "seed cotton" . After the fiber is removed from the cottonseed, it is usually referred to as "lint" . Ginning includes drying, trash removal from seed cotton, lint-seed separation, trash removal from lint, and bale packaging. Processing cotton in a gin is an intricate task that proceeds at rates as high as 150,000 pounds per hour. Cotton ginning systems consist of several different types of processing machines, and each machine influences several physical properties of the cotton fiber (lint) .
The efficiency of the ginning process is strongly influenced by the quantity of moisture and trash that the cotton contains. Cotton contains varying amounts of trash and moisture, and is of varying colors. However, most cotton in the United States is conventionally processed through the same machines in a standard sequence, regardless of the level of trash in the cotton or the cotton color. The amount of drying received by the cotton is also relatively constant, regardless of the actual moisture content of the cotton. Therefore, in conventional cotton processing, some cotton may be over-dried, or processed through more cleaners than necessary for the level of trash in the cotton. Conventional cotton processing does not account for variations in the cotton being processed. This can result in decreased fiber quality, and increased costs and/or processing time.
One way to optimize the cotton processing sequence is to bypass certain machines, such as driers, seed cotton cleaners, and lint cleaners, that may not be necessary for the particular cotton being processed. However, in a conventional ginning system, physical properties of the cotton, such as trash content, moisture content and color, are not continuously measured as the cotton is processed in the gin. Further, no system or method exists for determining the optimal processing sequence for cotton, or for carrying out such a sequence. Additionally, changing the number of cleaners used in a conventional cotton ginning system requires downtime for the ginning system, as well as labor costs for changing the valve configurations in the system. At least five minutes is required to change the valves on a single gin stand lint cleaner device. A gin typically has three or more sets of lint cleaners in parallel processing lines . There is also the potential for malfunctions that arise when the valves are manually changed. Other gin machines and driers do not routinely have bypass valves, requiring that valves be provided.
To bypass a machine such as a lint cleaner, in a conventional ginning system, the flow of cotton is stopped through the gin stand that immediately precedes the lint cleaner. The valves to the machine to be bypassed are then closed, usually manually, and then the bypassed machine is stopped. To put the bypassed machine back on-line, the process must be reversed. In order to bypass a machine such as a seed cotton cleaner or drier, all of the preceding machines must be stopped. The flow of cotton is stopped throughout the entire system, for a period of several minutes so that the seed cotton cleaner valves can be manually changed. Once the machines are ready for operation, the valves to the bypassed machines are then opened, restoring flow to the bypassed machines.
A conventional ginning system does not continuously measure the physical properties of the cotton as it is being processed, and is not capable of determining the gin machine sequence that optimizes processing of cotton having those physical properties. An operator of a conventional ginning system cannot readily assess the need to alter the gin machine sequence to optimize cotton processing. Further, in a conventional ginning system, it is not possible to bypass a machine, or to divert the flow of entrained cotton to an auxiliary treatment unit outside the primary flow through the ginning system, without stopping the flow of cotton throughout the system. Further, bypassing machines in a conventional ginning system is slow, requires operator intervention, and requires repeated starting and stopping of the machines as they are bypassed or brought back on-line.
Thus, there is a need for an automated system that measures the physical properties of the materials as they are being processed, determines the optimum processing sequence for the materials, and implements the optimum processing sequence.
Summary of the Invention
In one aspect of the present invention, a computer program product is provided that comprises a computer useable medium having computer program logic or software recorded thereon for enabling a processor in a computer system to control the processing of cotton through a gin to produce lint . The computer program logic enables the processor to measure sensor data that correspond to color, moisture content, and trash content of the cotton as it enters the gin. The computer program logic enables the processor to generate a gin decision matrix that includes optimum process control decisions that maximize net return from the lint as a function of the input state of the cotton entering the gin. The computer program logic enables the processor to select an optimum process control decision from the gin decision matrix for an input state corresponding to the measured sensor data. The optimum process control decision corresponds to an optimum gin machine sequence for cotton with the measured input state . The processor is enabled by the computer program logic to implement the optimum process control decision by routing cotton through the optimum gin machine sequence. The computer program logic also enables the processor to compute and store predicted values for color, moisture content, and trash content for the cotton after processing through a first portion of the optimum gin machine sequence .
The gin decision matrix may be generated using a plurality of tabular transition functions. The gin decision matrix may also be generated using an algorithm for each gin machine in the optimum gin machine sequence. Each algorithm and tabular transition function quantifies the effect of that gin machine on leaf trash, moisture content, reflectance (Rd) , turnout, length, and yellowness (+b) .
The computer program logic of the present invention may also enable the processor to measure second sensor data that correspond to color, moisture content, and trash content of the cotton after it has been processed through the first portion of the optimum gin machine sequence. The processor may also be enabled to compare the second sensor data to the predicted values to generate an error, and to adjust the optimum gin machine sequence and the predicted values to compensate for the error. The computer program logic of the present invention may also enable the processor to measure lint sensor data that correspond to color, moisture content, and trash content of the cotton after it has been processed through a second portion of the optimum gin machine sequence. The processor may also be enabled to compute and store second predicted values for color, moisture content, and trash content for the cotton after processing through the second portion of the optimum gin machine sequence. The computer program logic may also enable the processor to compare the lint sensor data and the second predicted values to generate a second error, and to adjust the second portion of the optimum gin machine sequence and the second predicted values to compensate for the second error.
In a further aspect of the present invention, a program storage device readable by a machine is provided. The program storage device embodies a program of instructions executable by the machine to perform method steps for processing cotton through a gin to produce lint . The method steps include : measuring sensor data at a measurement station that correspond to color, moisture content, and trash content of the cotton at the measurement station; determining an optimum gin machine sequence for cotton entering the gin based on a physical state of the cotton at the measurement station that corresponds to the sensor data so that the optimum gin machine sequence maximizes net return from the lint; and routing the cotton through the optimum gin machine sequence. The measurement of sensor data may be performed at the measurement station as the cotton enters the gin, after the cotton has been processed through a first portion of the optimum gin machine sequence, or after the cotton has been completely processed through the optimum gin machine sequence .
The program storage device of the present invention may include an error feedback feature that may include the following method steps : measuring second sensor data at a second measurement station that correspond to color, moisture content, and trash content of the cotton after it has been processed through a first portion of the optimum gin machine sequence; computing and storing predicted values for color, moisture content, and trash content for the cotton after processing through the first portion of the optimum gin machine sequence; comparing the second sensor data to the predicted values to generate an error; and adjusting the optimum gin machine sequence and the predicted values to compensate for the error.
The program storage device of the present invention may also include a second error feedback feature that may include the following method steps: measuring lint sensor data that correspond to color, moisture content, and trash content of the cotton after it has been completely processed through said optimum gin machine sequence; computing and storing second predicted values for color, moisture content, and trash content for the cotton after processing completely through the optimum gin machine sequence; comparing the lint sensor data to the second predicted values to generate a second error; and adjusting a second portion of the optimum gin machine sequence and the second predicted values to compensate for the second error.
In yet a further aspect of the present invention, a control system is provided that controls the processing of cotton through a gin to produce lint. Such a gin has a plurality of auxiliary treatment units and a duct through which entrained cotton flows . The control system of the present invention comprises measuring means for measuring sensor data that correspond to color, moisture content, and trash content of the cotton. Processing means are coupled to the measuring means. The processing means processes the sensor data, and selects a set of the plurality of auxiliary treatment units in the gin through which the cotton is processed to produce lint. The set selected by the processing means corresponds to an optimum gin machine sequence that maximizes net return from the lint .
Each of the auxiliary treatment units in the gin is equipped with a cotton diversion means that is coupled to the processing means. The processing means activates the cotton diversion means to divert cotton to flow through each of the auxiliary treatment units in the selected set . The processing means deactivates the cotton diversion means to bypass each of the auxiliary treatment units that are not in the selected set.
The control system of the present invention may also include second measuring means coupled to the processing means for measuring sensor data that correspond to color, moisture content, and trash content of the cotton as it enters a second stage . This second stage may be a ginning stage, or a lint cleaning stage for which lint cleaner sensor data is measured. A third measuring means may also be provided for measuring color, moisture content, and trash content of the lint after processing by the set of auxiliary treatment units. The control system of the present invention may also be provided with cotton diversion means in the form of automated directional valves for controlling the flow of cotton through the set of auxiliary treatment units .
In still a further aspect of the present invention, a control system is provided for controlling the processing of lint through a mill that has a plurality of auxiliary treatment units and a duct through which lint flows. The control system includes measuring means for measuring sensor data that correspond to color, moisture content, and trash content of the lint. Processing means coupled to the measuring means is provided for processing the sensor data. The processing means selects a set, from the plurality of auxiliary treatment units, through which the lint is processed to produce lint of a predetermined quality. The set corresponds to an optimum mill machine sequence.
The control system also includes lint diversion means coupled to each of the auxiliary treatment units and coupled to the processing means. The processing means activates the lint diversion means to divert lint to flow through each of the auxiliary treatment units in the set. The processing means deactivates the lint diversion means to bypass each of the auxiliary treatment units not in the set .
In yet a further aspect of the present invention, a program storage device is provided that embodies a program of instruction to perform method steps for processing input material through a processing plant to produce processed material. The method steps comprise measuring sensor data at a measurement station that correspond to a physical state of the input material at the measurement station; determining an optimum processing machine sequence for input material entering the processing plant based on the physical state of the input material at the measurement station that corresponds to the sensor data, the optimum processing sequence maximizing net return from the processed material; and routing the input material through the optimum processing machine sequence.
Features and Advantages
A feature of the present invention is that it optimizes materials processing to maximize monetary return to producers, while minimizing the amount of machinery used and preserving quality of the materials.
A further feature of the present invention is that it provides for automated control of the gin process . The present invention has the added feature that the degree of automated control can be selected by the ginner, and customized for a particular gin.
It is yet a further feature of the present invention that it provides a real-time display to the ginner of physical properties of the cotton as it is being processed. The display also advises the ginner of the machinery sequence being used to process the cotton. The display may be located within the gin itself, as well as at other locations remote from the gin.
A still further feature of the present invention is that it can be adapted for use with fluid-entrained materials other than cotton, such as seeds, man-made fibers, or pharmaceuticals.
A still further feature of the present invention is that it provides instantaneous directional changes in the flow of fluid- entrained materials, particularly air-entrained cotton.
Yet a further feature of the present invention is that it can be adopted for use in a textile mill to control the processing and cleaning of lint to maximize quality of the lint.
An advantage of the present invention is that only the necessary machinery will be used to process a particular run of cotton, thereby saving on energy costs and minimizing waste and damage to the cotton by eliminating unnecessary processing steps.
Cotton fiber quality and profitability are improved.
A further advantage of the present invention is that it can be installed in an existing gin, as well as be included in the design of a new gin.
Still another advantage of the present invention is that the flow of cotton or other solids can be diverted without stopping the flow or shutting down machinery to carry out a manual valve changing operation.
A still further advantage of the present invention is that the flow of cotton can be diverted as necessary for cotton cleaning to provide cotton with an appropriate level of foreign matter and color. When cleaning is not necessary, the cleaning machines can be bypassed without stopping the machinery or the flow of cotton through the primary processing system.
A still further advantage of the present invention is that the continuous redirection of the flow of cotton occurs without choking a cotton duct in a ginning system.
Brief Description of the Drawings
The present invention is described with reference to the accompanying drawings . In the drawings , like reference numbers indicate identical or functionally similar elements. Additionally, the left-most digit (s) of a reference number identifies the drawing in which the reference number first appears .
FIG. 1 shows typical processing stages for a cotton ginning system;
FIG. 2 shows a schematic of a small-scale ginning system in which the present invention is installed;
FIG. 3 shows an expanded view of a sample collection installation in FIG. 2;
FIG. 4 shows an exemplary computer system suitable for use with the present invention;
FIG. 5 shows a partial view of a ginning system in which the automated directional valves of the present invention are installed with a lint cleaner;
FIG. 6 is an expanded view of the automated directional valves of the present invention;
FIG. 7 is a further view of the automated directional valves shown in FIG. 6 that illustrates selected valve positions;
FIG. 8 is an expanded view of the manually-operated slide valve shown in FIG . 6 ; FIGS. 9A-9D show alternate embodiments of the automated directional valves of the present invention;
FIG. 10 shows a block diagram illustrating implementation of the process control system of the present invention;
FIG. 11 shows a flow diagram of the process steps carried out for a first measurement station (Station 1) ;
FIG. 12 shows a flow diagram of the process steps carried out for a second measurement station (Station 2) ;
FIG. 13 shows a flow diagram of the process steps carried out for a third measurement station (Station 3) ;
FIG. 14 illustrates the error feedback process of the present invention;
FIG. 15 shows a screen display for editing a gin configuration file;
FIG. 16 shows a screen display for editing a decision matrix file;
FIG. 17a shows one embodiment of a screen display for the process control system of the present invention,-
FIG. 17b shows an alternate embodiment of a screen display for the process control system of the present invention;
FIG. 18 shows an output of optimum ginning decisions from a dynamic programming model of the present invention;
FIG. 19a shows a ladder diagram for implementing an embodiment of the present invention that includes automated valves ;
FIG. 19b shows a ladder diagram for implementing an embodiment of the present invention that includes semi-automated valves ;
FIG. 20 illustrates one embodiment of a hardware interface suitable for use with the process control system of the present invention; and FIG. 21 illustrates one embodiment of a cleaning line in a textile mill.
Detailed Description of the Embodiments Overview
The present invention is designed for use in a system that processes fluid-entrained materials. The invention will be described herein with reference to a ginning system that processes air-entrained cotton. In a ginning system equipped with the present invention, physical properties of the cotton are analyzed to determine the optimum ginning sequence to maximize return to cotton producers while producing cotton having desired fiber properties .
The present invention evaluates the physical properties and quality parameters of cotton before, during, and after the ginning process. Measurements of cotton color, moisture content, and trash content are made at three stations in the ginning system. A dynamic programming model uses these measurements, as well as information relative to staple length, lint turnout, cotton price structure, and energy cost to generate a matrix of optimum drying and cleaning sequences. The dynamic programming model optimizes producer profits by selecting the amount of gin machinery necessary to achieve the most beneficial market value, yet minimize the machinery used. The dynamic programming model uses the market price structure for cotton, and the performance characteristics for each gin machine, to determine optimum machinery sequences. The decision at each stage of processing depends on the state of the cotton entering that stage. Once the solution to the total problem has been obtained, the decisions can be related to the state of cotton when it enters the gin. Thus, the optimum decision at each stage of processing can be determined from the initial state of the cotton. The objective is to maximize the net return from the lint; i.e., the revenue from the lint minus the costs of the ginning operation. Any revenues or costs that do not vary with the processing decisions (e.g., revenue from seed and operating costs of the gin stand) are not included in the dynamic programming model because they do not affect the optimum decision. The present invention allows a ginner to process each increment of cotton through the minimum machinery necessary to achieve maximum returns, rather than processing all cotton identically.
Multiple fiber quality factors such as moisture content, color grade (yellowness and greyness) , and trash content (area, number, shape, and type of trash particles) are measured before the gin process (Station 1 in FIG. 2) . These measurements are used to ascertain the optimum seed cotton cleaning machinery, and drying temperature and exposure time, to produce specifically desired fiber properties that maximize monetary returns to cotton producers . Color is subdivided into two components for use in the process control system of the present invention: yellowness (+b) and reflectance (Rd) . Color, trash, and moisture sensors are installed perpendicularly to the flow of cotton. The cotton is forced to pause for a finite time period (typically approximately 1 second) as a sample collection means compresses the cotton against the sensors to provide a uniform measurement surface in a continuous, automatic, batch-type process. Electrical signals are transmitted from the sensors to a computer system for processing and storage .
Predicted values of each measured fiber property are stored in the computer system for subsequent comparison of the predicted value with the actual value after cleaning and drying of the seed cotton. The change in other common fiber properties such as fiber length, length distribution, uniformity, neps (small entanglements of cotton fibers) , short fiber content, micronaire, seed coat fragment size and weight, strength, upper quartile length, mean length, coefficient of variation length, elongation, lint turnout, etc. is estimated and recorded.
A second measurement station (Station 2 in FIG. 2) is used midway through the ginning system. A third measurement station (Station 3 in FIG. 2) is used after all cleaning, ginning, and drying has occurred to determine the final quality of the cotton, to provide error feedback to Station 2 , and to provide data that may be used in making machinery decisions . Samples of cotton are captured at Stations 2 and 3, and analyzed with sensors similar to those at Station 1. Measurement data obtained at Stations 1, 2 , or 3 may be used by the computer system to determine the optimum gin processing sequence for the cotton being processed.
The computer system is configured to selectively activate and deactivate cotton diversion means to individually control flow through each of the selected machines in the optimum gin processing sequence. For example, a clean cotton needs almost no cleaning to achieve its best possible grade. As such, the process control system of the present invention would determine which machines were not needed, and would bypass those cleaners.
The present invention diverts the flow of cotton through the selected combination of gin processing machines by controlling valves, such as the automated directional valves disclosed herein.
The valves are configured to provide for complete flow stoppage, or unrestricted flow. The opening and closing of the valves are sequentially controlled to allow cotton to clear the individual machines .
System Description
Typical processing stages for a cotton ginning system are shown in FIG. 1. The stages associated with a gin stand/feeder 150 and a bale press 170 are always required; the stages associated with the other illustrated machinery are optional . The ginning machinery combination recommended by the U.S. Department of Agriculture (USDA) includes two seed cotton driers 110, three seed cotton cleaners, gin stand, and two lint cleaners 160. The seed cotton cleaners typically include one or more cylinder cleaners 120, one or more stick machines 130, and one or more impact cleaners 140. The processing machinery illustrated in FIG. 1 is conventional in the gin processing industry, and the configuration and operation of the machinery is known to one of skill in the relevant art. A description of this machinery can be found, for example, in Cotton Ginners Handbook, USDA, Agricultural Handbook Number 503, December 1994, the entirety of which is incorporated herein by reference .
Most cotton in the United States is processed through the same standard USDA-recommended sequence of machines regardless of the trash level and cotton color. The amount of drying received by the cotton is also relatively constant regardless of the cotton's moisture content. Although the USDA-recommended ginning machinery sequence achieves satisfactory bale value and limits damage to the inherent quality of the fiber, it does not maximize the net cash value of each individual bale and minimize fiber damage .
The system and method of the present invention processes cotton through the minimum machinery necessary to achieve maximum returns. Rather than processing all cotton identically, the present invention provides for customized or prescription ginning of the cotton to preserve fiber quality and maximize monetary returns to cotton producers. A schematic of a small-scale ginning system in which the present invention is installed is shown in FIG. 2. The configuration shown in FIG. 2 has been provided for illustrative purposes only. A full-scale gin may include more or less machinery, or a different arrangement of machinery, than that illustrated in FIG. 2. It is to be understood that the present invention can be used with a variety of gin configurations, and is not limited to the configuration shown in FIG. 2. The ginning system of FIG. 2 includes a feed control 220 into which seed cotton is fed, two driers 110, two cylinder cleaners 120, stick machine 130, impact cleaner 140, extractor-feeder/gin stand 150, and three lint cleaners 160. At the end of the machinery sequence is a condenser 230 from which lint is expelled.
The ginning system of FIG. 2 is equipped with the process control system of the present invention which includes a computer system 240. The function and operation of computer system 240 is explained more fully below in Section 3 (Computer Program Implementation of the Preferred Embodiment ) .
An exemplary computer system 240 for use in the process control system of the present invention is shown in FIG. 4. In a preferred embodiment computer system 240 is a microcomputer such as an IBM-PC. Computer system 240 preferably includes a display, keyboard, and input/output circuitry suitable for interfacing with measuring means 210 and cotton diversion means 250. Computer system 240 includes one or more processors, such as processor 404.
Processor 404 is connected to a communication bus 406. Computer system 240 may communicate with other similarly configured computer systems or with a display (not shown) via a network 418, such as an ETHERNET local area network.
Computer system 240 also includes a main memory 408, preferably random access memory (RAM) , and a secondary memory 410.
Secondary memory 410 includes, for example, a hard disk drive 412 and/or a removable storage drive 414, representing a floppy disk drive, a magnetic tape drive, a compact disk drive, etc. Removable storage drive 414 reads from and/or writes to a removable storage unit 416 in a well known manner. Removable storage unit 416, also called a program storage device or a computer program product, represents a floppy disk, magnetic tape, compact disk, etc. As will be appreciated, removable storage unit 416 includes a computer usable storage medium having stored therein computer software and/or data.
Computer programs (also called computer control logic) are stored in main memory 408 and/or secondary memory 410. Such computer programs, when executed, enable computer system 240 to perform the features of the present invention as discussed herein. In particular, the computer programs, when executed, enable processor 404 to perform the features of the present invention. Accordingly, such computer programs represent controllers of computer system 240.
In one embodiment, the invention is a computer system operating according to software. In another embodiment, the invention is a computer program product having control logic which causes the computer to operate as discussed herein.
In another embodiment, the present invention is implemented primarily in hardware using, for example, a hardware state machine. Implementation of the hardware state machine so as to perform the functions described herein would be apparent to persons skilled in the relevant arts.
Computer system 240 is used to measure cotton characteristics at three measurement stations, shown as Stations 1, 2, and 3 in FIG. 2. Each station contains measuring means 210 for taking moisture, color, and foreign matter (trash) measurements on samples of cotton being processed. Station 1 evaluates seed cotton, whereas Stations 2 and 3 evaluate lint. Each of measuring means 210 includes a moisture meter 214 to measure moisture content of the cotton, and a camera 212 to measure color and trash content. Suitable cameras include the "Color/Trash Meter" camera made by Motion Control, Inc., and a similar device made by Spinlab, Inc., both now owned by Zellweger Uster. Suitable moisture sensors include infrared moisture sensors, such as those made by Infrared Engineering, Inc. or Moisture Systems Corporation. Resistance moisture sensors may also be used. A particularly preferred resistance moisture sensor is described in U.S. Patent 5,514,973, the entirety of which is incorporated herein by reference.
The three channels of data from the three cameras 212 shown in FIG. 2 are connected to a video multiplexer, such as model DT2859 made by Data Translation of Marlboro, MA. The multiplexer connects one of the eight input lines on the board with an output line under control of computer system 240. The appropriate camera 212 for a measurement is selected through the multiplexer. The output of the multiplexer is connected to a frame grabber, such as model HRT256 made by Catenary Systems of St. Louis, MO. The frame grabber converts a video frame to a set of digital pixel values that indicate light and dark areas of the image. Foreign material normally appears darker than the surrounding cotton fibers . The number of pixels which are dark compared to the neighboring pixels are counted to determine count data. The percent of the total number of pixels which are dark is used as the percent area of trash. The color meter is an instrument with two light sensors covered with different filters that approximate the ICI Standard Observer tri-stimulus values of Y and Z. The light sensors with filters produce a voltage that is calibrated to correspond to Y and Z. The Y and Z values are converted to the Nickerson-Hunter Rd (reflectance) , +b (yellowness) , and color code and quadrant values for cotton lint . One such transformation is contained in the COLORF.C file (discussed in more detail in Section 3.a.ii. below) in the attached microfiche appendix. The digital values of percent area trash, Rd, and +b are input to computer system 240 for processing and analysis. Turning now to FIG. 20, one embodiment of a hardware interface to computer system 240 is shown. The input to computer system 240 from the three cameras 212 of Stations 1, 2, and 3 is represented by video input lines V0, VI, and V2, respectively, of a video input 2030. The video multiplexer and frame grabber referred to above are contained within video input 2030. In a preferred embodiment, a digital interface 2040 is provided that consists of two 24-bit input/output (I/O) ports. These two 24-bit I/O ports are identified as lines DI through D48 of digital interface 2040. In a particularly preferred embodiment, one 24- bit I/O port is the PIO (programmable input/output) portion of a CIO-DAS16 board available from ComputerBoards, Inc., Mansfield, MA. The other 24 -bit I/O port is preferably a Computer Boards CI0-DI024 board. The 24 PIO lines from each of the digital I/O boards are connected to a ComputerBoards SSR-RACK24 containing 24 optoisolator modules . The optoisolator modules isolate computer system 240 from dangerous voltages associated with the digital I/O system, and are available from Gordos or OPT022. The 24 PIO lines from each of the digital I/O boards can be programmed for either input or output on each line, and the optoisolator modules are available for either input or output .
A digital-to-analog (D/A) converter 2020 is provided, and in a preferred embodiment is part of the CI0-DAS16 board. D/A converter 2020 may be used, for example, to control the temperature of the burners in drier 110. The burners in a drier are typically controlled by a burner control that is configured to receive an analog input . To change the temperature of the burners, the voltage is adjusted on line A0 of D/A converter 2020. The burner control then raises or lowers the temperature of the burners based upon this analog input .
The analog inputs to computer system 240 are captured with an analog-to-digital (A/D) converter 2010, such as the 12-bit A/D converter that is part of the CIO-DAS16 board. The two color output channels and two light level channels from each of the three measurement stations (cameras 212) are connected to A/D converter 2010. The color cells include two lines, Y and Z. The light level sensors include two additional lines, L and R. These four lines from each of the three measurement stations are input to A/D converter 2010 (lines A0 through All) . The analog output of the three moisture meters 214 is connected to A/D converter 2010 (lines A12 through A14) . In other embodiments, a digital output from moisture meter 214 is used, and is input to computer system 240 as a digital, rather than analog, input.
An analog multiplexer 2012, such as CIO-EXP32, connects to the CIO-DAS16 board. Analog signals representing the temperature of the burners in drier 110 can be connected to analog inputs on analog multiplexer 2012.
The sampling of cotton at the three measurement stations is controlled by computer system 240 through digital interface 2040.
As explained more fully below, sample collection means is used to capture a sample of cotton for measurement at each of the three measurement stations . This is achieved through the "close sample" line at Stations 1, 2, and 3 (D9, D12 , and D25, respectively).
Proximity sensors or switches are installed at each measurement station so that the position of the sample collection means (open, closed, or neither) can be measured by computer system 240 through digital interface 2040. As shown in FIG. 2 and discussed below, Station 1 uses a plunger or compression-ram type of sample collection means. Alternatively, Station 1 can be configured with a paddle-sampler type of sample collection means, as shown in FIG. 2 for Stations 2 and 3. The position of this sample collection means is input to computer system 240 on the lines labeled "Plunger Closed", "Plunger Open", and "Plunger Switch" (D21, D22, and D23) . Stations 2 and 3 are shown in FIG. 2 as configured with a "flapper" or paddle-sampler type of sample collection means. Stations 2 and 3 can alternatively be configured with a compression-ram type of sample collection means. Such a configuration is useful when Station 2 is located above the feeder shown in the lower left corner of FIG. 2. The position of the paddle sampler shown in FIG. 2 at Stations 2 and 3 is input to computer system 240 through the lines labeled "sample open" and "sample closed". The position of the paddle sampler used in connection with calibration at Stations 2 and 3 is input to computer system 240 through the lines labeled "cal . open" and "cal . closed" .
FIG. 20 shows four output lines from digital interface 2040 (D13-D16) that are input to Station 2. These lines are used to extend and retract a short stroke air cylinder and a long stroke air cylinder. These air cylinders are used during calibration of the sensors, as described in U.S. Patent No. 5,639,955.
In a preferred embodiment as shown in FIG. 20, a PLC (programmable logic controller) 2050 is used by computer system 240 to control the flow of cotton through the various gin machines. PLC 2050 is linked to a ginner' s control panel 2060 that includes a switch for selecting the method of valve control to be used, either automatic control or manual control. If automatic control is selected, computer system 240 and PLC 2050 automatically control switching of the valves to configure the gin machinery in accordance with the optimum gin machine sequence that corresponds to the optimum process control decision. If manual control is selected, then the valve settings are switched by an operator to configure the gin machinery in accordance with the optimum gin machine sequence that corresponds to the optimum process control decision, or the desires of the ginner. PLC 2050 reads the setting of this switch on ginner' s control panel 2060. As discussed below in Section 3.b., PLC 2050 is programmed to read this switch setting before initiating a change in the setting of the valves. In this manner, the degree of automated control can be selected by the ginner, and the system and method of the present invention can be customized for a particular gin.
The first line input to PLC 2050 is a computer valid line. This line is connected to a watch dog timer that is connected to line D20 of digital interface 2040. The watch dog timer switches the computer valid line to false if a monostable multivibrator is not reset by computer system 240. If the computer valid line is false, PLC 2050 defaults to a predetermined condition that safeguards the gin machinery.
The next two lines input to PLC 2050, LC A and LC B (D17 and D18) , are used to request that either or both of two lint cleaners ("A" and/or "B") be placed on-line so that cotton is diverted to flow through them. The two lines input to PLC 2050 labeled Impact Cl. and Stick Mach. (D30 and D31, respectively) are used to control selection of the seed cotton cleaners (impact cleaner 140 and stick machine 130) . Any combination of seed cotton cleaners (impact cleaners and stick machines) can be selected through D30 and D31. The line input to PLC 2050 labeled valid (D19) is used as a "handshake" line by computer system 240 to signal that the changes requested on the lint cleaner and seed cotton cleaner lines are valid. PLC 2050 is programmed to not output a change in selection of machinery while handshake line D19 is false. If a change to the selection of machinery is requested by computer system 240, the change will not be implemented (i.e., valve settings changed) until handshake line D19 returns to true.
The lines output from PLC 2050 to digital interface 2040 will now be described. Lines GS 1, 2, and 3 In (D33, D34, and D35, respectively) are used to indicate which of one or more gin stands is in position for ginning cotton. Lines DI through D6 are used to input to computer system 240 the number of lint cleaners actually on-line and being used. This number may differ from the number of lint cleaners requested by computer system 240 for two reasons. First, the machinery may be malfunctioning and set offline by the ginner. Second, the number of lint cleaners in actual use may differ from the number requested because automated control may have been disabled at ginner' s control panel 2060. Line D8 input to digital interface 2040 identifies whether automated or manual control of the valves for routing cotton through the lint cleaners has been selected at ginner' s control panel 2060. Line D7 provides an input from a proximity switch typically located on the bale press. This signal cycles once each time the bale press turns to indicate when the lint transitions from being placed in the current bale to being placed in the next bale. Lines D45 through D48 input the position of the four valves used to control the flow of cotton though the seed cotton cleaners (impact cleaners and stick machines) .
One of the major problems with measuring physical characteristics of cotton while it is continuously moving in a ginning system is enhancing the density to such a point that a homogeneous surface is achieved in order to make accurate measurements. Inconsistent surface densities create shadows in the imaging process which greatly affects the color and trash readings of the camera. Infrared moisture measurements are also greatly affected by inconsistent surface density. Sensors that respond to changes in resistance and capacitance also respond strongly to surface and/or bulk density. The present invention uses two types of sample collection means to obtain a cotton sample, and to increase the density of the cotton to enable the instrumentation to measure more accurately.
The first type of sample collection means is a compression ram 216, installed at Station 1 (see FIG. 2) . Compression ram 216 cyclically displaces a small mass of cotton from its pathway through feed control 220 toward one of the side walls, and presses the mass against the side wall so that the mass presents a face of uniform cotton density. The mass is then analyzed for color, trash content, and moisture content. These piston-type compression rams work extremely well in locations where cotton is moving very slowly such as at feed control 220. A particularly preferred compression-ram type of sample collection means is described in U.S. Patent No. 5,125,279, the entirety of which is incorporated herein by reference.
A second type of sample collection means is a paddle sampler 218, installed at Stations 2 and 3. An expanded view of the installation of paddle sampler 218 at Station 2 is shown in FIG. 3. Paddle sampler 218 systematically grasps a quantity of cotton and compresses it against the sensors where measurements are made, and then releases the cotton back into the air stream. The degree of pressing or compression is such that the halted cotton presents a face of uniform density on that part of the cotton which is pressed against the sensor surface . The uniform density is sufficient to enable the mass to be accurately analyzed for color, trash content, and moisture content. The system is typically carried out in an intermittent or cyclic manner so that a different mass of cotton is pressed against the sensor surface at specific time intervals. After compression, the pressure is removed, and each mass is allowed to resume its pathway through a duct 201 (best seen in FIG. 3) . As used herein, uniform cotton density means that the face of the mass which is pressed against the sensor surface is essentially filled with cotton and impurities, but with no voids. This enables an analyzer adjacent to the flattened face to make an analysis. Paddle sampler 218 is particularly suited for locations where cotton is moving rapidly, at speeds as high as 6,000 ft/min. A particularly preferred paddle-sampler type of sample collection means is described in U.S. Patent No. 5,087,120, the entirety of which is incorporated herein by reference.
As explained more fully below in Section 3 (Computer Program Implementation of the Preferred Embodiment ) , computer system 240 uses the measurement data obtained from Stations 1, 2, and 3 to optimize the flow of cotton through the ginning system illustrated in FIG. 2. To control the routing of cotton through the various machines, computer system 240 controls the operation of cotton diversion means 250 associated with each machine. Cotton diversion means 250 is used to route cotton through the optimum drying and cleaning sequence between Stations 1 and 2. Cotton diversion means 250 is also used to route cotton through the optimum cleaning sequence between Stations 2 and 3. Cotton diversion means 250 is used to divert cotton from duct 201 to flow through one or more auxiliary treatment units 202, which are shown in FIG. 2 as containing lint cleaner 160.
Cotton diversion means 250 diverts cotton to flow from duct 201, through auxiliary treatment unit 202, and return to duct 201.
Each cotton diversion means 250 is coupled to and controlled by computer system 240. Computer system 240 activates cotton diversion means 250 to divert cotton to flow through auxiliary treatment unit 202, and deactivates cotton diversion means 250 to discontinue flow of cotton through auxiliary treatment unit 202.
In the preferred embodiment, cotton diversion means 250 includes the automated directional valves described below.
A partial view of a ginning system in which the automated directional valves of the present invention are installed with one of several auxiliary treatment units is shown in FIG. 5. A conventional low pressure source, such as a fan (not shown) , moves entrained cotton through duct 201. A diversion unit in the form of auxiliary treatment unit 202 is disposed adjacent duct 201.
As illustrated in FIG. 5, auxiliary treatment unit 202 includes a lint cleaner, shown generally at 160. It is to be understood that auxiliary treatment unit 202 may include other types of cotton treatment machines, for example, a drier, a seed cotton cleaner, or an apparatus for moisture restoration, cotton combing, cotton blending, and the like.
A supply conduit 505, connected to duct 201 at a supply connection location 665, conveys cotton from duct 201 to auxiliary treatment unit 202. A return conduit 507, connected to duct 201 at a return connection location 675, returns treated cotton to duct 201. The connection of conduits 505 and 507 to duct 201, and the associated automated directional valves, are shown in more detail in FIG. 6.
Turning now to FIG. 6, a duct valve for controlling the flow of cotton through duct 201 is shown generally at 609. Duct valve 609 is a leaf valve having a leaf 699, and is operated by an air cylinder 629. Air cylinder 629 includes a stationary end 639, and a movable end 649 connected to leaf 699. As best seen in FIG. 7, duct valve 609 is mounted so that leaf 699 may be positioned in a recess 707 in duct 201. Leaf 699 is recessed into duct 201 to prevent cotton from hanging on leaf 699.
The flow of cotton through supply conduit 505 is controlled by a supply valve 611. Supply valve 611 is also a leaf valve having a leaf 791 (see FIG. 7) , and is operated by an air cylinder 621. As best seen in FIG. 7, leaf 791 is mounted in a recess 708 in supply conduit 505 to prevent cotton from hanging on leaf 791.
The flow of cotton through return conduit 507 is controlled by a return valve 613. Return valve 613 is also a leaf valve, and is operated by an air cylinder 623. Return valve 613 includes a leaf portion 683 that moves within supply conduit 505, and a leaf portion 693 that moves within return conduit 507.
Duct valve 609, supply valve 611, and return valve 613 are each operable between a fully opened position that provides for unrestricted flow, and a fully closed position for complete flow stoppage. As used herein, "operable between a fully opened position and a fully closed position" means that the valve has two positions of operation, a fully opened position and a fully closed position. These positions are illustrated in more detail in FIG. 7 for duct valve 609 and supply valve 611. In a fully opened position 709, leaf 699 of duct valve 609 is positioned within recess 707, out of the cotton flow through duct 201. In a fully closed position 710, leaf 699 of duct valve 609 is transverse or perpendicular to the flow of cotton through duct 201. In a fully opened position 712, leaf 791 of supply valve 611 is positioned within recess 708, out of the cotton flow through supply conduit 505. In a fully closed position 711, leaf 791 of supply valve 611 is positioned transverse or perpendicular to the flow of cotton through supply conduit 505.
FIG. 6 illustrates return valve 613 in a fully opened position with leaf portions 683 and 693 aligned to permit unrestricted flow through supply conduit 505 and return conduit 507. In a fully closed position, leaf portion 683 is positioned transversely across supply conduit 505, and leaf portion 693 is positioned transversely across return conduit 507. In the fully closed position, return valve 613 prevents cotton from flowing through supply conduit 505 and return conduit 507.
In a small-scale system, leaf 699, leaf 791, leaf portion 683, and leaf portion 693 are each approximately six inches high by 15 inches wide. In a full-scale system, the valve leafs are approximately 66 inches or 96 inches wide, rather than 15 inches. The valve leafs shown in FIGS. 6 and 7 are preferably constructed from two pieces of 16-gauge steel, with -inch thick felt (element 713 in FIG. 7) sandwiched between to seal against the sides of the duct. The steel is bolted and welded to a 5/8-inch cold-rolled steel rod that extends beyond one side of the duct to connect to the movable end of the air cylinder (see, for example, movable end 649 of air cylinder 629 in FIG. 6) . A preferred air cylinder is a five-inch stroke, 5/8-inch diameter rod, 1.5-inch diameter air cylinder, such as Speedaire model 6X374, activated by a Humphrey Max-Myte model 345-4E2 solenoid.
In a diversion mode of operation, cotton is diverted from duct 201 to flow through auxiliary treatment unit 202. In the diversion mode, duct valve 609 is in fully closed position 710 to completely stop the flow of cotton through duct 201. Supply valve 611 is in fully opened position 712 to allow unrestricted flow of cotton from duct 201 through supply conduit 505. Similarly, return valve 613 is in the fully opened position to provide unrestricted flow of cotton from auxiliary treatment unit 202, through return conduit 507, to duct 201.
In a bypass mode of operation, diversion is deactivated to discontinue flow of cotton through auxiliary treatment unit 202. In the bypass mode, duct valve 609 is in fully opened position 709 to allow unrestricted flow of cotton directly through duct 201. Supply valve 611 is in fully closed position 711 to completely stop the flow of cotton from duct 201 through supply conduit 505. Similarly, return valve 613 is in the fully closed position to completely stop the flow of cotton through return conduit 507.
The sequencing of the valves to transition from the bypass mode of operation to the diversion mode of operation will now be described. Supply valve 611 and return valve 613 are opened to provide communication between duct 201 and auxiliary treatment unit 202. Duct valve 609 is closed to block the flow of cotton through duct 201. Duct valve 609 should be moved from fully opened position 709 to fully closed position 710 sufficiently fast to prevent cotton from hanging between duct 201 and leaf 699. Supply valve 611 and return valve 613 should be opened substantially simultaneously with the closing of duct valve 609 to release the vacuum suddenly created on the upstream side of duct valve 609. This prevents cotton from being pulled around leaf 699 of duct valve 609 to avoid creating a potential blockage.
The sequencing of the valves to transition from the diversion mode of operation to the bypass mode of operation will now be described. Duct valve 609 is opened substantially simultaneously as supply valve 611 is closed. Return valve 613 is then closed after a pre-determined time delay. The pre-determined time delay is necessary to allow cotton to clear auxiliary treatment unit 202. The time delay may be selected by one of skill in the relevant art to allow for differences in the machinery selected for the auxiliary treatment unit. A time delay of approximately five to eight seconds is suitable when the auxiliary treatment unit consists of a conventional lint cleaner, such as lint cleaner 160 shown in FIGS. 1 and 2. The time required for cotton to enter and exit a machine such as lint cleaner 160 is approximately three seconds, i.e., three seconds is required to "clear" the cotton from the machine. A time delay of five to eight seconds is thus adequate to clear a machine such as lint cleaner 160. However, cotton that bypasses auxiliary treatment unit 202 after supply valve 611 closes and duct valve 609 opens is mixed for five to eight seconds with cotton that is still flowing through auxiliary treatment unit 202. This results in a "double load" of cotton passing through return connection location 675 for approximately two to five seconds (predetermined time delay minus three seconds to clear auxiliary treatment unit 202) . The pneumatic system in a typical gin should be adequate to handle the momentary overload.
Computer system 240 controls the opening and closing of duct valve 609, supply valve 611, and return valve 613. Computer system 240 sequences the valves to transition from the bypass mode of operation to the diversion mode of operation. Computer system 240 also sequences the valves to transition from the diversion mode of operation to the bypass mode of operation. To control the pneumatic air cylinder of each of the valves, output signals from computer system 240 are transmitted through, for example, solid- state relays on a relay card.
To partially compensate for the sudden change in pressure in duct 201 during transition from the diversion mode of operation to the bypass mode of operation, a pressure stabilization valve may be disposed in duct 201. When a vacuum is produced in duct 201, cotton hangs or stagnates in the vacuum. The cotton can be released back into the flow by allowing atmospheric air to enter the duct. A preferred pressure stabilization valve is a manually- operated slide valve, shown generally at 619 in FIG. 6, that allows air to enter duct 201. As best seen in FIG. 8, slide valve 619 allows air to enter duct 201 through an opening 601 in the wall of the duct. A slide 821 is positioned to control the amount of air that enters through opening 601. For example, in a fully closed position 819, no air enters through opening 601. In a partially open position 820, air will enter duct 201 through the open space between position 819 and position 820. Opening 601 may be restricted by a perforated metal covering or a fine mesh screen to prevent extraneous material from entering duct 201.
Slide valve 619 can also be used to prevent cotton from stagnating in supply conduit 505. As shown in FIG. 6, slide valve 619 allows air to enter supply conduit 505 through an opening 605. Slide valve 619 usually remains at one setting for a particular machinery and duct arrangement. However, slide valve 619 can be equipped with vacuum switches for automatic control.
Auxiliary treatment unit 202 may alternatively include a seed cotton cleaner. In that situation, duct valve 609 and supply valve 611 may be several feet apart because the inlet and outlet of seed cotton cleaners are typically several feet apart. With such a configuration, slide valve 619 is particularly important to prevent cotton from stagnating in the duct between the valves .
An alternate embodiment of the automated directional valves of the present invention is shown in FIG. 9A. In this embodiment, a first diversion unit is shown as machine 1, and a second diversion unit as machine 2. Machine 1 is connected to duct 201 through supply conduit 505 and return conduit 507. Machine 2 is connected to duct 201 through conduit 905. In a manner similar to that shown and described above for FIG. 6, three valves are used to divert cotton to flow through machine 1. These valves include a duct valve 909, a supply conduit valve 911, and a return conduit valve 913. Duct valve 909 is operated between a fully opened position and a fully closed position by a rotary actuator 929. Similarly, supply conduit valve 911 and return conduit valve 913 are operated between a fully opened position and a fully closed position by a rotary actuator 921, and 923, respectively. The diversion and bypass modes of operation for machine 1 are analogous to those described above in connection with the embodiment shown in FIGS. 5-8.
Two valves are used to divert cotton to flow through machine 2. A duct valve 917 is operated between a fully opened position and a fully closed position by a rotary actuator 927. Similarly, a conduit valve 915 is operated between a fully opened position and a fully closed position by a rotary actuator 925. In the diversion mode of operation for machine 2 , cotton is diverted from duct 201 to flow through machine 2. In the cotton diversion mode, duct valve 917 is in the fully closed position to completely stop the flow of cotton through duct 201. Conduit valve 915 is in the fully opened position to allow unrestricted flow of cotton from duct 201 through conduit 905.
In the bypass mode of operation, diversion is deactivated to discontinue flow of cotton through machine 2. In the bypass mode, duct valve 917 is in the fully opened position to allow unrestricted flow of cotton through duct 201. Conduit valve 915 is in the fully closed position to completely stop the flow of cotton from duct 201 through conduit 905.
To partially compensate for changes in pressure, and to prevent cotton from stagnating, slide valves 619 are provided in duct 201 adjacent duct valve 909 and duct valve 917. Slide valve 619 is located on the upstream side of each duct valve so that, upon entry of the air, cotton is released into the upstream flow. As shown in FIG. 6, slide valves 619 are also used in supply conduit 505 and conduit 905 to prevent cotton from stagnating in these conduits. Computer system 240 may be used to control the valves in the embodiment shown in FIG. 9A in a manner similar to that described above for the embodiment of FIGS. 5-8.
Alternate embodiments of the automated directional valves of the present invention are shown in FIGS. 9B through 9D. The embodiments shown in FIGS. 9B through 9D are particularly preferred as cotton diversion means 250 for the seed cotton cleaners shown in the top row of FIG. 2, whereas the embodiments shown in FIGS. 5-9A are particularly preferred as cotton diversion means 250 for the lint cleaners shown in the bottom row of FIG. 2.
In the embodiment of cotton diversion means 250 shown in FIG. 9B, cotton enters under the force of gravity by falling though an opening 930. In this embodiment, air suction is not used to move the cotton. Once the cotton enters through opening 930, it flows through a diverted or active leg, leg 932 shown in FIG. 9B. A valve leaf 942 is in the fully opened position, allowing cotton to flow through leg 932. To close off the flow of cotton through leg 932, valve leaf 942 is rotated about a shaft 943 along an arc 952 to a fully closed position. Movement of valve leaf 942 can be done through use of, for example, a rotary actuator (not shown) mounted on a mounting 950.
Cotton is prevented from flowing through a bypassed or inactive leg, leg 934 shown in FIG. 9B . A valve leaf 944 is in the fully closed position, preventing cotton from flowing through leg 934. To allow cotton to flow through leg 934, valve leaf 944 is rotated about a shaft 945 along an arc 954 to a fully opened position. Movement of valve leaf 944 can also be done through use of, for example, a rotary actuator mounted on mounting 950. Valve leafs 942 and 944 are moved substantially simultaneously. Valve leafs 942 and 944 may be connected by an adjustable, threaded turnbuckle, or other similar device, so that they move together. Alternatively, valve leafs 942 and 944 may be driven by separate devices .
A sponge rubber seal 940 is used to prevent valve leaf 942 and valve leaf 944 from vigorously impacting into the metal sides of leg 932 and leg 934, respectively, as they move to the fully opened position. Use of sponge rubber seal 940 prevents the creation of undue fatigue, as well as noise.
Computer system 240 controls the opening and closing of valve leafs 942 and 944. To change the leg through which cotton is diverted to flow, computer system 240 substantially simultaneously directs the valve leaf currently in the fully opened position (valve leaf 942 in FIG. 9B) to close, and directs the valve leaf currently in the fully closed position (valve leaf 944 in FIG. 9B) to open .
A further embodiment of cotton diversion means 250 is shown in FIG. 9C. The configuration of this embodiment is similar to that of FIG. 9B, and only the differences will be noted. Cotton diversion means 250 illustrated in FIG. 9C is equipped with an expanded metal element 960 on leg 934 and leg 932. Expanded metal element 960 is shown in more detail in FIG. 9D. Expanded metal element 960 allows air to flow into a leg when the corresponding valve leaf has been moved away from expanded metal element 960 to the fully closed position. In FIG. 9C, valve leaf 944 is in the fully closed position. When suction means, such as a fan, is used to draw suction in leg 934, air will flow through expanded metal element 960 and seal 940 to purge cotton from the inactive (bypassed) leg. Seal 940 allows air to pass when suction is drawn on the corresponding leg, but seals against air entering the leg through expanded metal element 960 unless desired by drawing suction. In FIG. 9C, expanded metal element 960 is closed off by valve leaf 942 to prevent air from entering into leg 932.
To change the leg through which cotton is diverted to flow, auxiliary suction means (not shown) , such as an auxiliary fan, is activated prior to changing the position of the valve leafs. Consequently, air is drawn through inactive leg 934 through expanded metal element 960. Air is drawn through active leg 932 via the main fan or suction means moving cotton through the system. Computer system 240 then substantially simultaneously directs the valve leaf currently in the fully opened position (valve leaf 942 in FIG. 9B) to close, and directs the valve leaf currently in the fully closed position (valve leaf 944 in FIG. 9B) to open. The auxiliary fan is powered for a time period sufficient to purge cotton from the previously active leg. This time period is a function of the length of duct in which the cotton can be trapped. Motion sensors can be used to determine when to turn off the auxiliary fan, or a timer with a predetermined time delay can be used. Alternatively, the auxiliary fan can remain continuously powered, such as when continuous changing between the active and inactive legs is occurring .
In one embodiment of the present invention, computer system 240 uses PLC 2050 to control the operation of cotton diversion means 250 associated with each gin machine. The connection between PLC 2050 and cotton diversion means 250, such as valves 609, 611, and 613, or valve leafs 942 and 944, would be readily apparent to one of skill in the relevant arts, and has been omitted for brevity.
Computer Program Implementation of the Preferred Embodiment
The process control system of the present invention is implemented by computer system 240 that includes control logic or computer software that directs its operation. In one embodiment, the present invention is directed to a computer program product comprising a computer readable medium having control logic (computer software) stored therein. The control logic, when executed by processor 404, causes processor 404 to perform the functions of the invention as described herein. In another embodiment, the present invention is directed to a program storage device readable by a machine that tangibly embodies a program of instructions executable by the machine to carry out the control process of the present invention.
FIG. 10 shows a block diagram illustrating implementation of the process control system of the present invention. In one embodiment, the process control system of the present invention is implemented using three software programs: (1) a process control decision and measurement program 1010; (2) a dynamic programming model 1020; and (3) a process control implementation program 1030. These three programs will be described in Sections 3. a., 3.b., and 3.c. below. To assist personnel operating the gin, process control decision and measurement program 1010 and process control implementation program 1030 provide output to a display 1040. Display 1040 includes the display associated with computer system 240, as well as other computer systems or CRTs communicating with computer system 240 via network 418 (see FIG. 4) . The present invention preferably includes a display configured for the ginner' s use (see, for example, FIG. 17b described below) .
A flow diagram of the process steps carried out for Station 1 (see FIG. 2) is shown in FIG. 11. In a step 1102, a sample of seed cotton is collected at feed control 220 using, for example, ram 216. In a step 1104, the seed cotton sample is measured using camera 212 and moisture meter 214 to obtain sensor data (shown as 1016 in FIG. 10) on color, trash content, and moisture content. The staple length of the cotton and the maximum lint turnout are not measured. Rather, a reference staple length is input by the operator at the time of processing or as the cotton module or trailer comes into the cotton gin. If staple length and turnout are not entered into computer system 240 by the ginner, then the system of the present invention defaults to typical reference values for staple length and turnout stored within dynamic programming model 1020. Such a reference staple length and turnout can be readily determined by one of skill in the relevant art based upon the variety of cotton being processed, the time of harvest, etc.
Using sensor data 1016 and the reference staple length and lint turnout obtained in step 1104, and a gin decision matrix generated by dynamic programming model 1020, a gin process control decision for the optimum gin machine sequence is made in a step 1106. As explained more fully below, dynamic programming model 1020 generates a gin decision matrix using cotton quality parameters 1026 and price structure 1024 that are input to a gin model 1022. Step 1106 optimizes the gin machine sequence for drying and cleaning between Stations 1 and 2 for the particular cotton input into the ginning system at feed control 220. Predicted values for the color, trash content, moisture content, staple length, and lint turnout for the cotton after it has undergone the selected drying and cleaning sequence between Stations 1 and 2 are computed and stored in a step 1108. The predicted values are computed using the sensor data values measured in step 1104, the drying and cleaning sequence selected in step 1106, and the effect on each of the parameters by the machines actually used in the selected sequence.
The predicted values computed in step 1108 are used in a step 1110 during which an error feedback Error12 is received (denoted by 1208) and processed. As best seen in FIG. 14, Error12 is the difference (denoted by Δ in FIG. 14) between the data measured at Station 2 for color, trash content, and moisture content, and the predicted values, computed and stored in step 1108, that each of these parameters will have at Station 2. Error12 is weighted, as denoted in a step 1112. The weight accorded to Error12 may be zero, in which case Error12 is ignored, and the error feedback process of the present invention is disabled. The predicted values for color, trash content, and moisture content are adjusted using Error12 in a step 1114. Error12 is also used to adjust the decision for the optimum gin machine sequence in a step 1116. The measured values are adjusted by Error12, and the decision process is iterated. The error feedback process of the present invention corrects for differences in the performance characteristics of the machinery. This is needed because different machines have different efficiencies, and the performance of each machine also changes with use and over time. Additionally, the ease of removal of foreign matter and moisture differs for varying types of cotton. The error feedback process of the present invention eliminates the need for precise performance characteristic tables or algorithms for each gin machine.
A flow diagram of the process steps carried out for Station 2 (see FIG. 2) is shown in FIG. 12. In a step 1202, a sample of seed cotton is collected using paddle sampler 218 after the cotton flows through gin stand 150. In a step 1204, the seed cotton sample is measured using camera 212 and moisture meter 214 to obtain sensor data on color, trash content, and moisture content. In a step 1206, the measured sensor data is compared to the predicted values computed in step 1108 to determine Error12. Error12 is fed back to Station 1 (step 1110) in a step 1208.
Using the sensor data obtained in step 1204, and the gin decision matrix generated by dynamic programming model 1020, a gin process control decision for the optimum gin sequence of lint cleaners is made in a step 1210. Step 1210 optimizes the gin sequence of lint cleaners for cleaning between Stations 2 and 3 for the particular cotton after processing between Stations 1 and 2. Predicted values for the color, trash content, and moisture content for the cotton after it has undergone the selected lint cleaner sequence between Stations 2 and 3 are computed and stored in a step 1212. The predicted values are computed using the data values measured in step 1204, the cleaning sequence selected in step 1210, and the effect on each of the parameters by the lint cleaners actually used in the selected sequence.
The predicted values computed in step 1212 are used in a step 1214 during which an error feedback Error23 is received (denoted by 1308) and processed. As best seen in FIG. 14, Error23 is the difference (denoted by Δ in FIG. 14) between the data measured at Station 3 for color, trash content, and moisture content, and the predicted values, computed and stored in step 1212, that each of these parameters will have at Station 3. Error23 is weighted, as denoted in a step 1216. The weight accorded to Error23 may be zero, in which case the error feedback process of the present invention is disabled. The predicted values for color, trash content, and moisture content are adjusted using Error23 in a step 1218. Error23 is also used to adjust the decision for the optimum gin sequence of lint cleaners in a step 1220. The measured values are adjusted by Error23, and the decision process is iterated. The measured values at Station 3 are also used to verify predicted values for the entire system.
A flow diagram of the process steps carried out for Station 3 (see FIG. 2) is shown in FIG. 13. In a step 1302, a sample of cotton is collected using paddle sampler 218 after the cotton has completed processing through the selected sequence of lint cleaners 160. The seed cotton has now been processed into lint. In a step 1304, the lint sample is measured using camera 212 and moisture meter 214 to obtain sensor data on color, trash content, and moisture content. In a step 1306, the measured sensor data is compared to the predicted values computed in step 1212 to determine Error23. Error23 is fed back to Station 2 (step 1214) in a step 1308.
Each of the three software programs illustrated in FIG. 10 that carry out the process of the present invention will now be described. It is to be understood that the use of three software programs as shown in FIG. 10 is presented by way of example only. The functions of the three software programs could be carried out, for example, in one software program. In a particularly preferred embodiment, the three software programs illustrated in FIG. 10 are combined into a composite software program written in the C programming language. Also, the functionality described below could alternatively be achieved using hardware modules .
a. Process Control Decision and Measurement Program 1010 In a preferred embodiment, process control decision and measurement program 1010 is implemented using the C programming language, although other languages can be used. Program 1010 performs the function of selecting the optimum gin process control decision, as indicated by 1012. To select the optimum gin process control decision, program 1010 controls the measurement of cotton being processed in the gin, as shown at 1014, to obtain sensor data 1016. Sensor data 1016 includes color and moisture and trash content measurements made on the cotton as it progresses through the gin.
Filtering or smoothing of the sensor data measured by the system of the present invention is preferable because there is electrical and other noise inherent in the measurement process, and because an incorrect process control decision can have adverse economic impact on the farmer whose cotton is being processed in the gin. Such filtering or smoothing can be carried out by taking a series of electrical signal measurements over a specific time interval (e.g., 64 measurements during 1/60 second), and using the arithmetic mean of the readings. In addition, analog filters can be used to reduce the high frequency noise, and digital filters can be used to reduce the lower frequency noise as described in R. Bibbero, Microprocessors in Instruments and Control , John Wiley & Sons, Inc. (1977). It is also preferable to require that several, or a plurality of several, consecutive gin process control decisions (1012) be the same before the decision is implemented (1032) .
Another preferred method of implementing hysteresis control, and controlling unwanted variability of the output, is to use a counter. The counter incremented after every control decision that calls for a first state. The counter is decremented when the control decision calls for a different second state. When the counter increases past a predetermined value, the first control decision is implemented. When the counter decreases below a lower predetermined value, the second control decision is implemented. The counter is not allowed to count above or below additional predetermined limits .
Process control decision and measurement program 1010 implements the error feedback process of the present invention. As noted above, the present invention may be used in gins equipped with various configurations and types of machines made by a variety of manufacturers. These machines will also be in varying states of repair. Thus, the performance of each of the machines in a particular gin may not be perfectly represented by the tabular or algorithm-based transition functions of the present invention. As such, the error feedback process of the present invention compensates for the error resulting from the difference between the actual performance of the machines in a gin and the mathematical functions used by the present invention.
To implement the error feedback process , one embodiment of program 1010 measures a set of data (color, moisture content, and trash content) at Station 1, and assigns a time to that set of data. The time it takes, in seconds, for the cotton to get from Station 1 to Station 2 (and from Station 2 to Station 3) as a function of gin machinery sequence is contained in a gin configuration file. The contents of one embodiment of a gin configuration file are shown in FIG. 15. Program 1010 uses the clock contained in computer system 240, along with the time assigned to the set of Station 1 data and the times in the gin configuration file, to track when the cotton measured at Station 1 should be at Station 2. A number of measurements are taken at Station 2 in the vicinity of the computed arrival time. The average of these Station 2 measurements is used to represent the characteristics of the cotton initially measured at Station 1 after processing between Stations 1 and 2. Program 1010 compares the average of the Station 2 measurements to the values predicted from the Station 1 data to generate Error12. A similar process may be used between Stations 2 and 3 to generate Error23.
The error may be weighted using a weighting factor from 0 to 100%. With a weighting factor of 0, the error feedback process of the present invention is "off" or disabled. With a weighting factor of 100%, the Station 2 measurement is averaged one for one with the Station 1 measurement to adjust the predicted values for Station 2 and to adjust the optimum gin machine sequence between Stations 1 and 2. Likewise, with a weighting factor of 100%, the Station 3 measurement is averaged one for one with the Station 2 measurement to adjust the predicted values for Station 3 and to adjust the optimum gin machine sequence between Stations 2 and 3. With a weighting factor of 50%, the measurement at Station l would be weighted twice that of the measurement at Station 2. Conversely, with a weighting factor of 50%, the measurement at Station 2 is given half the weight of the measurement at Station 1 in adjusting the predicted values for Station 2 and the optimum gin machine sequence between Stations 1 and 2. Similarly, with a weighting factor of 50%, the measurement at Station 3 is given half the weight of the measurement at Station 2 in adjusting the predicted values for Station 3 and the optimum gin machine sequence between Stations 2 and 3. The weighting factors may be contained in a gin configuration file, such as show in FIG. 15. Measurements at each station are taken at time intervals, controlled, for example, by time delay relays at the measurement stations. In a preferred embodiment, measurements at Stations 1 and 2 are taken every 3 seconds, and once per second at Station 3. All measured data is recorded in an ASCII file. In a separate file, histograms, means, standard deviations, and minimum and maximum values are calculated and stored for each variable . Although staple length and lint turnout are not measured, the change in the value of these variables is calculated since these variables are affected by machinery in the gin machine sequence. The measurements at Stations 1, 2, and 3 can be used to instantaneously change the machinery sequence, or the changes can be made after a selected time period, or after a selected number of consecutive decisions that require the identical machine change . For example , the machinery sequence can be changed after a pre-determined time interval (e.g., five minutes) has elapsed after the change is identified. Alternatively, the machinery sequence can be changed after a specified number of measurements are taken that all indicate that the machinery sequence should be changed to the same new machinery sequence . Changing the machinery sequence after a selected time period or after a selected number of consecutive decisions provides hysteresis control for the system. In a preferred embodiment, four consecutive decisions to change the machinery sequence to the same new machinery sequence are required before the sequence is changed, i.e., before the decision corresponding to the new machinery sequence is implemented by process control implementation program 1030. The number of decisions that are required before the sequence is actually changed is a parameter that can be made available for change by the operator, or can be pre-programmed as a fixed value. In this manner, the system and method of the present invention can be customized to meet the needs of a particular gin. The machine sequence actually being used can be continuously displayed on display 1040, as well as the recommended sequence .
Another preferred method of implementing hysteresis control, and controlling unwanted variability of the output, is to use a counter. The counter incremented after every control decision that calls for a first state. The counter is decremented when the control decision calls for a different second state. When the counter increases past a predetermined value, the first control decision is implemented. When the counter decreases below a lower predetermined value, the second control decision is implemented. The counter is not allowed to count above or below additional predetermined limits. Process control decision and measurement program 1010 can also implement an override feature that allows the measurements taken at Station 3 to "override" the decision made at Station 2. Measuring means 210 at Station 3 generally provides the most accurate measurements because the cotton is at the end of the processing sequence and it has been combed and blended several times. In a preferred embodiment, program 1010 uses the level of reflectance, yellowness, moisture, and trash content at Station 3 to determine what the gin machinery sequence decision at Station 2 should have been. If the gin machinery sequence decision actually made at Station 2 was different, then the override feature can be implemented so that the gin machinery sequence determined from the measurements at Station 3 overrides the gin machinery sequence decision made at Station 2. The override feature is preferably implemented as a menu option. The override feature can be particularly useful if measuring means 210 at Station 2 is malfunctioning.
Process control decision and measurement program 1010 can also implement an automated calibration procedure for calibrating the various instruments of measuring means 210. A particularly preferred autocalibration procedure is described in U.S. Patent No.: 5,639,955 the entirety of which is incorporated herein by reference .
In one embodiment, program 1010 uses a gin configuration file, such as shown in FIG. 15, to store such items as valve positions, process times for the various gin machines, weighting factors for the error feedback process, time before machine selection can change, and how often to sample or measure data at each of Stations 1, 2, and 3. A screen display for editing the gin configuration file is shown in FIG. 15. The screen display of FIG. 15 is divided into three areas. The area on the left consists of a matrix in which each row corresponds to 13 machines: drier 1 at levels 1, 2, and 3 (1D1, 1D2 , and 1D3 , respectively); cylinder cleaner 1 (CCl) , stick machine 1 (SMI) ; drier 2 at levels 1, 2, and 3 (2D1, 2D2 , and 2D3 , respectively); cylinder cleaner 2 (CC2) ; impact cleaner 1 (IC1) ; and three lint cleaners (LCI, LC2, and LC3) . The three levels for the drier refer to the number of shelves or fraction of the drier that is being used. Drier level 1 refers to 6 shelves or % of the drier; drier level 2 refers to 12 shelves or Yi of the drier; and drier level 3 refers to 24 shelves or all of the drier. Each column in the area on the left corresponds to a particular machine sequence character, '
(blank) and X ' through * Z' . A VY' under a particular sequence character and in a particular row results in that machine being used whenever that particular sequence character was read from the decision matrix. A Λ ' (blank) results in that machine not being used. For example, machine sequence "R" includes drier 1 at level 1 (1D1) , cylinder cleaner 1 (CCl), drier 2 at level 2 (2D2) , impact cleaner 1 (IC1) , and two stages of lint cleaning (LCI and LC2) . A stick machine (SMI) is not used in machine sequence "R" . The middle area of the screen display of FIG. 15 is organized by rows corresponding to the 13 machines, and columns corresponding to various parameters of each machine . The entry column contains the time in seconds that it takes the cotton to travel from Station 1 (reference point for time measurement) to the valve used to route cotton either through (diversion mode) or around (bypass mode) the particular machine. The exit column contains the additional time in seconds that it takes the cotton to go through the machine (diversion mode) and reach the valve where the cotton reenters the main flow of cotton. The bypass column contains the time in seconds that it takes the cotton to bypass the machine, i.e., to travel between the valve at the entrance to the machine and the valve at the exit of the machine.
The filter column contains the time in seconds that a particular machine must be continuously selected (diversion mode) or not selected (bypass mode) before the valve can be switched to the other mode of operation. This filters out momentary changes in the position of the valves that would otherwise occur. The foregoing applies for valves, such as those shown in FIGS. 5-9A, for routing cotton through or around lint cleaners, as well as for valves, such as those shown in FIGS. 9B-9D, for routing cotton through or around seed cotton cleaners .
The middle area of the screen display of FIG. 15 also contains a column labeled Weight % . The weight % value is used when cotton diverted through the particular machine reenters the main duct and combines with cotton that had bypassed that machine . The weight % value is used to weight the predicted values of moisture content, trash content, and color based on this mixing of diverted and bypassed cotton. With a weight % value of 1.00, the predicted values are based upon the cotton that was diverted through that machine, and with a weight % of 0.00, the predicted values are based upon the cotton that bypassed that machine . As another example, a weight % value of 0.75 results in a predicted value that is equal to the sum of 0.75 times that of the cotton that was diverted through the machine and 0.25 (1-0.75) times that of the cotton that bypassed the machine . A weight % value of 0.5 is preferably used.
The third area of the screen display of FIG. 15 (located at the extreme right) is organized into a section for each of measurement Stations 1, 2, and 3. The rate is the time in seconds between requests by computer system 240 for the measurement of data. Computer system 240 requests a new reading from measuring means 210 at a time interval equal to the rate shown. The rate at the three measurement stations does not have to be the same, so that each station can have a rate that is different from the rate at the other stations. Filter is the time in seconds over which the readings from measuring means 210 are averaged. Entry is the time in seconds that it takes the cotton to reach Station 2 or Station 3 from Station 1, assuming the cotton has bypassed all machines. Finally, weight in this area of the screen display is used to determine the amount of the error (difference between actual and predicted values) that is fed back to the previous measurement station. The error feedback is computed by multiplying the difference between the actual and predicted values by the weight value, taking the sum, and dividing by the number of sample readings. A weight value of 0.00 disables the error feedback function.
A screen display for editing the gin decision matrix file is shown in FIG. 16. FIG. 16 shows one element of a decision matrix for one price structure and the transition function tables provided in Tables 1-15. The gin decision matrix is a three dimensional matrix with the X axis corresponding to moisture content, the Y axis corresponding to trash content, and the Z axis corresponding to color. The moisture content ranges from 3.00 to 10.00 in increments of 0.25. The trash content is represented by a statistical index that ranges from 72 to 100 in increments of 2. Finally, the color is represented by color code values from 31 to 73. The cell position at a particular value of moisture, trash, and color will contain a machine sequence character. The machinery configuration that corresponds to the machine sequence character is contained in the gin configuration file discussed above. The complete three dimensional gin decision matrix is composed of many elements, of which FIG. 16 is a representative example, that correspond to all possible combinations of moisture content, trash content, and color.
The first stage (Station 1 to Station 2) machine sequence character is either a ' (blank) or character from %A' to ΛZ' .
The moisture, trash, and color readings from Station 1, adjusted by error feedback if not disabled, are used to enter the gin decision matrix. The first stage machine sequence character located at that cell position is used to determine from the gin configuration file which of the machines between Stations 1 and 2 will be used (diversion mode) and which will be bypassed. The drier sequence character is used in a similar manner to determine the number of shelves to be used in each drier.
The second stage (Station 2 to Station 3) machine sequence character determines which of three lint cleaners are to be used in the second stage. The moisture, trash, and color readings from Station 2, adjusted by error feedback if not disabled, are used to enter the gin decision matrix to locate the cell position for the second stage machine sequence character.
In the example shown in FIG. 16, machine sequence V includes a cylinder cleaner (CCl) , a stick machine (SMI) , and an impact cleaner (IC1) in a first portion of the optimum machine sequence. A "Y" indicates that the particular machine is used in the sequence, whereas a "blank" indicates that the machine is not used. Based upon processing through such a first stage, the predicted values of moisture, trash, and color at Station 2 are shown. A second portion of the optimum machine sequence is machine sequence C that includes two stages of lint cleaning (LCI and LC2) . Based upon processing though such a second stage, the predicted values of moisture, trash, and color at Station 3 are shown.
One embodiment of a screen display for the process control system of the present invention is shown in FIG. 17a. This display includes the raw sensor data measured at Stations 1, 2, and 3 , the predicted values for Stations 2 and 3 , and the error feedback for Stations 1 and 2. For example, at Station 2, a reflectance (Rd) of 56.3 and a +b (yellowness) of 8.2 was measured. These raw values of Rd and +b correspond to a color code of 61. A conversion or lookup table can be used to convert between Rd, +b and color codes. Such a conversion table is contained in file UPLND.COL in the attached microfiche appendix. The raw measured data for trash at Station 2 is area 54 (0.54% of the pixels covered by trash) and count 31 (related to the number of pixels covered by trash) . The area and count are converted to a leaf or trash code that ranges from 2 to 8; in this example , code 5.
The screen display shown in FIG. 17a contains a line labeled "Filtered Reading" at each measurement station. The moisture reading represents the actual moisture content (percentage) measured at each station, e.g., 6.38% at Station 2. The color code listed for the filtered reading at each station represents the better of the predicted color value based on the measurements made at Station 1, and the actual color measured at Station 3. The most accurate reading of color is made at Station 3 because the cotton has been cleaned and the seeds removed so that a more uniform product is available for measurement. The filtered trash reading is obtained by converting the area and count to a statistical trash index, such as is done by the procedures in the CONTDECF.C file of process control decision and measurement program 1010 described below.
The screen display in FIG. 17a also includes the error feedback values for Stations 1 and 2. In the example shown in FIG. 17a, the error feedback provided to Station 2 (Error23) is +0.14 for moisture, +0.00 for color, and +1.4 for trash. These values are computed using the difference between the predicted and actual values and the weight contained in the gin configuration file for Station 3.
The gin machine sequence in use is also displayed in FIG. 17a, including the first stage machines between Stations 1 and 2, and the second stage lint cleaning machines between Stations 2 and 3. The decision matrix file and the gin configuration file being used are also indicated.
A particularly preferred embodiment of process control decision and measurement program 1010 is provided in the attached microfiche appendix. This preferred embodiment can be used in a gin having a configuration substantially as shown in FIG. 2, and can be used with the hardware interface shown in FIG. 20. The source code refers to paddle sampler 218 as a "flapper" . This preferred embodiment of process control decision and measurement program 1010 is written to use the embodiment of dynamic programming model 1020 attached hereto in the microfiche appendix.
As explained more fully below in Section 3.b., in such an embodiment of dynamic programming model 1020, algorithmic rather than tabular transition functions are used. The optimum machine sequences are generated by the algorithms, rather than being stored in a table. As such, a gin configuration file is not used in this preferred embodiment of process control decision and measurement program 1010.
The attached preferred embodiment of program 1010 is written in the C programming language, and contains a total of 20 files.
There are seven ".C" files and 12 external included " .H" files.
The function of each of these files will be briefly summarized below. A computer programmer skilled in the relevant art could readily interpret and implement the present invention based on the disclosed source code, i . LCADV2. C This file includes a MAIN_SECTION that records the current computer screen display settings, runs a setup procedure, and runs an open menu procedure. When the program returns from the open menu procedure, this section returns the screen to the mode it was in when the program was called, and exits the program. In the setup procedure, output control lines are set to the failsafe condition for the gin, either high or low for a particular line. Files and variables are also initialized.
The open menu procedure is the first portion of the code that provides an interface to the user. A menu is displayed so that a user can select one or more functions to be performed. The functions include implementing process control and measurement, performing selected diagnostics, or performing calibrations of the equipment and sensors within the system. If the user selects "0", the system autocalibrates the sensors at Station 2, and returns to the menu. A selection of "9" autocalibrates the sensors at Station 3. If the user selects "1", the system sets the sample collection means at each measurement station for proper operation, and begins to run the data collection and control portion of the program (getdata2 procedure described below) . If the user selects "2", the digital input lines are read, and the values displayed on the screen. If the user selects "3", the program outputs a varying series of bits to the output data lines as a diagnostic check. A selection of "5", "6", or "7" results in color calibration of the camera at Stations 1, 2, and 3, respectively. A selection "a", "b" , or "c" results in trash calibration of the camera at Stations 1, 2, and 3, respectively. If the user selects "e", the values from A/D converter 2010 are displayed so that the analog inputs can be checked. If the user selects "f", a measurement of color and trash is immediately obtained from one of the measurement stations, and displayed on the screen. If the user selects "8", the use of data from Station 3 is switched on or off, and the setting is displayed on the screen. A selection of "x" or "X" will exit the program to the operating system (DOS) . Additional functions are possible with the embodiment contained in the attached microfiche appendix, even though these functions are not presented to the user in the menu. For example, if the user enters "d", the seed cotton cleaner selection is changed, even though this is not listed as a menu choice. If "d" is selected, computer system 240 passes control bits to PLC 2050 to change the selection of seed cotton cleaners. If the user enters "g", computer system 240 requests PLC 2050 to switch to one lint cleaner. A selection of "h" generates a request to PLC 2050 to switch to two lint cleaners. A selection of "i" cycles paddle samplers 218 between open and closed. A selection of "j" cycles the position of calibration tiles used to calibrate the color and trash sensors at Stations 2 and 3. If the user enters "k" , a tag message is checked. The tag message refers to the bar code information contained on the tag for each bale being processed. A selection of "1" cycles the sample collection means at Stations 1, 2, and 3 as they are done during a data collection phase. Finally, a selection of "m" cycles an additional sample collection means which may be used for infrared moisture measurements behind gin stand 150.
The getdata2 procedure is the primary procedure for data collection and process control. It cycles continuously until a function key is pressed to exit the procedure. This procedure starts by clearing the screen and initializing variables. This procedure sets up the frame grabber used in the trash measurement, checks function keys, and also measures analog inputs not related to color or trash. It checks the last moisture content readings to determine if they are within a reasonable range. If the moisture content readings are within a reasonable range, they are left unchanged. If the moisture content readings are not within a reasonable range, the procedure sets them to extreme values to flag them as incorrect readings for other parts of the code.
The getdata2 procedure then starts data collection at Station 1. The sample collection means at Station 1 is triggered to collect a sample, the most recent readings from Station 3 are added to the running total so that average values can be calculated, and a "wait closure" for Station 1 is executed. The wait_ closure procedure waits for a certain period of time (time out period) , or until closure of the sample collection means is verified through the use of position or proximity sensors, whichever comes first . At the beginning of the wait_closure procedure, the location of the bit that signals whether the sample collection means ("flapper") is closed is read, along with the number of seconds for the wait or time out period. If either the sample collection means is verified to be closed, or the time out period expires, the wait_closure procedure returns to the calling program. A flag is passed back indicating whether verification of closure of the sample collection means was obtained.
Once the sample collection means has closed, or the wait_closure procedure has "timed out", the getdata procedure collects the data for Station 1. Similar procedures are repeated for Stations 2 and 3. The getdata procedure controls color and trash data collection. The code executes based upon three camera counts of 0 , 1, and 2. The code first sets up the frame grabber channel by switching the multiplexer between the three channels . Trash and color measurements are then made. The trash and color measurements are then analyzed to determine if the readings are within a reasonable range. If the readings are within a reasonable range, they are left unchanged. If the readings are not within a reasonable range, the readings are set to extreme values to flag other parts of the code that the readings are incorrect .
The getdata2 procedure also calculates the number of lint cleaners and the sequence of seed cotton cleaning recommended by dynamic programming model 1020. These calculations are made based upon measured values of Rd, +b, and percent area of trash. When measured values of moisture content are within an acceptable range indicating that they are reliable, actual measured values of moisture content are used in these calculations. Otherwise, a value of 5% moisture content is used in the calculations. This procedure also controls the number of decisions or readings that are required before a change in the number of lint cleaners is made. Finally, the getdata2 procedure checks the time of day, and opens a new file for data logging if the date has changed. This procedure also keeps track of when autocalibration is required at each measurement station. If the autocalibration feature is active and it is time for a new autocalibration, the autocal procedure is called.
In the attached embodiment, the autocal procedure is written to run automatic calibrations at Stations 2 or 3. Preferably, automatic calibration is performed at Station 1 as well. It would be readily apparent to one of skill in the relevant arts how to modify the attached code to perform automatic calibration at Station 1. The attached autocal procedure code is divided into two sections, one section for each station. The procedure begins by opening and closing the paddle samplers to which the calibration tiles for the sensors are attached. This removes dust that tends to settle on the calibration tiles. The calibration tiles are pulled across a section of lambs wool to clean them before calibration begins. When the calibration routine is completed, the calibration tile paddle samplers are again opened and closed several times to dislodge any cotton that may have been caught on the paddle samplers. The autocalibration procedure is described in more detail in U.S. Patent No. 5,639,955, the entirety of which is incorporated herein by reference.
The LCADVl . C includes several procedures for keeping track of bale numbers, and for calculating the means and modes of the measured parameters for each individual bale . ii . COLORF . C
This file contains a collection of procedures that relate to color calibration based on a five tile procedure, to color measurement, and to measurement of other variables, such as analog moisture values and analog temperature data, using A/D converter 2010. All readings of A/D converter 2010 are made in this collection of procedures. This file also contains the compute_color procedure for converting to color code from the measured Rd and +b readings .
The mcmgr procedure in this file is the moisture content measurement manager software. It controls data collection from the resistance moisture sensors installed at Stations 1, 2, and 3. iii. TRASHF.C
This file contains procedures for measurement of trash content . The do_a_frame procedure takes a reading from an individual frame of the channel being pointed to by the video multiplexer that is part of video input 2030. It determines whether an individual pixel should be considered as trash. It counts the number of pixels that are trash in the complete image, and converts this reading to the percent of the total number of pixels that are in the complete image. The file calls a number of library functions that deal with the frame grabber that is also part of video input 2030.
This file also contains a number of procedures for calibration. The trsh_cal procedure is for calibration of the trash reading based upon a properly presented trash tile. Adjustments to the Y, Z, and percent area readings based on the calibration tiles are calculated in the calc_ctile_adj procedure. The calc_ctmean procedure takes the mean of several readings of Rd, +b, or percent area and stores them in a matrix. This is used to check he correct readings of the autocalibration tiles. iv . CONTDECF . C
This file contains the procedures for calculation or selection of the optimum process control decision using the gin decision matrix generated by dynamic programming model 1020. The ASCII file containing the gin decision matrix generated by dynamic programming model 1020 is opened, and the contents are read into a decision matrix within this C language program. The moisture content readings, as well as those for trash and color, are converted to indices which are then used to point into the decision matrix. The parea_to_clgr procedure converts the percent area measured by the trash meter to an estimated leaf value, used in the pricing of cotton. The scc_lookup procedure uses the values of Rd, +b, moisture and percent area to look up the optimum seed cotton cleaning sequence (between Stations 1 and 2) based on the decision matrix obtained from dynamic programming model 1020. The lc_lookup procedure uses the values of Rd, +b, moisture content and percent area to look up the optimum lint cleaning sequence (between Stations 2 and 3) based on the decision matrix obtained from dynamic programming model 1020. The lc_check and rule_of_thumb procedures are similar procedures used to adjust the decision relating to the number of lint cleaners being used to ensure that revenue is maximized. These two procedures use price structure 1024, as well as color and trash data from Station 3, to refine the decision for the number of lint cleaners based upon the level of cleaning actually achieved so that revenue is maximized. These two procedures ensure that in the region of a break point in price structure 1024, sufficient cotton cleaners are being used so that revenue will still be maximized, v. DGTLIOF. C
This file contains procedures used in digital input and output (I/O) . The main section of this code provides bitwise communication with PLC 2050, control of the sample collection means, and reading of the position sensors throughout the system. Additionally, procedures are provided for reading files on network 418 for communication with other computers that are measuring parameters associated with the gin system (kp_f_read and kp_f_write procedures) . For example, some gins are equipped with a gin computer into which the ginner will enter data that is contained on tags attached to the modules or trailers of seed cotton entering the gin. This tag data may include, for example, the name of the farmer, the variety of cotton, the farm number, the field number, and the harvest date. The tag data can be transmitted via network 418 from the gin computer to computer system 240. The kp_f read and write procedures can be used to display and record the tag data . The kp_f_ write procedure stores enough data to completely describe the current functioning of the system including: the tag data, the temperature of each of the dryers, the position of each of the seed cotton and lint cleaners, whether each gin stand is "in" or "out," the moisture content of the cotton at several places in the gin, the color and trash level of the cotton being ginned, the ginning rate, the bale number, and the mean value for the moisture, color, and trash of the last 10 bales . This information can be monitored from any computer on network 418 and displayed in near real time. In addition, it is possible to monitor the functioning of the gin from any computer through transfer of this data over telephone lines . In addition to displaying the tag data for the ginner, the tag data can also be used in determining the optimum process control decision. For example, default values for staple length and micronaire can be stored in a lookup table as a function of variety. The default value to be used by dynamic programming model 1020 for these two parameters can be obtained from such a lookup table after obtaining the variety from the tag data. The flapper procedure is used to control the flappers or sample collection means such as paddle sampler 218 or compression ram 216. Individual flappers can be opened or closed one at a time, or all flappers can be opened and closed at the same time. The calflap procedure controls movement of the flappers associated with the calibration tiles.
The chk_tagmsg procedure checks for a new bale tag message . The bale tag message is created by a computer at the bale press that reads the bar code tag that is attached to each bale of cotton. The bale tag message includes the bale number as well as the bale weight . The computer at the bale press sends the bale tag message to computer system 240 via network 418. If a new bale tag message is available on network 418, this message is read and stored by computer system 240 in a file, and the network file is erased. The chk_bc procedure monitors the state of a switch, usually a proximity switch attached to the bale press, to determine when bales are changed. This procedure reads the time at which the bale press turns , which is the exact moment that cotton is switched from the current bale into the next bale . The procedure provides for software debouncing to accommodate the bouncing encountered with mechanical switches .
The chk__lcu procedure reads the current number of lint cleaners for each of the gin stands, and the number of seed cotton cleaners being used, as transmitted to computer system 240 by PLC 2050.
The CompOK procedure provides a safety feature so that other computers or components in the system can detect if computer system 240 is not functioning properly. The code alternately switches one bit between high and low that resets a monostable multivibrator. If the code is operating properly, the monostable multivibrator will be continuously reset to the computer OK state. However, if the software stops proper operation of the computer, the monostable multivibrator is not reset, and this bit changes to an error condition that can be sensed by other computers or components in the system to detect that computer system 240 may not be functioning properly.
The wait_samp_open, wait_cal_closed, and wait_cal__open procedures all operate in a manner similar to the wait_closure procedure discussed above. At the beginning of the procedure, the byte and the bit signaling the opening (or closing) of the sample collection means ("flapper"; paddle sampler 218 or compression ram 216) ) , and a maximum number of seconds (time out period) the software is allowed to wait for the flapper to open, are read. This procedure reads the current state of the flapper as sensed by the proximity or position sensors, checks for keyboard function key entries, signals the monostable multivibrator not to time out, and checks the time. The process is repeated until a reading of open (or closed) is received from the proximity switch, or the time out period expires, vi. DISPLAYF.C This file displays information for the ginner on the display of control system 240 relating to the operation of the machinery, the process control decisions, how the control decisions are reached, and the bale averages for the past ten bales. The showCT procedure displays, for example, the data (color, trash, and moisture contents), current decisions, and current operating conditions (gin machine sequence currently being used) . The showBA procedure displays data on the last ten bales processed through the gin. The showCalBa procedure displays calibration and other data in the same area where the bale average data is normally displayed. vii. LOGDATAF.C This file contains procedures for logging data to hard disk drive 412 of computer system 240 and network 418. The procedures ensure that files are opened under unique names based on the date, and the files that have already been opened on that date. If a file is available on network 418 and hard disk drive 412, then the data is written to both locations. viii. ".H" Files
The attached microfiche appendix contains twelve ".H" files which are external files that are included into the seven ".C" files discussed above. These files are used to include other files that are part of a Microsoft C package, files that are part of a color and trash measurement system obtained from MCI , and files that are part of a frame grabber system obtained from Catenary Systems .
HVICONST.H contains code that defines values and structures for the MCI color and trash measurement system. CAINC.H contains many of the external "includes." The three files "vicdefs.h, vicfcts.h, and vicerror.h" are part of the Victor Software Library for the frame grabber card. The three files "hviconst .h, hvimain.h, and driver. h" are part of the MCI package for the color and trash measurement cameras . The remainder of the files that are included in CAINC.H are part of the basic Microsoft C package. These are all files that contain drivers and software for the hardware in the system, as well as the operating system. CADEF.H contains many of the "defines" used throughout process control decision and measurement program 1010. The defines in this file are addresses and unchanging variable values. CAEXT.H contains declarations for all the global variables that are used in program 1010.
The CAPROTO.H file contains the seven "include" files that have the declaration of the types for each of the seven ".C" files . They are located in separate files that correspond to the source code files that contain the C source code. The ColorPrt.h file contains the declarations for the procedures contained in the COLORF.C file. The declarations pertain primarily to color measurement and color calibration, but also include declarations of all the analog data collection that is used in the system. The TrashPrt.h file contains declarations for the procedures related to the frame grabber and trash measurements used in the TRASHF.C file. The ContDPrt.h file contains declarations for procedures used in the CONTDECF.C file. The DgtIIPrt.h file contains declarations for all of the procedures used in the DGTLIOF.C file for digital input and output (e.g., opening and closing flappers for sample collection as well as the bitwise data transfer between PLC 2050 and computer system 240). The DisplPrt.h file contains declarations for the procedures used in DISPLAYF.C to display data on the computer display in the gin. The LcadvPrt.h file contains declarations for the procedures used in LCADVl.C. The declarations for these procedures are related to control of data collection, calculation of means and modes of the collected data, and execution of autocalibration procedures. The LogDaPrt.h file contains declarations for the procedures contained in LOGDATAF.C. An alternate embodiment of a screen display for the process control system of the present invention is shown in FIG. 17b. The screen display shown in FIG. 17b is representative of a display that would be provided for the ginner in a gin equipped with the preferred embodiment of process control decision and measurement program 1010 described immediately above. In the example shown in FIG. 17b, the gin is actually equipped with three parallel gin machinery sequences, identified as Gin 1, Gin 2, and Gin 3. FIG. 17b shows in the upper left hand corner, beneath the date/time display, that 1 cleaner (lint cleaner) is in operation for each of Gin 1, Gin 2, and Gin 3. FIG. 17b shows 1 Cleaner Recommended, i.e., the optimum gin machine sequence requires the use of one lint cleaner. Working On Station 1 indicates that color, trash content, and moisture content readings are being taken at Station 1.
The table in the upper right hand portion of FIG. 17b provides the current values of Color, %Area, and Moisture at Stations 1, 2, and 3. Rather than displaying the measured Rd and +b values, these values are transformed and displayed as color code and quadrant . The %Area and Leaf table that appears in the lower left hand corner of the FIG. 17b display provides a simplified transformation between the %Area trash measurement values and a manual leaf grade classification standard. This is provided as a quick reference guide so that the ginner can quickly correlate the %Area readings being displayed to a standard leaf grade classification.
The table in the lower right hand corner of FIG. 17b provides a history of the last 8 bales for the ginner . The show BA procedure discussed above is written to display the last 10 bales . This procedure could be readily modified by one of skill in the art to display a history of the last "N" bales as selected by the ginner. In a typical gin, a bale is processed through a sequence such as the one shown in FIG. 2 approximately every two minutes. Thus, the lower right hand table in FIG. 17b provides the ginner with data from approximately the previous 16 minutes of operation. The first column identifies the bale number. The second and third columns display the average values of color and leaf grade for each bale at Station 2 (Before LC - Lint Cleaner) and Station 3 (After LC - Lint Cleaner) , respectively. The average moisture value for each bale at Stations 1, 2, and 3 is also displayed.
The screen display shown in FIG. 17b could be readily modified by one of skill in the art to display additional information for a ginner. Such additional information could include, for example, bale weight, gin rate, and bale moisture content . b. Dynamic Programming Model 1020
In the embodiment shown in FIG. 10, dynamic programming model 1020 is a program separate from process control decision and measurement program 1010. In one such embodiment, dynamic programming model 1020 is implemented using the FORTRAN programming language and is run off-line to generate the gin decision matrix prior to running process control decision and measurement program 1010. In a preferred embodiment, dynamic programming model 1020 is written in the C programming language and is incorporated into process control decision and measurement program 1010 so that dynamic programming model 1020 is running in real-time rather than off-line.
Dynamic programming model 1020 includes a gin model 1022 that uses price structure 1024 of the cotton as an input . Dynamic programming model 1020 uses price structure 1024, cotton quality parameters 1026, and the performance characteristics for each gin machine to determine the optimum machinery sequence to maximize returns to the producers. Dynamic programming model 1020 uses input information relative to the moisture content, color (reflectance = Rd and yellowness = +b) , trash content, maximum possible turnout, price structure of the cotton market, and energy cost to determine the optimum drying and cleaning sequence.
When lint is sold, the price is determined by its final length, leaf grade, and color grade. Color grade is a step function of values such as 21, 31, 41, 51, etc. The present invention tracks two components of color, Rd and +b, which are continuous functions. A conversion or lookup table is used to convert between Rd, +b and color grades. Such a conversion table is contained in file UPLND.COL in the attached microfiche appendi .
Monetary returns are a function of the quality of lint cotton after ginning, and are determined by color grade, leaf grade, staple length and micronaire . The staple length and micronaire fiber qualities are established before the cotton is removed from the plant . The micronaire is influenced only minimally by gin machinery, but the length is affected by the degree of drying and cleaning. The color of the cotton is strongly influenced by the weathering effects in the field. Gin machines, especially lint cleaners , tend to comb and blend the cotton and have been shown to improve the color grade .
Cleaning machinery improves the color grade and leaf grade of lint cotton by removing foreign matter and by blending the cotton. As the machines clean and blend, they change the fiber length. They also remove some lint that could be included as marketable lint, thereby reducing the lint turnout. Lint turnout, normally expressed in percent, is the ratio of the weight of lint to the weight of the seed cotton before removal of the cottonseed moisture, and foreign matter. Lint turnout is a function of the genetic characteristics of the cotton and of the amount of foreign material in the cotton. Thus, the return to a producer for a given quantity of seedcotton with a specific staple length and micronaire is a function of the lint turnout, color grade, and leaf grade .
Dynamic programming is used to model the ginning process to determine which combination of ginning operations maximize the return from the cotton. Dynamic programming can be applied to many problems that can be structured as a multistage system, and ginning can be considered a multistage system in which each operation represents a stage. A schematic of the ginning process is shown in FIG. 1. The gin stand 150 and bale press 170 stages are always required, and the other processes are optional.
In dynamic programming, the state of the cotton as it moves through the gin must be described. This description is accomplished with six state variables: foreign matter (leaf); Rd and +b, together representing color; moisture content (percent) ; staple length (inches) ; and turnout (percent) . These variables are designated herein as LF, RD, PB, M, LN, and T, respectively. The decision at each operation depends on the state of the cotton entering that operation. Once the solution to the total problem has been obtained, the decisions can be related to the state of cotton when it enters the gin. Thus, the optimum decision at each operation can be determined from the initial state of the cotton. The objective of dynamic programming model 1020 is to maximize the net return; i.e., the revenue from the lint cotton minus the costs of the ginning operations. The variable "Fi ( RDj, PBi, LFi LNi i Ti ) " is used to represent the net return from 100 pounds of seed cotton, assuming that cotton enters the gin just before operation i, that it is in state "RDi, PBi; LF± LNi M±ι TA " and that optimal decisions are made at operation i and at all operations that follow it in the gin. Any revenues or costs that do not vary with the decisions (e.g., revenue from seed cotton and cost of operating the gin stand) are not included, since they will not affect the optimum decisions.
The operations of the gin alter the state of the cotton. The state at the output of any operation i, is a function of the input state and the decision (D) at that operation: i.e.,
RD! = t, (RD, , PB, , LF, ,LN, , M, , T, . D.) • PB! = t, (RD, , PB, , LF, , LN, , M„ T, , D.) , LF! = (RD, , PB, , LFi, LN, , M, , T, , D.). LN,' =/, (RD, , PBi , LF, , LN, , M, , T, . D.) , Mi = t, (RD, , PB, , LF, , LN, , M, , T, , D.) ,
and T.' = t, (RD, , PB, , LF, , LN, ,M,,T,, D.) ,
where RD, ,PB1,LF!,LN! '.hi!, and T, represent the output state variables. The transition functions for each operation may be represented by performance tables or equations, as discussed in more detail below. The output state of one operation is the input state of the following operation.
Dynamic programming is based on the "principle of optimality, as discussed in Bellman, R. Dynamic Programming, Princeton University Press, Princeton, New Jersey (1957). The reference states that "[a]n optimal policy has the property that whatever the initial state and initial decision are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision." This "principle of optimality" leads to the following recursive equations:
F,(S,) = Max[ F,(S,,D,)] D,
and
F,(S ,)= Max [ R, ( S, , D,)+ F,., (Sf) J D,
for i = 2, N
subject to S, = t,(S,,D,), where F = Function,
S = State variables,
R = Returns,
D = Decision, and t = Transition function. (R,(S,,Dι) is the return for stage i. For the ginning problem, these returns represent the negative of the operating cost for each operation. State variable Si is a six-dimensional vector, nRD,,PB,,LF,,U4,,M,,T, ■"
In the gin, the last operation is the press (See FIG. 1) . Thus, that operation is the first one to be considered in the dynamic programming formulation. There is no decision, and FP(RDP,PBP.LFP.LHP,MP,TP) is obtained as follows:
Fp(RDp.PBp.LFp. ip.Mp.Tp) = (Tp/ I00)x( PRICEfRDp.PBp.LFp. ip.Mp ))x!00.
where PRICE ( R∑)p , PBp LF , LNp ) = price per pound of lint of grade
Figure imgf000069_0001
CP = Final color; based on PBP and RDP, MP = Moisture content of the cotton at the press j
PBP = Plus b at the press,
LFP = Leaf at the press, TP = Turnout at the press,
LN/> = Length, and
RDP = Reflectance at the press Moving backward through the system shown in FIG. 1, the next operation is the lint cleaners. The decision at this operation is to use zero, one, or two lint cleaners. The number is determined from
Fp (RDL,PBL,LFL,LNL,ML L), for DL = 0 or
FL(RDL,PBL,LFL,LNL,ML,TL) - -EL (RDL,PBLlLFL,LNL,ML) x DL x COSTE ÷ FP (RD ,PB[,LF ,LN[,M ,TL') for DL = 1 or 2 with the following transition functions:
Figure imgf000070_0001
and
Figure imgf000070_0002
where F = Function,
RD = Reflectance,
PB = Plus B,
LF = Leaf,
LN = Length,
M = Moisture,
T = Turnout ,
E = Energy,
D = Decision, t = Transition function,
L = Lint cleaner, and
COSTE = Cost per unit of electricity.
EL (RDL , PBL > LFL , L , ML ) , the amount of electricity required to operate one lint cleaner, varies with the color, trash, length and moisture content of the cotton at the input of the lint cleaners. The electrical energy consumption (W-h/kg) for the various types of gin machinery as a function of color grade, leaf grade, and moisture content is shown in Table 1. COSTE is the cost per unit of the electricity. At the gin stand, no decision is to be made since the gin stand must be included. However, the gin stand changes the state of the cotton so it must be included in the analysis. Thus,
FG(RDG,PBG,LFG,LNG>MG>TG) = FL(RDG,PBG,LFG/,LNC,,MC,TG),
RDG = to (RDG . PBc . LFG , LNG . MG , To )
PBG = to (RDG , PBc , LFG . LNG » MG , To ) where LFG' = to (RDG , PBG . LFG , LNG , MG , To )
LNG' = to (RDG , PBG » LFG . LNG , MG , TG )
Figure imgf000071_0001
and
TG = tc(RDc , PBG > LFG , LNc , MG , TG ) In a manner similar to that used at the lint cleaners, the problem solving continues for one operation at a time. Gin model 1022 is used to solve the problem. In the program, the state variables for each operation are permitted to vary over the ranges and increments shown below:
Figure imgf000071_0002
As the problem is solved, the optimal decision for each possible input state is stored as a six-dimensional array or matrix in an ASCII file (gin decision matrix) . Thus, once the solution for the whole problem is completed, the program can start at the first operation (first drier shown in FIG. 1) with a particular input state, and then use the transition functions to move sequentially through the operations and identify the optimal decision for each one. Hence, the optimal ginning sequence can be determined from the state of cotton when it enters the gin.
Table 2 illustrates the possible decisions, transition functions, and optimal return functions for each ginning operation. In one embodiment of the present invention, the transition functions of Table 2 are implemented using a series of tabular values, such as those contained in Tables 3 through 15. Tables 3-15 were developed using three state variables, composite grade (G) , moisture (M) , and turnout (T) . Historically, the U.S. Department of Agriculture (USDA) graded or classified cotton based on human assessment of the color and trash content (leaf grade) of the cotton, as well as on the fiber length and micronaire. Prior to 1993, color grade and leaf grade were combined into a composite grade, and the market price of cotton was based on this composite grade. The tabular transition functions of Tables 3 through 15 provide performance tables for the various types of gin machinery based on the state variables of composite grade, moisture content, and turnout. For example, Table 3 quantifies the effect of one lint cleaner by providing the final composite grade as a function of the initial composite grade and moisture content. Similarly, Table 9 quantifies the effect of one lint cleaner by providing the turnout as a function of the initial composite grade and moisture content.
Tables 3-15 can be used to generate a gin decision matrix containing machine decisions as a function of moisture and initial composite grade. A typical decision matrix for a market price based on Strict Low Middling at $0.70 per pound and a maximum color grade of Middling is shown in Table 16. The machinery specified by the sequence codes in Table 16 is identified in Table 17. The gin decision matrix is written by dynamic programming model 1020 into an ASCII file that is read by process control decision and measurement program 1010. The machinery sequence file, such as that shown in Table 17, can be part of process control decision and measurement program 1010.
Table 18 shows a comparison of typical returns for the USDA recommended sequence and the model sequence generated by dynamic programming model 1020 and Tables 3-15. The dollar values are based upon an input of 1001b of seed cotton. Typically in the United States, 1500 lb of spindle harvested seed cotton is needed to produce a 500 lb bale of lint. Thus, the increased dollar value with use of the present invention can be on the order of $7- $23 per bale.
In a particularly preferred embodiment of dynamic programming model 1020, the six state variables of leaf, Rd, +b, moisture content, staple length, and turnout are used, and the transition functions of Table 2 are implemented through algorithms contained in subroutines of dynamic programming model 1020. A particularly preferred embodiment of dynamic programming model 1020 is contained in the attached microfiche appendix. This source code uses a set of state variables as follows :
Figure imgf000073_0001
These state variables appear throughout the source code with various suffixes that represent the processing stage at that point in the program. A suffix of "T" indicates the "INT" or initial condition of the variable; a suffix of "L" indicates the actual condition of the variable after processing through the respective machine; and a suffix of "M" indicates the maximum condition of the variable after processing through the respective machine. Before processing by a machine, each variable has an initial value . The variables are then processed through a machine using the transition functions to produce the "L" suffix variables. If the "L" suffix variable is better with the machine than without the machine, this variable then becomes an "M" suffix variable. The initial value for the next machine is set to be the value that came out of the previous machine . Subroutines OPT and OPTM carry out the transition and optimal return functions identified in Table 2 by cycling through the subroutines for the various machines. Subroutine OPT does a complete enumeration of all possible solutions. Subroutine OPTM retains the optimum or maximum values found from subroutine OPT.
In one embodiment, dynamic programming model 1020 operates in an "interactive" mode by evaluating the transition functions for only one specific value of each state variable, as input, for example, by the user. The computations are made based on one value for each state variable, and the optimum gin decision for that value of the state variables is generated. In this manner, the optimum gin decisions are being generated one at a time, in real-time. This embodiment of dynamic programming model 1020 is contained in file COTTON. C in the attached microfiche appendix. Alternatively, this embodiment of dynamic programming model 1020 can be implemented in the FORTRAN programming language.
In an alternate embodiment, dynamic programming model 1020 operates in a "batch" mode by generating decisions using the entire value range for each state variable. This embodiment of the program evaluates all possible combinations of state variables within the value and increment ranges given above, and generates all possible decisions which are stored in a gin decision matrix. The primary difference between this embodiment of dynamic programming model 1020 and that contained in file COTTON. C is in the MAIN routine which iterates to cover the entire range of values for the state variables . The MAIN routine for the batch embodiment is contained in file COTTONL.C in the attached microfiche appendix.
The data used by COTTON. C and COTTONL.C is contained in the attached files DRIER.DAT, GREENE. CCC, and UPLND.COL. The optimum decisions for the range of input cotton properties are output to two files: LCDEC95A.OUT; and SCCD95A.OUT. The data file LCDEC95A.OUT has the optimum decisions for the lint cleaner portion of the gin (between Stations 2 and 3) and data file SCCD95A.OUT has the optimum decisions for the seed cotton cleaning portions of the gin (between Stations 1 and 2) .
Gin control, including data collection and display, is implemented through the set of "C" language instructions contained in the seven ".C" files and 13 external included " .H" files discussed above in Section 3. a, using the decisions in LCDEC95A.OUT and SCCD95A.OUT. Data on the current operation of the gin is written to the files: BDATF.DAT; BA.DAT; and 0THER.DAT. These files are also read by the control program upon initialization to determine initial settings.
Each machine in FIG. 2 has a corresponding subroutine in dynamic programming model 1020. If the particular machine is not used in a sequence, then the set of state variables is unaffected by that machine. If the particular machine is used in a sequence, then the subroutine contains an algorithm that indicates how the set of state variables is affected by that machine. A particular machine may not affect each of the state variables so that only the affected variables are adjusted in the machine subroutine. For example, the various cleaners do not affect the moisture content of the cotton. Consequently, the moisture after each of the cleaners (SML) will be the same as the moisture going into that particular cleaner (SM) . As another example, driers have a great impact on the moisture content of the cotton, but do not affect the color. Consequently, the Rd and +b after a particular drier (SRDL and SPBL) will be the same as the Rd and +b going into that particular drier (SRD and SPB) . Although length and turnout are not measured parameters, the change to the reference or default value of these state variables is computed since they are affected by the gin machinery.
The particular algorithms used to quantify the effect on the cotton properties identified by the set of state variables are not absolute, and can be varied by one of skill in the relevant arts to account for differences in machinery configuration, machinery wear and tear, and the cotton varieties typically processed. The following algorithms are exemplary, and it is to be understood that the present invention is not limited to use of the algorithms that follow.
In one embodiment, the cotton properties identified by the set of state variables are affected by a cylinder cleaner (subroutine CC) as follows:
SLFL = -0.1305 - 0.0619 * SM + 1.0599 * SLF
SML = SM
SRDL = 3.4151 - 0.0008 * SM + 0.9606 * SRD
STOL = -0.6071 - 0.0057 * SM + 1.0127 * STO
SLNL = 0.2557 - 0.0012 * SM + 0.7764 * SLN
SPBL = 2.8104 - 0.0137 * SM + 0.6457 * SPB In one embodiment, the cotton properties identified by the set of state variables are affected by a gin stand (subroutine GINSTD) as follows:
SLFL = SLF
SML = SM
SRDL = 19.52 - 0.12 * SM + 0.75 * SRD
STOL = 9.22 + 0.14 * SM + 0.72 * STO
SLNL = 0.31 + 0.002 * SM + 0.72 * SLN
SPBL = 1.50 + 0.02 * SM + 0.81 * SPB
In one embodiment, the cotton properties identified by the set of state variables are affected by an impact cleaner (subroutine IC) as follows:
SLFL = -0.1305 - 0.0619 * SM + 1.0599 * SLF
SML = SM
SRDL = 3.4151 - 0.0008 * SM + 0.9606 * SRD
STOL = -0.6071 - 0.0057 * SM + 1.0127 * STO
SLNL = 0.2557 - 0.0012 * SM + 0.7764 * SLN
SPBL = 2.8104 - 0.0137 * SM + 0.6457 * SPB
In one embodiment, the cotton properties identified by the set of state variables are affected by one lint cleaner (subroutine LC) as follows:
SLFL = -0.6665 + 0.0937 * SM + 0.8296 * SLF
SML = SM
SRDL = 25.9279 - 0.0834 * SM + 0.6757 * SRD
STOL = -8.0604 - 0.1694 * SM + 1.2043 * STO
SLNL = 0.1742 + 0.0003 * SM + 0.8288 * SLN
SPBL = 3.3751 - 0.0222 * SM + 0.5970 * SPB
In one embodiment, the cotton properties identified by the set of state variables are affected by two lint cleaners (subroutine LC) as follows:
SLFL = -1.0150 + 0.1483 * SM + 0.7278 * SLF SML = SM
SRDL = 38.1983 - 0.2905 * SM + 0.5302 * SRD
STOL = -12.6405 - 0.1969 * SM + 1.3191 * STO
SLNL = -0.0520 + 0.0003 * SM + 1.0266 * SLN
SPBL = 2.3649 - 0.0183 * SM + 0.7439 * SPB
In one embodiment, the cotton properties identified by the set of state variables are affected by a stick machine (subroutine STMCH) as follows:
SLFL = 0.1625 - 0.0710 * SM + 1.0326 * SLF
SML = SM
SRDL = 2.3777 - 0.0299 * SM + 0.9736 * SRD
STOL = 1.8168 - 0.0011 * SM + 0.9419 * STO
SLNL = 0.1996 - 0.0003 * SM + 0.8226 * SLN
SPBL = 1.8629 - 0.0025 * SM + 0.7587 * SPB
In one embodiment, the cotton properties identified by the set of state variables are affected by a drier (subroutine DRIER) as follows :
SLFL = SLF
SRDL = SRD
STOL = STO* (1.0- (SM-SMD/100.0)
SLNL = SLN
SPBL = SPB
SML = 4.2767 + 0.6397*SM - 0.1713*TEMP where TEMP represents the temperature of the drier.
A table of values can also be used to determine the affect on moisture of the drier (see Table 19) . Table 19 includes the moisture content after drying at temperatures of 65.5, 93.2, 120.9, and 131°C as a function of initial moisture content before drying. This data is accessed by dynamic programming model 1020 through the DRIER.DAT file in the microfiche appendix. If the moisture of the cotton that is input to the drier (SM) is in the range of 4-14%, then subroutine TABLI2 determines the moisture content of the cotton after drying (SML) . If the moisture is out of range, then the closest in-range value (either 4% or 14%) is used as a default. To control the moisture content, the present invention can be configured to vary the temperature of the driers, for example in increments of 50 F. The present invention can also be configured to bypass all of a drier, or to use a portion of a drier, for example Λ (6 shelves) or . (12 shelves) .
Dynamic programming model 1020 uses a standard subroutine,
GINCOM, for variable dimensions and declarations to ensure that all information is in the same format. A subroutine CHGSYS is provided so that a user can input the status of the gin machines .
For example, if a particular machine is not available in the gin, the user can input this information so that this machine is not included in the optimization sequence. In this manner, the present invention can be customized for use in various gins with varying configurations of ginning machines.
The monetary return or value of the cotton is calculated by the function CLINT. One example of price structure 1024 is included in the GREENE. CCC file in the attached microfiche appendix. The GREENE. CCC file contains premiums and discounts that are used to adjust a base price of cotton. The premiums and discounts in the GREENE.CCC file are for a given color grade, leaf grade, and staple length as set by the Commodity Credit
Corporation (CCC) . The base price of the cotton is coded into dynamic programming model 1020 as the cost per pound, and the values in the GREENE. CCC file are divided by 100 and added to the base price. Negative entries in the GREENE. CCC file represent discounts that reduce the base price. Price structure 1024 may be from any source, as long as it is in a format compatible with dynamic programming model 1020. FIG. 18 shows an output of optimum ginning decisions from dynamic programming model 1020. "Input States" refers to the state of each of the state variables at the input to the machine listed in that row of the table. The OUTPUT line identifies the value of the main variables after processing in accordance with the decisions for each machine as identified in the "DEC" decision column (a "0" indicates the machine is not used; a "1" indicates the machine is used; for the driers, "0"=no drier; "1"=150°F;
»2"=200°F; "3"=250°F; and n4"=300°F).
Table 18a shows a comparison of typical returns for the USDA recommended sequence and the model sequence generated by dynamic programming model 1020 using the algorithms described herein. The dollar values are based upon an initial input of 100 lb of cotton, having a price of $0.7960 per pound. The increase in dollar value using the system and method of the present invention can be on the order of $13-$34 per bale.
As discussed in Anthony, W.S. and S.T. Rayburn, Cleanabili ty of Smooth- and Hairy-Leaf Cottons - - Quality Effects, Transactions of the ASAE, Vol. 32, No. 4, pp. 1127-1130 (1989), the leaf hairiness of cotton affects its cleanability. The cleaning efficiency of cleaning machinery is lower for hairy-leaf varieties of cotton than for smooth-leaf varieties of cotton. This characteristic impacts two of the state variables that are used by dynamic programming model 1020, i.e., trash and turnout. The other four state variables are unaffected by this characteristic, and are the same for smooth and hairy leaf varieties of cotton. Because of this cleanability characteristic, the transition functions or performance algorithms for smooth- and hairy-leaf varieties have statistically different coefficients for trash and turnout . Using algorithms that take into account this cleanability characteristic reduces the need for error feedback. The predicted values of the state variables more closely approximate the actual values of the state variables when separate algorithms having different coefficients are used for smooth- and hairy-leaf varieties of cotton.
In a further embodiment of the present invention, two sets of algorithms are used, one for smooth-leaf varieties of cotton, and one for hairy-leaf varieties of cotton. In such an embodiment, the variety of cotton (part of the module tag data) is input to computer system 240 either directly, or via network 418 from the gin computer (see Section 3. a.v. above) . Process control decision and measurement program 1010 uses a lookup table to identify by variety of cotton, a reference staple length and whether that variety is smooth-leaf or hairy-leaf . The values in such a lookup table would be readily apparent to one of skill in the relevant art. Dynamic programming model 1020 then uses the reference staple length and the appropriate smooth-leaf or hairy- leaf algorithms to generate the optimum gin decisions. A default of hairy-leaf, and a staple length of 1.12 inches, are preferably used if no variety is input.
In a preferred embodiment, the smooth-leaf algorithms are obtained by modifying the algorithms, i.e., the coefficients of the state variables, given above as follows. Any equation not changed remains as given above .
Cylinder Cleaner
SLFL = 0.0538 - 0.0913*SM + 1.0617*SLF
STOL = -0.6839 + 0.0098*SM + 1.0119*STO
Impact Cleaner
SLFL = 0.3634 + 0.0128*SM + 0.8572*SLF
STOL = 0.8109 - 0.0606*SM + 0.9784*STO
One Lint Cleaner
SLFL = -0.1213 + 0.0395*SM + 0.7488*SLF
STOL = -15.5084 - 0.1566*SM + 1.4290*STO Two Lint Cleaners
SLFL = -0.6638 + 0.1320*SM + 0.6425*SLF
STOL = -20.4123 - 0.1928*SM + 1.5585*STO
Stick Machine
SLFL = 0.3564 - 0.0643*SM + 0.9573*SLF
STOL = -0.4192 + 0.0490*SM + 0.9997*STO
In a preferred embodiment, the hairy-leaf algorithms are obtained by modifying the algorithms, i.e., the coefficients of the state variables, given above as follows. Any equation not changed remains as given above .
Cylinder Cleaner
SLFL = -0.4301 - 0.0259*SM + 1.0709*SLF
STOL = 0.0035 - 0.0257*SM + 0.9993*STO
Impact Cleaner
SLFL = -0.0675 + 0.0249*SM + 0.9544*SLF
STOL = 0.7170 - 0.0441*SM + 0.9778*STO
One Lint Cleaner
SLFL = -1.0871 + 0.2083*SM + 0.8256*SLF
STOL = -18.4213 - 0.2101*SM + 1.4888*STO
Two Lint Cleaners
SLFL = -1.2258 + 0.2098*SM + 0.7387*SLF
STOL = -36.5362 - 0.2445*SM + 1.9773*STO
Stick Machine
SLFL = 0.0965 - 0.0476*SM + 1.0501*SLF
STOL = 3.8250 - 0.0628*SM + 0.8955*STO
In yet a further embodiment of the present invention, the error feedback data (Error12, Error23 and associated predicted values) are used to modify the coefficients of the state variables in the algorithms. This reduces the amount of error, and Error12 and Error23 would eventually approach zero with predicted values equal to actual values . One way to modify the coefficients in the algorithms using the error feedback data is through the use of a neural net . By neural net is meant a computer program that recognizes patterns and is designed to take a pattern of data and generalize from it . A neural net typically takes pairs of input and output data and matches them, thereby "training" the neural net. Once a neural net has been trained, new data can be input and the net will output a learned response. Neural nets can readily be integrated by one of skill in the art into an existing computer program. A neural net could thus be used to match or correlate algorithm coefficients with error feedback data so that the error was minimized. Once the neural net was trained with matched algorithm coefficients and error feedback data, the algorithms could be determined as a function of the error feedback data generated during operation of the present invention, c. Process Control Implementation Program 1030 In a preferred embodiment, process control implementation program 1030 is implemented using the C programming language as part of process control decision and measurement program 1010. The embodiment of process control decision and measurement program 1010 attached hereto in the microfiche appendix includes the code for carrying out process control implementation program 1030. Alternatively, implementation program 1030 may be a separate program that is called by process control decision and measurement program 1010. Program 1030 performs the function of implementing the selected optimum gin process control decision, as indicated by 1032 (see FIG. 10) . To implement the optimum gin process control decision, program 1030 controls valves, such as the automated directional valves of the present invention, to route the cotton through the selected machinery sequence, as shown at 1036. Program 1030 uses valve position sensor data 1034 to verify proper valve position. If a change of valve settings is to be made, program 1030 uses valve position sensor data 1034 to determine what change needs to be made. The appropriate valve control signals 1036 are sent to cause power units, such as air cylinders, rotary actuators, hydraulic motors, electric motors, etc. to be activated to change the position of the valves.
In the preferred embodiment, PLC 2050 (see FIG. 20) is used to send valve control signals 1036 to change the position of the valves. Program 1030 causes signals to be sent from computer system 240 through digital interface 2040 to PLC 2050 to control the valves that put the selected machinery sequence on-line. Lines D17 and D18 output from digital interface 2040 are used by computer system 240 to request that selected lint cleaners be put on-line. Lines D30 and D31 output from digital interface 2040 are used by computer system 240 to request that selected seed cotton cleaners (e.g., impact cleaners and stick machines) be put online. Output line D19 is used by computer system 240 as a handshake line with PLC 2050 to ensure that the request is valid.
With reference to the C language program contained in the attached microfiche appendix, the PLC_scc and PLC_lc procedures are used to control the signals sent to PLC 2050 that control the request for seed cotton cleaning equipment and lint cleaning equipment, respectively. Depending on the function passed to each procedure, it can either: (1) set the handshake signal (D19) to untrue, meaning the value on the request lines (D17, D18, D30, and D31) is invalid and no change should be made; or (2) set the handshake signal to true, and set the request lines for 0, 1, 2, or 3 cleaners, meaning that the value is valid and the bits represent proper data for the number of cleaners (seed cotton or lint) to be used.
PLC 2050 is programmed to carry out the instructions generated by process control implementation program 1030. PLC 2050 is programmed to continuously check the settings of the cleaner request lines (D17, D18, D30, and D31) while computer valid line (D20) remains true, and after handshake line D19 returns to true . If the settings of the cleaner request lines have changed, and the switch on ginner' s control panel 2060 has been selected for automated control, then PLC 2050 initiates the change in valve settings required to carry out the request for the selected machinery. Once a change in valve settings is initiated by PLC 2050, further changes are not accepted by PLC 2050 until the current change is complete .
In some gins, the ginner may turn power off to certain machinery that is usually in the bypass configuration, such as seed cotton cleaners in excess of the number typically used. In that situation, PLC 2050 may be programmed to check if power is applied to a particular piece of machinery before signaling the valve for that piece of machinery to change from the bypass position to the diversion or on-line position.
Valves are used to control the flow of cotton through the gin. The valves are positioned to route the cotton through a selected machine (the diversion position with the machine on-line in the cotton flow) , or to route the cotton so that it bypasses a particular machine (the bypass position) . Particularly preferred valves are the automated valves of the present invention, described above with respect to FIGS. 5-9. Proximity switches or sensors are installed on the valves that control the flow of cotton. Suitable proximity switches include those that are installed on the outside of an air piston cylinder to sense the position of the piston in the air cylinder that is used to control the position of the valve (see, for example, air cylinders 621, 623, and 629 in FIG. 6) . Other suitable proximity switches include commercially available reed relay and magnet switches.
With such a proximity switch, the magnet is preferably mounted on the shaft of the valve . The reed relay and magnet switches are more sensitive to valve position, more flexible in mounting position, and more sensitive for detecting a larger range of error conditions. A particular valve may be equipped with more than one proximity switch or sensor so that the system could detect whether the valve is positioned in the fully opened or fully closed position. Internal sensors on the cylinders and actuators could alternatively be used.
To change the position or setting of a particular valve, PLC 2050 sends a signal to the air cylinder controlling that valve to either extend or retract, thereby changing the position of the valve in the desired manner. The interface between the air cylinder and PLC 2050 can be done in a conventional manner, and is omitted for brevity. To ensure that the valve is in the desired position, PLC 2050 reads valve position sensor data 1034 to determine the actual valve position. While the position of a valve is being changed, valve position sensor data 1034 indicates that the valve is neither open nor closed. If the valve becomes jammed, or cotton prevents the valve from moving fully into the requested (open or closed) position, PLC 2050 senses an error condition. The error condition signals for operator assistance.
Computer system 240, through the use of PLC 2050, controls the opening and closing of the automated valves of the present invention. PLC 2050 is programmed to sequence the valves to transition from the bypass mode of operation to the diversion mode of operation, and to sequence the valves to transition from the diversion mode of operation to the bypass mode of operation. With the automated valves of the present invention (see FIGS. 5-9) , the valves are transitioned without stopping the flow of cotton through the gin. Computer system 240 directs PLC 2050 to change the positions of the automated valves of the present invention while cotton is flowing through the system. To accomplish this, control hardware is provided at ginner * s control panel 2060 that preferably includes a thumbwheel switch that can be set to indicate the number of lint cleaners being used. For example, a thumbwheel switch setting of "0" would indicate that no lint cleaners were being used, a setting of "1" would indicate one lint cleaner, etc. The control hardware also preferably includes a push button switch to lock in the lint cleaner selection made through use of the thumbwheel switch. In a preferred embodiment, a series of indicators is included in the control hardware . Each of the lint cleaners has an indicator that indicates whether that lint cleaner has been selected for operation. A "not ready" indicator is also preferably provided that comes on when a new lint cleaning configuration is chosen and stays on until all the valves have been set and the system is ready to resume ginning.
In addition to the automated computer control of the valves through PLC 2050, a set of switches can directly communicate with PLC 2050 to allow the gin operator to select any or all of the valve settings, overriding whatever optimum selection has been indicated.
FIG. 19a shows a ladder diagram for programming a PLC to sequence the valves to transition between the diversion and bypass modes of operation. On the ladder diagram shown in FIG. 19a (and 19b discussed below) , each line where a function or action is performed starts with a set of double lines that represents a relay or switch contact. If the contact is closed, the function on that line is executed. A relay is indicated in FIGS. 19a and 19b through the use of ( res ) or ( set ) .
The main program is contained in lines 01 through 04 of FIG. 19a. Line 01 starts by determining whether the control computer is okay. Subroutine 01 is called to determine if the control switch settings have changed. Line 02 starts by determining whether there is a new control switch setting. This contact is labeled "0101" which corresponds to the "new setting" relay in line 06. Line 02 turns on the "not ready" light and calls subroutine 02 to decide the outputs for the new valve settings.
Line 03 includes a timing relay, represented by two lines enclosing a "T" and spaces for the number of the relay. Above the relay is a number for the delay time in seconds, typically 5-15 seconds. The timing relay in line 03 is used to allow a delay between the changing of each valve. This prevents the valves from physically interfering with each other, and also prevents small voltage surges and errors. After the valves are set, subroutine 03 is called to check if the valves are set properly.
Line 04 is executed last. The indicators for the lint cleaners being used are set, and the "not ready" light is turned off.
Subroutine 01 is contained in line 06. Line 06 includes a relay contact for the new control switch setting. Line 06 also includes two logic symbols, represented by "< >". The first is a "< cmp >" that compares the new switch setting to the old switch setting. The second is a "< sta >" that stores the new switch setting if it is different.
Subroutine 02 is contained in line 09. Line 09 sets new outputs for the valves. This is done by providing a control signal to the air solenoids that change the position of the valves . The correct sequencing of the automated valves to transition between the diversion and bypass modes of operation are carried out in subroutine 02.
Subroutine 03 is contained in line 12. The "check valve settings" contact in line 12 represents several contacts that correspond to the proximity switches used to verify that each valve is in the proper position.
The process control system of the present invention can also be used in a gin that is not equipped with the automated valves of the present invention. Such an embodiment is referred to herein as the semi-automated valve embodiment. In the semi- automated valve embodiment, the existing valves in the gin are equipped with actuators or air cylinders, as well as proximity switches or sensors . The actuators and proximity switches are connected to PLC 2050, in a manner similar to that described above for the automated valves of the present invention. The primary difference between this embodiment and the automated valve embodiment described above, is that the flow of cotton through the system has to be stopped in order for PLC 2050 to control the changing of valve position. In the semi-automated valve embodiment, the PLC is programmed to perform the following functions: sequentially stop gin stand 150; allow the cotton to clear the valves; redirect the valves; verify valve position; and signal the ginner to re-engage gin stand 150. FIG. 19b shows a ladder diagram for programming a PLC to carry out these functions .
The main program is contained in lines 01 through 04 of FIG. 19b. Line 01 starts by determining whether the push button switch has been pressed and released. If it has been, the contact is closed, and subroutine 01 is called to determine if the thumbwheel switch settings have changed. Line 02 starts by determining whether there is a new thumbwheel switch setting. This contact is labeled "0101" which corresponds to the "new setting" relay in line 06. Line 02 also includes a timing relay to delay to allow the cotton to clear the lint cleaners before the position of the valves is changed. Line 02 also includes a relay to stop the gin stand. Finally, line 02 calls subroutine 02 to decide the outputs for the new valve settings .
Line 03 includes a timing relay to allow a delay between the changing of each valve. This prevents the valves from physically interfering with each other, and also prevents small voltage surges and errors. After the valves are set, subroutine 03 is called to check if the valves are set properly.
Line 04 is executed last . The indicators for the lint cleaners being used are set, the "not ready" light is turned off, and the gin stand is re-engaged.
Subroutine 01 is contained in line 06. Line 06 includes a relay contact for the thumbwheel switch. This relay contact actually represents one contact for each of the switches in the thumbwheel. For example, if a thumbwheel is used that has four switches, the relay contact in line 06 represents four contacts, one for each of the four thumbwheel switches. Line 06 also includes two logic symbols, represented by "< >". The first is a "< cmp >" that compares the new switch setting to the old switch setting. The second is a "< sta >" that stores the new switch setting if it is different.
Subroutine 02 is contained in line 09. Line 09 sets new outputs for the valves . This is done by providing a control signal to the air solenoids that change the position of the valves .
Subroutine 03 is contained in line 12. The "check valve settings" contact in line 12 also represents several contacts, in a manner similar to the thumbwheel switch relay contact in line 06. The "check valve settings" contact represents several contacts that correspond to the proximity switches used to verify that each valve is in the proper position.
The source code provided herewith in the microfiche appendix is one embodiment for implementing the present invention. A computer programmer skilled in the relevant art could readily interpret and implement the present invention based on the disclosed source code. Examples and Results
The ability of the system and method of the present invention to increase returns to the cotton producer is demonstrated by the following examples. A sample run was made using the dynamic programming model of the present invention. Inputs to the model for the sample run were :
Figure imgf000091_0001
All calculations were based on an input mass of 45.4 kg (100 lb) of seed cotton.
The computer model generates a complete set of decision codes for each machine (gin decision matrix) for reflectance (50 to 80) , plus b (5.5 to 13.5), leaf (2 to 10), moisture content (3.5 to 9.5%), and lint turnout (30 to 40%). Output of the model also includes the final values for the state variables as well as the monetary returns at the completion of ginning. For the sample run with the inputs given above, the optimum machine sequence was two lint cleaners . Comparison of the model value to the values from the USDA-recommended machinery sequence is shown below.
Output Process Value from Control USDA-recommended value sequence
72.1
8.1
2.0
5.0
34.36
Figure imgf000092_0001
27.35
The decisions generated by the dynamic programming model 1020 of the present invention would yield monetary returns of $28.58 for an input of 45.4 kg (100 lb) of seed cotton, whereas the USDA- recommended ginning sequence would yield $27.35. The $1.32 additional return per 100 pounds of seed cotton would equate to $17.22 for the seed cotton (635.6 kg or 1400 lb) that would be necessary to produce a 500 pound bale of lint cotton. An additional example is shown in Table 18a, discussed above.
The process control system of the present invention results in improved fiber quality, as well as improved profitability. Control of fiber moisture and elimination of one or more stages of lint cleaning improves fiber quality by: (1) increasing length; (2) reducing short fibers; (3) increasing seed-coat fragment size and improving removability at the textile mill; (4) decreasing the number of seed-coat fragments; (5) increasing measured strength; and (6) increasing fiber yield. These improvements are documented and quantified in Anthony, W. Stanley, Process Control for Optimum Lint Quali ty and Value, 1992 Beltwide Cotton Conferences, pg. 7-12 (1992) .
Processing in a Textile Mill
The system and method of the present invention can also be used to process lint in a textile mill. Lint, the final product of processing in a gin, is further processed in a textile mill.
Mill processing can include, for example, cleaning of the lint, as well as blending, carding, combing, drawing, spinning, weaving, dyeing, and finishing.
One embodiment of a cleaning line in a textile mill is illustrated in FIG. 21. The cleaning line of FIG. 21 represents a typical opening and cleaning sequence in a textile mill. It is to be understood that some textile mills use a different sequence, and some mills have more cleaning machines than shown in FIG. 21. In a typical machine sequence at a textile mill such as that shown in FIG. 21, a bale opener 2102 extracts cotton from bales of lint cotton, such as that produced at a typical cotton gin, and feeds it into an airstream. A condenser 2104 separates the cotton from the air steam, and feeds the cotton into a pre-mixer 2106.
Pre-mixer 2106 mixes the cotton from several different bales at one time and feeds it into a double-roll cleaner 2108. Double- roll cleaner 2108 removes foreign matter, and feeds the cotton into a blender 2110. Blender 2110 ensures that the cotton is uniformly mixed and blended together. A condenser 2112 separates the cotton from the airstream, and feeds the cotton into a cleaner 2114 which removes foreign matter, and transfers the cotton to a dust cage 2116. Dust cage 2116 removes dust and feeds the cotton to a cleaner 2118. Cleaner 2118 removes foreign matter. A condenser 2120 then removes cotton from the airstream, and transfers it to a card feeder 2122. Card feeder 2122 feeds cotton into a card machine 2124. Card machine 2124 cleans cotton, and forms a web for further processing. The process sequence described above differs with manufacturers and textile mills as various combinations and models of the cleaning, separating and blending machines are used.
The present invention can be used in a textile mill to select an optimum mill machine sequence that maximizes lint quality. Automated directional valves as disclosed herein can be used to route lint through the selected sequence of cleaners. In a textile mill configured with the present invention, double-roll cleaner 2108, cleaner 2114, dust cage 2116, and cleaner 2118 can be bypassed. Bypassing of the foregoing machines is not possible in a conventional textile mill (without the process control system of the present invention) . Based upon the disclosure herein, one of skill in the relevant arts could readily implement the appropriate algorithms for use in a textile mill .
Figure imgf000095_0001
% Also includes the energy required to convey the lint cotton between machines.
Table 1, Continued. Natural gas energy required by either drier 1 or drier 2.
Energy (Btu/kg of cotton) required for drier temperature (°C) of
Initial lint moisture content, percent
14.0
12.0
10.0
9.0
8.0
7.0
6.0
5.0
4.0
Figure imgf000096_0001
Table 2. Possible decisions, transition functions, and optimal return functions for each ginning operation.
Operation Decision Transilion Junction" Qpjimal return function
Press None None Fp{RDp.PBp.LFp.LNp,Mp.Tp) -- (TpnθO)X PRICE {RDp.PBp,LFp,LNp,Mp.Tp)X \00
Lmt cleaner 0 - none forOt * 0' RDl'RDi.PBL-PBl.LFL^LFL for DL >0 Fl(RDL,PBi,LFL,LNl.Ml,TL) 'Maximum of Fp[RDL,PBi.LFl,LNL, LrVl' =./.Λ/l.Ml'«Ml,τ{ « TT M..TL)
1-one Maximum of FP(RDL,PBL
2 -two FL.LNL,ML L) X DL X COST E ♦
Figure imgf000097_0001
NO
Gm stand 1-onβ P.D' ta(RD0.PBβ,LF0,LN0.M..T0) Fa(RDa<PB0.LFa.LNa.Ma,Ta) - L(RD0'.PB0',L α'. N Mα 0')
PBβ. - l0iRD0,PB0.LF0,LN0,Ma,Ta) LFβ. - l0(r70β,Pβ 0,tF0.l.Nβ.Mβ,rβ) tw;. - fβ(RDβ.Pflβ.LF„.LrV0, 0.Tβ) M0' -- M0 a' - t0'lRD0,PBa.LFt,LN0,M0.T0)
Impact cleaner 0-do not use for D, = 0. RD, • RD,,PB, • PB,,LF, = LF(, forO, = 0:F,(RD(,Pβ,,..F,,-.Λι,,M,.r,) = Maximum of Fα(RD„PBl,LF,.LNl,M,.Tl) LN,' LN,, M,' = M,, r,' » r,
1-use forO, « 1: RO, « f((RO,,PB(._.F,,_.rV„M(, T,) for O, * 1 F,(RD,lPa(.LFr.LΛ/,,M|ir,) = Maximum of FDI(RD,,PB,.LF„ LN,. M,.T,)
l'-fl(ΛO,1/.LF|.LW,.Wl.T-,) or -El{RDl,PBl,LFl,LNl,Ml,T,) X COST E ♦ F„ (RD/.Pfl/.LF/./ V/.W,. T,')
LF/=f,(RO,1PB,.lF,.I.Λ/„M/.r)) t Λ/ « f,(RD,, Pβ(. LF,.LN,.MI. T,)
M,' • M,.r,' - f,'(RO,.P0/.tF,,t.fV,.M(.r/)
Table 2. Possible decisions, transition functions, and optimal return functions for each ginning operation - contlnuad.
Operation Decision Transition function* Optimal return function
Oner 2 0 - do not use for Dn, • 0: RDD. = RD Onf,.PB -DI PB, ,of Do, " ° Fo,(RD 0rPBo.-LF.yl-ND,.M01.TD,) - Maximum 0/ ((ROD,.PBc
I ,., LN 01 LN
LF," 01' LFo,'L»orMo To,)
M. = r
1 • use at 6S*C lo Fo,WD,-™DrLFDJ,LND D1.TD,) »
2 - use at 93'C Maximum of F01{RDM,PBDi,LFot,LN01.MD„TDi) or
3 use at 121'C -£l{RDD,.Pβ0,.LF0}.LrVe,,M(„) X Cosf E - Gas (M0),DDI) • use al 131'C X Cost (RD,PB,LF,LN.M,T) F, iRDo PB0VLFot,LNDt,Mt
Figure imgf000098_0001
Slick machine 0 - do not use for D. 0: RD. RDs,PBt « PBj (or Ds « 0: Ft (RD^Pβj.LFj.Lr j.M,,!,) =
LF. LFS,LN, = LNS, Maximum of FOI(ROJ,PBJ,/-FJ,LΛJ.MJ,rj)
1 - use torD, * 1:RD,.
PBS',
LF_.
Figure imgf000098_0002
LNa',
M. M.
T; - t, (RDs.PBs.LFt.LNt.Ms.Ts)
Cylinder cleaner do not use for Dc « 0: RDe = R
Figure imgf000098_0003
Table 2. Possible decisions, transition functions, and optimal return functions for each ginning operation - continued.
Operation Decision Transition function* Optimal return (unction
1 - use for Dc * 1'RDj * fc(RDc,PBc.-Fc.LfVc.Mc,rc). lor Dc = 1: FC{RDC.PBCXFC,LNC.MC,TC) Maximum of FSIRDC,PBC.LFC PBC' - IC{RDC.PBC.LFCILNC,MC.TC), LNC,MC,TC) or -Et {RDC,PBC.LFC.LNC.MC, Te) X
LF fc(RDe.Pflc. Fc.L/Vc,Mc,rc). COST E * Ft
Figure imgf000099_0001
LNC - tc(RDc,PBc,LFc,LNc.Me.Te),
M' M„ T - f'(RD,.Pβc.LFc.
Drier 1 0 - do nol use for DD, = 0. RD0'1 RD0I for 0, = 0: F0, [RDol.PBot,LF0,.LN0,.Mot.TOi) = Maximum of FC(RD0,,PBD, PBD, PBD, LF0„LND„M0„Tot)
NO
LF, LFD,.
LN, LNn.
^01 ° **OI' ^0
1 -use for D0I «1.2.3, or A- for DD, «1,2,3,or4 FD,{RD01.PBD LFD,,LN0,,MD,.T0,) ■= Maximum of
RD0, - lD,{RDDl.PBD„LFDI,LNDi,MDt.TDI) FciRDol.PBD„LFD,%LN0„MD„T0i) ot PBD, = to,iRDD„PβDl.LFD„LN0„M0,,TDI) -ELIRDD,,PBD,,LFDI.LN0I.M0,) X COST E - GAS (MDI< LPόi " to,lRDo,> p D,-<-Fo,-l-No,'M0„TD,) D0I) X COST G ♦ FC[RDD,,PBD„LF0,,LN01,M0„TD1) LN0, - t0,(RD0,,PBD,.LF0,.LND,.MD„T0l) ' 'o,(Wo.. DO,)- rό, ' TD, - MD, MD,
' Tabular values for the transition function are given in Tables 3-15.
Table 3. Final grade, as a function of initial grade and moisture, when only one lint cleaner was used.
Final grade for moisture content (percent) of
Initi al 3.5 4.5 5.5 6.5 7.5 8.5 9.5 grade
Figure imgf000100_0001
Table 4. Final grade, as a function of initial grade and moisture content, when two lint cleaners were used.
Final grade for moisture content (percent) of
Initial grade 3.5 4.5 5.5 6.5 7.5 8.5 9.5
72 93.2 92.2 91.2 90.2 89.2 88.2 87.2
74 94.1 93.0 92.0 91.0 90.0 89.0 88.0
76 94.9 93.9 92.9 91.9 90.9 89.8 88.8
78 95.7 94.7 93.7 92.7 91.7 90.7 89.7
80 96.6 95.6 94.6 93.5 92.5 91.5 90.5
82 97.4 86.4 95.4 94.4 93.4 92.4 91.4
84 98.3 97.2 96.2 95.2 94.2 93.2 92.2
86 99.1 98.1 97.1 96.1 95.1 94.1 93.1
88 99.9 98.9 98.8 97.8 96.7 95.7 94.7
90 100.8 99.8 98.8 97.8 96.7 95.7 94.7
92 101.6 100.6 99.6 98.6 97.6 96.6 95.6
94 102.5 101.4 100.4 99.4 98.4 97.4 96.4
96 103.3 102.3 101.3 100.3 99.3 98.3 97.3
Table 5. Final grade, as a function of initial grade and moisture content, when only one gin stand was used.
Figure imgf000102_0001
Table 6. Final grade, as a function of initial grade and moisture content, when only one impact cleaner was used.
Figure imgf000103_0001
Table 7. Final grade, as a function of initial grade and moisture content, when only one stick machine was used.
Figure imgf000104_0001
Table 8. Final grade, as a function of initial grade and moisture content, when only one cylinder cleaner were used.
Figure imgf000105_0001
Table 9. Turnout change, as a function of initial grade and moisture content, when one lint cleaner was used.
Figure imgf000106_0001
Table 10. Turnout change, as a function of initial grade and moisture content, when two lint cleaners were used.
Figure imgf000107_0001
Table 11. Turnout change, as a function of initial grade and moisture content, when only a gin stand was used.
Figure imgf000108_0001
Table 12. Turnout change, as a function of initial grade and moisture content, when one impact cleaner was used.
Figure imgf000109_0001
Table 13. Turnout change, as a function of initial grade and moisture content, when one stick machine was used.
Figure imgf000110_0001
Table 14. Turnout change, as a function of initial grade and moisture content, when one cylinder cleaner plus gin stand were used.
Figure imgf000111_0001
Table 15, Turnout change after either drier 1 or drier 2.
Turnout change (percent) after drier at
Figure imgf000112_0001
Table 16. Overall machine decisions for color of Middling with a price based on Strict Low Middling at $0.707pound
Figure imgf000113_0001
*Each alphabetic character represents a different sequence of gin machinery (See Table 17 for description).
Ill - Table 17. Machine and drier decision codes for dynamic gin model
Figure imgf000114_0001
Table 18. Comparison of typical returns for the USDA recommended sequence and the model sequence
Figure imgf000115_0001
* Based on 45.4 kg (100 lb) of seed cotton. Does not include energy costs. Multiply by
14 to determine per bale value, t Cylinder cleaner, impact cleaner, and two lint cleaners were used. i One drier at 66°C and one impact cleaner were used. § Two lint cleaners were used
I One drier at 66°C and two lint cleaners were used. ** Stick machine was used. tt No conditioning equipment other than gin stand and feeder was used. it One drier at 66°C was used.
Table 18a. Comparison of typical monetary returns for the USDA- recommended sequence and the process control sequence.
____———_—__—--_---———-__---———— — '
Initial values USDA sequence Process control sequence
Rd +b Leaf Rd +b Leaf XM1 TO2 LN3 Rd +b Leaf %M> TO2 LN3 i<
5.0 34.36 1.09 26.17 69.6 8.1 2.4 6.0 35.2 1.10 28.05
5.0 34.36 1.09 27.35 70.5 8.0 3.0 6.0 35.9 1.10 28.58
5.0 34.66 1.09 27.35 71.8 7.5 3.7 6.0 37.3 1.10 29.70
5.0 34.36 1.09 27.35 74.3 8.0 4.0 6.0 37.4 1.10 29.79
5.0 34.36 1.09 27.35 69.6 8.1 4.0 6.0 35.2 1.10 28.05
5.0 34.36 1.09 26.06 71.5 7.7 4.2 6.0 35.5 1.09 28.29
5.0 34.36 1.09 27.35 74.3 7.7 4.2 6.0 35.5 1.09 28.29
Figure imgf000116_0001
5.0 34.36 1.09 27.35 75.6 8.1 4.9 6.0 36.0 1.10 28.34
Figure imgf000116_0002
1 Assumes limited drying. Initial moisture was 6%.
2 TO = turnout, %
3 LN = length, %
4 Based on a base price of $0.7960 per pound (1995 Commodity Credit Corporation prices).
5 Based on 100 pounds of initial cotton, at least 1400 pounds are required to produce a 500-pound bale of lint.
6 Used two cylinder cleaners and two lint cleaners.
7 Used one cylinder cleaner and one lint cleaner.
8 Used one cylinder cleaner.
9 Used no cleaning.
10 Used two lint cleaners.
11 Used one lint cleaner.
Table 19. Final moisture content after driers.
Initial moisture Drier temperature (°C) of content, percent 65.5 93.2 120.9 131
14.0 11.0 10.3 9.5 8.5
8.0 7.0 6.5
7.0 6.0 5.0
7.0 5.0 4.5
5.5 4.0 4.0
4.5 4.0 3.5
4.5 4.0 3.5
4.0 3.5 3.0
Figure imgf000117_0001
3.7 3.5 3.0
Conclusion
While various embodiments of the present invention have been described above, it should be understood that they have been presented by way of example only, and not limitation. For example, the present invention can be implemented in hardware only, or through the use of other programming languages. The present invention may also be adapted to process other types of materials, other than cotton. Multiple-leaf valves, high-speed sequential leaf valves, or other suitable types of diversion means may also be used. Thus, the breadth and scope of the present invention should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.
"COMPUTER CONTROL LOGIC"
The following is a computer program listing showing a computer program which can be used to practice the present invention.
/* */ /* COTTON.c */ /* */ /* input file names were hardcoded */ /* (and assumed to be in current directory) they arβi */ /* Drier data : drier.dat */ /* Price data . greenccc.dat */ /* Grading data: uplndcol.dat */ /* */ /* */ /* */ /* */ /* GINCOM */ /* */
#include <atdio.h> #include <string.h> #inσlude <stdlib.h>
/*For abor () function in for failure to open fxle*/
#define TRUE 1 #define FALSE 0 int DR1 CCl SMCH IC1 DR2 CC2 IC2, LC; int IDR1M, ICC1M, ISMCHM, IIClM , IDR2M, ICC2M, IIC2M, ILCM; float DD[5], TM[37], TMX[5], TMY[10]r GASUSD[5]j
Figure imgf000120_0001
float PRC[31][31]; int ICLR[31][31] j int ICOLOR[46][142]; int IPRICE[851[9H10]> float FX, FM, BPRICE, PRICE, PRICEM; int ICR, ICLRM, IPDR, IPGS;
/* */ /* Forward Declarations of functions */ /* (Given in order of appearance in the listing below) */ /* */ void READfilo (char FILENM[ 50 ] , float Xλ[ 10 ) , float YA[ 10 ] ,
Figure imgf000121_0001
vo »id main (void)
Figure imgf000121_0002
/* Reading drier data */
READfile(drier_file,TMX,TMY,TM,4,9);
/* */
/* Initialize Array */ for( IC=0 ; IC<=84 ; IC++) for(LG-0 ;LG<«8; G++) for(LN-0 ;LN<«9 ;LN++) /* if use -29999 then need to use different type of integer */
IPRICE[IC][LG][LN]=-29999;
/* Reading pricing data */ if( (price_data = fopen(price_file, "r" ) ) == NULL )
{ printf("*** The current directory does not contain the price datafilet %s\n", price_file); abor ( ) ;
} while(fscanf(price data, "%2d%ls%ld", &IC, &junk, S.LG) 1= EOF) for( N«0;LN<9;LN++) fscanf(price_data, H%d", &IPRICE[IC-11] [LG-2] [LN] ) ;
/* Reading grading data */ if ( (grade_data - fopen(grade_file, "r" )) ∞ NULL )
{ printf("*** The current directory does not contain the grading datafilci %s\nM, grade_file); abort( ) ;
} do
{ check - fscanf (grade data, "%2d%3d" , £IRD,&IPLUSB) ; fscanf (grade data, "%2d%l3H ,&ICOLOR[IRD-40] [IPLUSB-40] , S,junk) ;
} while(check 1- EOF);
/* Close input files */ if( fclose( price_data ) ) printf( "The price datafile was not closed. %s\n" ,price_file ); if( fclose ( grade_data ) ) printf( "The grading datafile was not closed: %s\n", grade_file ) ;
SLFLO = 2. Of; SLFMAX-lO.Of ;
SMLOW » O.Of; SMMAX =20.Of;
SRDLOW=50.0f; SRDMAX=80.0f ;
STOLOW=35.0 ; STOMAX»40.0f ;
SLNLOW- l.Of; SLNMAX= l.lβf;
SPBLO - 5.5f; SPBMAX-13.5f;
BPRICE = 79.6f;
SLFINT - β.Of;
SMINT = β.Of;
SRDINT ■» 56.Of;
Figure imgf000123_0001
/* Check to see if user wants to exit */ printf("\n\n Do you want to quit? (Y/N) => " ) ; scanf("%s" ,&quit); printf("\n\n") ; if(strcmp(quit,,'Y")"==0 || strcmp(quit, "y")==0) run FALSE;
}
}
/* SUBROUTINE READ(FILENM,XA, YA,ARRAY,NDIMX,NDIMY) */
void READfile(char FILENM[50], float XA[10], float YA[10], float ARRAY[37], int NDIMX, int NDIMY)
{
FILE *input_file; float DUM[21][8],TAB[21][8]; int RT, IND; int i,j,k; if ((input_file « fopen(FILENM, "r" )) == NULL ) printf(-*** The current directory does not contain the datafile: %s\n" ,FILENM) ; abor ( ) ;
f βcanf (input_file, H%d" ,fiKT) ; or ( i»l I i<«*NDIMX ; i++ ) fscanf (input_file, "%f", 8XA[i]; for(i=l; i<=NDIMY; i++)
fscanf (input_file,"%d %fH,&KT, &YA[i]); for ( j=l ; j<=NDIMX; j++ ) fscanf (input_file,"%f",&DUM[i][ j]);
for( i=»1 ; i<«=NDIMY; i++) for( j=l; j<=NDIMX; j++)
{
IND=i+HDIMY* ( j-1 ) ;
ARRAY[ IND]=DUM[i] [ j ] ; } printf (" REPRODUCTION OF DRIER DATA \n ",KT); for(i-l;i<-NDIMX;i++) printf("%10.2f ",XA[i]); printf ("\n");
] [ j ] ) ;
Figure imgf000124_0001
if ( f close ( input file ) ) printf ( "The file %s was not
Figure imgf000124_0002
j
/* SUBROUTINE CHGSYS */
void CHGSYS (void ) int CV[ 9 ] , IX=0 ;
J
Figure imgf000124_0003
CV[6]«= CC2; CV[7]= IC2; CVf8)= LC; while(IX != 9)
{ printf("\n\n");
PRTSYS(); /* Write out the current module status to screen */ printf(" To change the status of an operation, enter the number\n") ; printf(" in parenthesis to the left of the operation -> "); scanf ("%d",&IX); while(IX < 1 I I IX > 9)
{ printf(" Must enter a 1, 2, 3, 4, 5, 6, 7, 8, or 9. Try again -> " ) ; scanf(H%d",&IX); } if(IX >« 1 && IX <= 8) if(CV[IXJ)
CV[IX]=FALSE; else
CV[IX]=TRUE;
DR1 = CV[1];
CCl = CV[2];
SMCH= CV[3];
IC1 = CV[4];
DR2 = CV[5);
CC2 - CV(β];
IC2 * CV[7];
LC = CV[8];
/ * Bssssnzsas:
/* SUBROUTINE PRTSYS */
/* nnaansni void PRTSYS (void) { if(DRl) printf(" (1) Drier 1 In \n" ) ; else printf(" (1) Drier 1 Out\n" ) ; if(CCl) printf(" (2) Cylinder Cleaner in \n- ) ; else print (" (2) Cylinder Cleaner Out\n" ) ; i (SMCH)printf(" (3) Stick Machine In \n" ) ; olβe printf(" (3) Stick Machine Out\n" ) ; if(ICl) printf(" (4) Impact Cleaner 1 In \n" ) ;
Figure imgf000126_0001
void INTS (void)
{ int IX—9; float input_value, var_limit[14] j var_limit[0] =0.0f; var_limit[l] - 9«9.9...-O.f-.,; /* Price input limits **// var_limit[2) -SLFLO ; var_limitf3] =SLFMAX; /* Leaf input limits */ var_limit[4] =SMLOW; var_limit[5] -SMMAX; /* Moisture input limits */ var_limit[6] =SRDLOW; var_limit[7] -SRDMAX; /* Reflectance input limits */ var_limit[8] =STOLOW; var_limit[9] =STOMAX; /* Turn out
"iinnppuutt lliimmiittss * w/t var_limit [10]"SLNLOW; var_limit[ll]=SLNMAX; /* Length input limits */ var_limit[ 12]=SPBLO ; var. _nli-m.i*+tπ[ 13-Ji]->,S _p.B.MAX; /* Plus B "input limits */ while(IX ! 8)
{ printf(M\n\n\nlnitial Values t\ snn") ); printf(" (1) Base price $%5.2f\n",BPRICE); printf (" (2) " Leaf' %5.2f Range ( %5.2f - %5.2f )\n", SLFINT,var_limit[ 2 ) , var_limit[ 3 J ) ; printf (" (3) Moisture = %%55..22ff RRaannggee (( %ϊ5b..2ϋfr - %5.2f )\n",
SMINT,, v„a_r___limit[4] , var_limit[5]); printf(" (4) Reflectance - %%55..22ff RRaannggee (( %%55..22ff - %5.2f )\n",
SRDINT,var :__lliimmiitt[[ 66 ]] ,, 'var_limlt[ .7.].) ; printf (" (5) Turn out %5.2f RRaa ιnnngggeee (( %%55..22ff -- %%55..22ff ))\\nn"",, STOINT,var :__lliimιιit [ 8 ] , var_limit [ 9 ] ) ; printf (" (6) Length %5.2f Ra ιnnggβe („ %.5.2f - %5.2f ) \n" , SLNINT,var :_ lliimmiitt[|10 J ,var_limit [ ll ] ) l printf(" (7) Plus B - %5.2f Range ( %5.2f - %5.2f )\n",
SPBINT,var limit[12] ,var_limit[ 13] ) ; printf(" (8) Make no further changes.Yn" ) ; printf("\nTo change a value, enter the number in parenthesis\n" ) ; printf( "associated with the value to be changed -> "); scanf C%d",&IX); printf( "\n") ;
while (IX < 1 j I IX > 8)
{ printf ( " You must enter 1, 2, 3, 4, 5, 6, 7 or 8 => "); scanf("%dH,&IX);
}
/* Use of "switch" statement to replace nested IF's in FORTRAN */ if(IX 1= 8)
{ switch(IX)
{ case 1: printf( "Enter a new value for Base price -> "); break; case 2: printf( "Enter a new value for Leaf -> "); break; case 3: printf("Enter a new value for Moisture -> "); break; case 4: printf("Enter a new value for Reflectance -> n);break; case 5: printf("Enter a new value for Turn Out -> "); break; case 6τ print ( "Enter a new value for Length -> "); break; case 7: printf("Enter a new value for Plus B -> " ) ; } scanf("%f" ,&inputwvalue);
/* Check input value to ensure it is within specified range */ if(input_value < var_limitr2*IX-2] ) printf("\n*** Value entered (%5.2f) is lower than the permited value (%5.2f) ***" "\n*** NO CHANGE WAS MADE. ***" ,input_value, var_limit[ 2*IX-2 ] ) ; else if (input_value > var_limit[2*ix-l] ) printf("\n*** Value entered (%5.2f) is higher than the permited value (%5.2f) ***'*
"\n*** NO CHANGE WAS MADE. *** ",input_value, var_limit[2*IX-l]); else switch(IX) case l . ii break;
C SΘ 2!»l break; case 3I:« break; caβo i break; case 51
Figure imgf000127_0001
break;
case 6: SLNINT=input_value; break; case 7: SPBINT-input_value; }
Figure imgf000128_0001
void OPT(void)
{
/* Counters and Upper bounds on the number of devices */ int IDR1, IDR1U = int ICC1, ICC1U - int ISMCH, ISMCHU- int IIC1, IIC1U - int IDR2, IDR2U - int ICC2, ICC2U = int IIC2, IIC2U - ; int ILC, ILCU - 2;
SLFL- SLFINTj SML » SM1NT SRDL- SRDINT; STOL- STOINT; SLNL= SLNINT; SPBL- SPBINT; if(lDRl ) IDR1U -0; if(iCCl ) ICC1U =0; if(ISMCH) ISMCHU-0; if(IICl ) IIC1U -0; if ( 1DR2 IDR2U ssO; if(tCC2 ICC2U -0; if(IIC2 IIC2U -0; if(ILC ILCU =0 ;
IPDR-0 ; IPGS-0;
/* DRIER 1 */ RECORD( 1 ) J for(IDRl«-0)IDRK- >IDR1U;IDR1++)
{
UPDATE( 1 ) ; DRIER(IDRl); /* CYLINDER CLEANER 1 */ RECORD(2 ) ; for(ICCl=0;ICCK=ICClU;ICCl++)
{
UPDATE(2 ) ; CC(ICCl);
/* STICK MACHINE */ RECORD(3); for( ISMCH=0;ISMCH<==ISMCHU;ISMCH++)
{
UPDATE(3); STMCH(ISMCH);
/* IMPACT CLEANER 1 */ RECORD(4); for(IICl=0;IICl<=IIClU;IICl++)
{
UPDATE( ) ; IC(IICl);
/* DRIER 2 */ RECORD(5) ; for( IDR2-0;IDR2<=IDR2U; IDR2++)
{
UPDATE(5) ; DRIER(IDR2);
/* CYLINDER CLEANER 2 */ RECORD( 6 ) ; for(ICC2-0; ICC2<-ICC2U;ICC2++)
{
UPDATE( 6 ) ;
CC(ΪCC2);
/* IMPACT CLEANER 2 */ RECORD(7); for(IIC2-0; IIC2<-IIC2U; IIC2++) {
UPDATE(7);
IC(IIC2);
/* GINSTAND */ RECORD(8); GINSTD(IDR1,IDR2);
/* LINT CLEANER */ RECORD( 9 ) ; for(ILC=0 ; ILC<-ILCU; ILC++)
UPDATE(9 )
lint_cleaner(ILC) ; RECORD(10);
FX-CLIN (SLFL,SM ,SRDL,STOL,SLN ,SPB ) ; FX=FX- (IPDR+IPGS) *9000; /* This is a penalty that applies in some cases */ if(FX > FM fi.fi, FX > 0)
OPTM( IDRl , ICCl , ISMCH,IICl , IDR2 ,ICC2 , IIC2 , ILC) ; /* FM is the maximum value of the objective function to date for the run */ > } } }
/* SUBROUTINE RECORD(K) _ *
/* «»«e=-B-B=«=srs==--;:_:s:======,=-s=sB====β>-«-»««"""™"""™«=M»=l='»=--—B====ss=-———== * / void RECORD(int k)
{
SLFT[k]- SLFL;
SMT[k] = SML;
SRDT[k]= SRDL;
STOTlk]- STOL;
SLNT{k]- SLNL;
SPBT[k]= SPBL; >
/ ★ »-.==============================-.-.——=«-===-«================== * /
/* SUBROUTINE UPDATE(K) */
/* ===5====β==βB«ββS.»=-B=«---=---«i-β»-»-=««====!================-!*===="=-β= * / void UPDATE(int k)
SLF - SLFT[k]» SM = SMT[k]; SRD - SRDT[kj; STO - STOT{k); SLN β SLNT[k]; SPB - SPBT[k];
/* =»«»---.-.-.-«-----■.._„=--»================»==-=—————====== * /
/* SUBROUTINE DRIE (IDR) */
/* Data for driers are for SM ranging between 4.0 and 14.0.
The subroutine does not call TABLI2 when SM is outside this range. Since the program evaluates IDR=0 first and the value of FX should be the same when TABLI2 is not called, the decision should be IDR«=0. */ void DRIER(int IDR)
{ if(IDR -» 0)
{
SLFL=SLF;
SML =SM;
SRDL=SRD;
STOL=STO;
SLNL=SLN;
SPBL=SPB;
} else if(IDR >= 1 £,& IDR <= 4)
{
SLFL=SLF; if(SM >= 4.0 && SM <= 14.0)
{
SML =TABLI2("M,TMX,TMY,DD[IDR],SM,4,9);
IPDR=0 ;
} else
IPDR-1 ;
SRDL=SRD;
STOL-STO* (1. Of-(SM-SML) /100. Of) ;
SLNL«=SLN;
SPBL=SPB• if(SML0ϊ > SML) SML = SMLOW; /* SML= AMAXl (SML,SMLO ) */ if(SMMAX < SML) SML - SMMAX; /* SML= AMINl (SM ,SMMAX) */ if(STOLOW > STOL) STOL = STOLO ; /* ST0L~AMAXl (STOL,STOLOW) */ } }
/* SUBROUTINE CC(ICC) * l
void CC(lnt ICC)
/* WITHOUT CYLINDER CLEANER * /
if (ICC 0) {
SLFL-SLF;
SML »SM;
SRDL=SRD;
STOL-STO;
SLNL«SLN;
SPBL=SPB;
/* WITH CYLINDER CLEANER */ else if(ICC »' 1)
{
SLFL ' -0.1305f - 0.0619f * SM + 1.0599f * SLF;
SML ■■ SM;
SRDL ■ 3.4151f - O.OOOβf * SM + 0.960δf * SRD;
STOL ■ -0.6071f - 0.0057f * SM + 1.0127f * STO;
SLNL ' 0.2557f - 0.0012f * SM + 0.7764f * SLN;
SPBL ' 2.8104f - 0.0137f * SM + 0.6457f * SPB; if(SLFLOW > SLFL) SLFL«=SLFLOW; /* SLFL«AMAXl(SLFL,SLFLOW) */ if(SMLOW > SML) SML=SMLOW; /* SML -AMAXl (SML ,SMLOW ) */ if (SMMAX < SML) SML=SMMAX} /* SML =AMIN1(SML ,SMMAX ) */ }
}
/* SUBROUTINE STMCH(ISMCH) */
void STMCH(int ISMCH)
(
/* WITHOUT STICK MACHINE */ if (ISMCH «« 0)
{
SLFL»SLF;
SML-SMJ
SRDL=SRD;
STOL=STO;
SLNL-SLN;
SPBL-SPB; }
/* WITH STICK MACHINE */ else if(ISMCH »= 1)
SLFL ■ 0.1625f - 0.0710f * SM + 1.0326f * SLF;
SML «= SM;
SRDL - 2 .3777 f - 0. 0299f * SM + 0 .9736f * SRD ; STOL = 1.8168f - O.OOllf * SM + 0.9419f * STO; SLNL = 0.1996f - 0.0003f * SM + 0.8226f * SLN; SPBL «= 1.8629f - 0.0025f * SM + 0.7587f * SPB; if(SLFLOW > SLFL) SLFL=SLFLOW; /* SLFL~AMAX1 (SLFL,SLFLOW) */ if (SMLOW > SML ) SML=SMLOW; /* SML =AMAXl(SML ,SMLOW ) */ if(SMMAX < SML ) SML=SMMAX; /* SML =AMIN1(SML ,SMMAX ) */ }
/* assess
/* SUBROUTINE IC(IIC) */
/* ====================== void IC(int IIC)
{
/* WITHOUT IMPACT CLEANER */ if (IIC =» 0)
{
SLFL=SLF;
SML "SM;
SRDL=SRD;
STOL-STO;
SLNL=SLN;
SPBL=SPB; }
/* WITH IMPACT CLEANER */ else if(IIC == 1)
{
SLFL - -0.1305f - 0.0619f * SM + 1.0599f * SLF; SML = SM; SRDL = 3.4151f O.OOOβf SM 0.9606f SRD; STOL « -0.6071f 0.0057f SM 1.0127f STO; SLNL «= 0.2557f 0.0012f SM 0.7764f SLN; SPBL - 2.8104f 0.0137f SM 0.6457f SPB; if(SLFLOW > SLFL) SLFL»SLFLOW; /* SLFL=AMAX1(SLFL,SLFLOW) */ if(SMLOW > SML ) SML«SMLOW; /* SML =AMAX1(SML ,SMLOW ) */ if(SMMAX < SML ) SML=SMMAX; /* SML =AMIN1(SML ,SMMAX ) */ }
}
/*
/* SUBROUTINE GINSTD(IDRl , IDR2 ) */ /* void GINSTD(int IDRl, int IDR2)
/* COTTON COMING INTO THE GINSTD CANNOT EXCEED 8.5 */ /* Insuring that driers are fully used if moisture above 8.5 */ if((DRl && SM>8.5 && IDRK4) || (DR2 && SM>8.5 && IDR2<4))
IPGS=1; else
IPGS-0;
SLFL= SLF;
SML = SM;
SRDL=19.52f - 0.12f *SM + 0.75f*SRD;
STOL= 9.22f + 0.14f *SM +.0.72f*STO;
SLNL= 0.31f + 0.002f*SM + 0.72f*SLN;
SPBL= 1.50f + 0.02f *SM + 0.81f*SPB;
if(SLFLOW > SLFL) SLFL=SLFLOW; if(SMLOW > SKL) SML=SMLOW; if (SMMAX < SML) SML=SMMAX; if(SRDLOW > SRDL) SRDL-SRDLOW; if(SRDMAX < SRDL) SRDL=SRDMAX; if(SLNLOW > SLNL) SLNL-SLNLOW; if(SLNMAX < SLNL) SLNL«SLNMAX; if(SPBLOW > SPBL) SPBL-SPBLOW; if(SPBMAX < SPBL) SPBL-SPBMAX;
.= */
/* SUBROUTINE lint cleaner(ILC) */ == */ void lint cleaner(int ILC)
{
/* NO LINT CLEANERS */ if (ILC == 0)
{
SLFL=SLF;
SML »SM)
SRDL-SRD;
STOL»STO;
SLNL-SLN ;
SPBL-SPB; }
/* ONE LINT CLEANER */ also if(ILC -= 1)
{
SLFL- -0.6665f + 0.0937f * SM + 0.8296f * SLF;
SML - SM;
SRDL- 25 . 9279 f - 0 . 0834 f * SM + 0 . 6757f * SRD ;
STOL-. _8.0604f - 0.1694f * SM + 1.2043f * STO;
SLNL= +0.1742f + 0.0003f * SM + 0.8288f * SLN;
SPBL= +3.3751f - 0.0222f * SM + 0.5970f * SPB; }
/*
Figure imgf000135_0001
if(SLFLOW > SLFL) SLFL-SLFLOW; if(SMLOW > SML) SML-SMLOW; if(SMMAX < SML) SML=SMMAX; if(SRDLOW > SRDL) SRDL-SRDLOW; if(SRDMAX < SRDL) SRDL=SRDMAX; if(SLNLOW > SLNL) SLNL-SLNLOW; if(SLNMAX < SLNL) SLNL*=SLNMAX; if(SPBLOW > SPBL) SPBL-SPBLOW; if(SPBMAX < SPBL) SPBL-SPBMAX;
/* FUNCTION CLINT(SLFX,SMX,SRDX,STOX,SLNX,SPBX) */
float CLINT(float SLFX, float SMX, float SRDX, float STOX, float SLNX, float SPBX) int IRD,IPLUSB, LG, LN} float PR;
IRD=(int) (SRDX+0.5); IPLUSB=(int) (SPBX*10.f+0.5); if (IRD > 85 I f IRD < 40) print ("*CLINT* IRD outside of range - IRD - %d\n",IRD); if(IPLUSB > 180 j| IPLUSB < 40) printf("*CLINT* IPLUSB outside range - IPLUSB »
%d\nM, IPLUSB); ICR=ICOLOR[ IRD-40 ] [ IPLUSB-40 ] ;
LG= int) (SLFX+0.5),
LN=(int) (SLNX*32.0f+0.5); if (LG > 10 || LG < 2) printf("*CLINT* LG outside range - LG = %d\n",LG); if(LN > 37 f| LN < 29) printf("*CLINT* LN outside range - LN = %d\n",LN); PR-IPRICE[ICR-ll][LG-2][LN-29] ; PRICE-PR/100. Of+BPRICE;
/* PRICE is set to -99 if it is not in range of data. */ if (PRICE > 0) return(PRICE*STOX/100.0f ); else return(-99.f) ;
*/
/* SUBROUTINE OPTM(IDRl , ICCl ,ISMCH, IICl, IDR2 ,ICC2 ,IIC2 , ILC) */ */ void OPTM(int IDRl, int ICCl, int ISMCH, int IICl, int IDR2, int ICC2, int IIC2, int ILC) int i; FM = FX; ICLRM = ICR; PRICEM- PRICE;
IDR1M = IDRl; ICC1M - ICCl; ISMCHM= ISMCH; IIC1M - IICl; IDR2M = IDR2; ICC2M = ICC2; IIC2M - IIC2; ILCM = ILC; for(i-l;i<-10;i++)
{
SLFM[i] «= SLFT[i]
SMM [i] - SMT [i]
SRDM[i] = SRDTfi]
ST0M[i] ■ ST0T[ij
SLNM[i) - SLNTfi]
SPBM[i] = SPBT[i]
>
*/
SUBROUTINE OTPUT */
LN=(int) (SLNX*32.0f+0.5); if (LG > 10 I I LG < 2) printf("*CLINT* LG outside range - LG = %d\n",LG); if(LN > 37 I I LN < 29) printf("*CLINT* LN outside range - LN = %d\n",LN); PR»IPRICE[ICR-ll][LG-2] [LN-29]; PRICE=PR/100.0f+BPRICE;
/* PRICE is set to -99 if it is not in range of data. */ if (PRICE > 0) return(PRICE*STOX/100.0f); else return(-99. f);
/* SUBROUTINE 0PTM( IDRl, ICCl , ISMCH, IICl, IDR2, ICC2,IIC2 , ILC) */
void OPTM(int IDRl, int ICCl, int ISMCH, int IICl, int IDR2, int ICC2, int IIC2, int ILC) int i; FM = FX; ICLRM - ICR; PRICEM= PRICE;
IDR1M = IDRl; ICC1M » ICCl; ISMCHM= ISMCH; IIC1M - IICl; IDR2M = IDR2; ICC2M = ICC2; IIC2M - IIC2; ILCM = ILC; for(i- l;i<-10;i++) {
SLFM[i] SLFTfi]; SMM [i] SMT [i]; SRDMJi] SRDT{i]; ST0M[i] STOT[ij; SLNM[iJ SLNT[i]; SPBM[i] SPBT[i];
} * SUBROUTINE OTPUT */
void OTPUT(void)
{ int leaf, length; printf ("\n O P T I M U M G I N N I N G D E C I S I O N
S\n\nM); printf (" I N P U T S T A T E S\n"); printf ( " \n" ) ; printf (" OPR DEC SLF SM SRD STO SLN SPB\n"); if (DR1) printf(" %6s %4d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f\n" , "DR 1", IDRlM,SLFM[l],SMM[l],SRDM[l],STOM[l],SLNM[l],SPBM[l]); else printf(" %6s *\n","DR 1"); if (CCl) printfC %6s %4d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f \n" , "CC 1",ICC1M,SLFM[2],SMM[2],SRDM[2],ST0M[2],SLNM[2],SPBM[2]); else print (" %6s *\n", CC 1"); if(SMCH) printf(" *6s %4d %8.2f %8.2f %8.2f %8.2f 8.2f %8.2f\n", "STMCH" ,
ISMCHM,SLFM[3] ,SMM[3] ,SRDM[ 3 ] ,STOM[3 ] ,SLNM[3 ] ,SPBM[ 3 ] ) ; else printf(" %6s *\n" , "STMCH") ; if(ICl) printf{" %6s %4d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f\n", "IC 1",
IIClM,SLFM[4],SMM[4],SRDM[4],STOM[4],SLNM[4],SPBM[4]); else printf (" %6s *\n" ,"IC 1"); i (DR2) printfC *6s %4d %8.2f %β.2f %8.2f %8.2f %8.2f %8.2f \n" , "DR 2",
IDR2M,SLFM[5],SMM[5],SRDM[5],STOM[5),SLNM[5],SPBM[5]); else printfC *6β *\n" ,"DR 2"); i (CC2) printfC %6s %4d %8.2f %8.2f %8.2f %B.2f %8.2f %8.2f \n" , "CC 2",
ICC2M , SLFM [ 6 ] , SM [ 6 ] , SRDM [ 6 ] , STOM [ 6 ] , SLNM [ 6 ] , SPBM [ 6 ] ) f also printfC *6s *\n" , "CC 2" ) ;
if (IC1) printf(" %6s 4d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f\n","IC 2",
IIC2M,SLFM[7],SMM[7],SRDM[7],STOM[7],SLNM[7],SPBM[7]) ; else printf(" %6s *\n","IC 2"); printfC *6s %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f\n" , "GINSTD" , SLFM [ 8 ] , SMM [ 8 ] , SRDM { 8 ] , STOM [ 8 ] , SLNM [ 8 ] , SPBM[ 8 ] ) ; if (LC) printf(" %6s %4d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f\n" , "LC" ,
ILCM, SLFM[9] ,SMM[9],SRDM[9] ,STOM[9] ,SLNM[9] ,SPBM[9] ) ; else printfC %6s *\n" , "LC" ) ; printf(" %6s %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f\n" , "OUTPUT" ,
SLFM[10],SMM[10],SRDM[10],STOM[10],SLNM[10],SPBM[10]); leaf -(int) (SLFM[10]+0.5) ; length-(int) (SLNM[ 10 ] *32.Of+0.5) ; printf("\n Final Color =%3d Final Leaf =%3d Final Length = %3d" "\n Selling price=$%5.2f Final value =$%5.2f\n", ICLRM, leaf, length,PRICEM,FM); if (IDRl || ICCl || ISMCH || IICl || 1DR2 || !CC2 || IIC2 || ILC) printf ("\n* This operation was not included in configuration. \n" ) ;
}
/* SUBROUTINE TABL12 */
float TABLI2(float *ARRAY, float *X, float *Y, float XARG, float YARG, int NDIMX, int NDIMY) { float RATIO, RAYI50]; int i, ii, MD, N; if(XARG > X[NDIMX] || XARG < X[l]) printfC TABLI2 XARG - %10.4e X(l) = %10.4e X(NDIMX) =
%10.4e\n", XARG, X[l], X[NDIMX] ); if(YARG > Y[NDIMY] || YARG < Y[l]) printfC TABLI2 YARG = %10.4e Y(l) = %10.4e Y(NDIMY) =
%10.4θ\n", YARG, [1],Y[ DIMY)) ;
II«=0; MD=NDIMX*NDIMY; if ( FIND (Y, YARG, &N, DIMY) == 0)
for( i=N;i<-MD; i=i+NDIMY)
RAY[++II ]=ARRAY[ i] ; else
{
RATIO=(YARG-Y[N])/<Y[N+l]-Y[N]); for(i-N;i<-MD; i=i+NDIMY)
RAY[++II ]=ARRAY[i]+RATIO*(ARRAY[ i+1 ] -ARRAY[i ] ) ;
} return(TABLI(RAY,X,XARG, DIM ) ) ;
/* FUNCTION TABLI(VAL,ARG,DUMMY,K) */
/* This table lookup function was translated from that by FORDYN */ float TABLI( float *VAL, float *ARG, float DUMMY, int K)
{ int i; if(DUMMY > ARG[KJ)
DUMMY = ARG[K]; if(DUMMY < ARG[1])
DUMMY - ARG[1]; for(i=2;i<=K;i++) if (DUMMY <- ARG[i]) return ( (DUMMY-ARG[ i-1 ] )*(VAL[i]-VAL[ i-1] )/(ARG[i]-ARG[i-1] )+
VAL[i-l]);
}
/* SUBROUTINE FIND(X,ARG,N,KEY,NDIM) _ */
int FIND(float *X, float ARG, int *N, int NDIM)
{ int i, KEY, IX, IARG; if(ARG > (X[NDIM]+0.05) | | ARG < X[l]) printfC FIND ARG = %10.4f X(l) - %10.4f X(NDIM) =
%10.4f",ARG, X[l], X[NDIM])j KEY=1; IARGβ (int) (100.0f*ARG+0..r,f ); for(i=l;i<-NDIM;i++)
{
IX-(int)(100.0f*X[i]+0.5f)>
if(IARG > IX) continue; if(IARG == IX) KEY-0; *N=i-KEY; goto exit;
} exit: return(KEY);
}
/* Clears the results between runs of the system */
void clear_results(void)
{ int i; for(i-0;i<-10;i++)
{ SLFM[i]-SMM[i]=SRDM[i]=STOM[i]=SLNM[i]=SPBM[i]-0;
}
ICLRM=0;
}
COTTONL.C
*/
/* */
/* */
/* */
/* */
/* Program Has Different Main Routine with Looping on Parameters */
/* Functions from COTTON.C that were not needed were deleted. */
/* */
/* The input file names were hardcoded */
/* (and assumed to be in current directory) they are. */
/* Drier data j drier.dat */
/* Price data : greene.ccc */
/* Grading data: uplndcol */
/* */
/* The output file name was hardcoded */
/* (and assumed to be in current directory), it is» */
/* Output data : output.dat */
/* */ = */
/* GINCOM */
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h> /* Required for abort() functions */
#define TRUE 1 #define FALSE 0
FILE *output; /* File for storing output data */ int DR1 CCl SMCH IC1 DR2 CC2 IC2, LC; int IDR1M, ICC1M, ISMCHM, IIC1M , IDR2M, ICC2M, IIC2M, ILCM;
/* COMMON DD(O«4),TM(36),TMX(4),TMY(9),GASUSD(0:4) */
/* If the indice does not start at 0, then need to add */
/* one to the array size to account for C starting at 0 */ /* instead of 1. */ float DD[5], TM[37], TMX[5], TMY[10], GASUSD[5]; float SLF SM SRD STO SLN SPB; float SLFL SML SRDL STOL SLNL SPBL; float SLFINT SMINT SRDINT STOINT SLNINT SPBINT; float SLFT[11] SMT [11] SRDT[11] STOT[ll] SLNT[11] SPBT[11]; float SLFM[11] SMM[11] SRDM[11] STOM[ll] SLNMfll] SPBM[11]; float SLFLOW SMLOW SRDLOW STOLOW SLNLOW SPBLOW; float SLFMAX SMMAX SRDMAX STOMAX SLNMAX SPBMAX ;
/* COMMON PRC(0.30,Oι30),ICLR(0$30,0«30) */ float PRC[31][31]; int ICLR[31][31]; COTTONL.C
/+ COMMON ICOLOR(40:85,40:181),IPRICE( 11 :95, 2:10,29:38) int ICOLOR[46][142J; int IPRICE[85][9][10]; float FX, FM, BPRICE, PRICE, PRICEM; int ICR, ICLRM, IPDR, IPGS;
/* .== */
/* Forward Declarations of functions */ /* (Given in order of appearance in the listing below) */ /* .== */ void READfile(char FILENM[50], float XA[10], float YA[10], float ARRAY[37] int NDIMX, int NDIMY) ; void PRTSYS(void); void CHGSYS(void); void OP (void); void RECORD(int ); void UPDATE(int Jc); void DRIER(int IDR); void CC(int ICC); void STMCH(int ISMCH); void IC(int IIC); void GINSTD(int IDRl, int IDR2); void lint_cleaner(int ILC); float CLINT(float SLFX, float SMX, float SRDX, float STOX, float SLNX, float SPBX); void OPTM(int IDRl, int ICCl, int ISMCH, int IICl, int IDR2, int ICC2, int IIC2, int ILC); void GINOUT(int *NDDR1, int *NDSMCH, int +NDIC1, int *NDDR2 , int
*NDLC, char *drier_file, char *price_file, char *grade_file, int lower_bound, int upper_bound) ; float TABLI2(float *ARRAY, float *X, float *Y, float XARG, float YARG, int NDIMX, int NDIMY); int FIND( float *X, float ARG, int *N, int NDIM) float TABLI(float *VAL, float *ARG, float DUMMY, int K) void σlear_ cesult3 (void) ;
==================as===r«β^-*=-β-s=a .--.... ^
/* MAIN
void main (void)
Figure imgf000143_0001
],NDLC[31]; COTTONL.C int check; int IC, LG, LN; int IRD, IPLUSB; int ISLF, ISM, IPB, ISRD; int ISLFint, ISLFmax, ISMint, ISMmax, IPBint, IPBmax, ISRDint, ISRDmax;
/* Data for driers */ DD[0]= 0; DD[1]-150; DD[2]=200; DD[3]=250; DD[4]-300;
/* Reading drier data */
READfile(drier_file,TMX,TMY,TM,4,9);
/* */
/* Initialize Array */ or( C=0; IC<=8 ; IC++) for(LG=0;LG<=8;LG++) for( N-0; N<-9 ;LN++)
/* if use -99999 then need to use different type of integer */
IPRICE[IC][LG][LN]--29999;
/* Reading pricing data */ if ((price_data - fopen(price_file, "r" )) == NULL ) printf("*** The current directory does not contain the price datafile: %s\n", price_file) ; abort( ) ; *" } while( fscanf(price_data, "%2d%lβ%ld", tic, &junk, SLG) 1= EOF) for( N-0 ; N<9 ;LN++) fscanf (price_data, "%d", &IPRICE[IC-11] [LG-2] [LN] ) ;
/* Reading grading data */ if((grade_data = fopen(grade_flie, "r" )) « NULL ) printfC*** The current directory does not contain the grading datafile: %s\n", graάe_file) ; abort ( ) ;
} do check - fscanf (grade data, "%2d%3d%2d%ls",
&IRD, &IPLUSB, fiICOLOR[IRD-40][IPLUSB-4O],ϊ.junk); while (check I- EOF); COTTONL.C
/* Close input files */ if( fclose( price_data ) ) printf( "The price datafile was not closed: %s\n", price_file ) ; if( fclose( grade_data ) ) printf( "The grading datafile was not closed: %s\n", grade_file ) ;
/* Open file for storing results */ if((output - fopenCoutput.dat", "w" )) === NULL ) printf("*** The file OUTPUT.DAT could not be opened ***\n")
SLFL0W= 2. Of; SLFMAX-lO.Of; SMLOW = O.Of; SMMAX =20.0f; SRDLOW=50.0f; SRDMAX-80.0f; STOLOW=35.0f; STOMAX-40.0f; SLNLOW= l.Of; SLNMAX- 1.16f; SPBL0W= 5.5f; SPBMAX=13.5f;
Figure imgf000145_0001
/* Variable value ranges used */
ISLFint*4; ISLFmax=16 /* Actual Range is 2-8 */
ISMint -6; ISMmax -18 /* Actual Range is 3-9 */
IPBint βiO IPBmax -30 /* Actual Range is 5-15 */
ISRDint-50; ISRDmax-80; /* Actual Range is 50-80 */ printf("Currently evaluating variable values :\n");
CHGSYS ( ) ; for(ISLF-ISLFint; ISLF<=ISLFmax;ISLF++)
SLFINT- ((float) ISLF)/2.f; for(ISM-ISMint> ISM<=ISMmax; ISM++)
{
SMINT=( (float) ISM)/2.f; COTTONL.C for ( IPB=IPBint ; IPB<=IPBmax ; IPB++ )
SPBINT=( (float) IPB)/2.f; for(ISRD-ISRDint;ISRD<=ISRDmax; ISRD++)
{
SRDINT=(float) ISRD; printf(" Leaf =%5.2f Moisture=%5.2f "Plus B -%5.2f Reflect.=%5.2f\r", SLFINT,SMINT,SPBINT,SRDINT) ;
/* Main program loop */ FM = -9; clear_results ( ) ; OPT();
NDDRl[ISRD-50] =IDR1M; NDSMCH[ ISRD-50]-ISMCHM; NDICl[ISRD-50] -IIC1M; NDDR2 [ ISRD-50] =IDR2M; NDLC[ISRD-50] -ILCM;
}
GIN0UT(NDDR1,NDSMCH,NDIC1 ,NDDR2 ,NDLC,drier_file, price_file ,grade_file,ISRDint, ISRDmax) ;
} } } if( fclose( output ) ) printf ( "The output datafile was not closed" ); }# _
/* The procedures which are the same as those in COTTON.C are */ /* omitted. */
^ =»__==_==_.= ««=_-=»===
// //
/* SUBROUTINE GINOUT */ void GINOU (int *NDDR1, int *NDSMCH, int *NDIC1, int *NDDR2, int *NDLC, char *drier file, char *price_file, char *grade_file, int Tower_bound, int upper_bound) int i, last; static key «= TRUE; if (key) fprintf(output, "Drier Data File i %s\n" ,drier_filo) ; fprintf(output, "Pricing Data File: %s\n" ,price_file) ; fprintf(output, "Grading Data File: s\n" ,grade_file) ; print (output,"\n\n");
COTTONL.C for ( IPB-IPBint ; IPB<=IPBmax ; IPB++ )
{
SPBINT= ( ( float) IPB) /2. f ; for(ISRD-ISRDint; ISRD<=ISRDmax; ISRD++)
{
SRDINT=( float) ISRD; printf(" Leaf =%5.2f Moisture=%5.2f "Plus B =%5.2f Reflect.=%5.2f\r", SLFINT,SMINT, SPBIN ,SRDINT) ;
/* Main program loop */ FM = -9; clear_reaults ( ) ; OPT();
NDDRl[ISRD-50] =IDR1M; NDSMCH[ISRD-50]-ISMCHM; NDICl[ISRD-50] -IIC1M; NDDR2 [ ISRD-50 ] «IDR2M; NDLC[ISRD-50] -ILCM;
GINOUT(NDDR1, DSMCH, DIC1,NDDR2,NDLC,drier_file, price_file,grade_file, ISRDint, ISRDmax) ;
} } > if( fclose( output ) ) printf( "The output datafile was not closed" );
/* The procedures which are the same as those in COTTON.C are */ /* omitted. */
^ =__=.=-»=- «=
// //
/* SUBROUTINE GINOUT */ void GINOUT(int *NDDR1, int *NDSMCH, int *NDΪC1, int *NDDR2, int *NDLC, char *drier_file, char *price_file, char *grade_file, int lower_bound, int upper_bound)
; ; ;
Figure imgf000147_0001
COTTONL.C fprintf(output, "Base Prices - %5.2f\n" ,BPRICE) ; fprintf(output, "Turnout = %5.1f Length - %5.2f\n",STOINT,SLNINT); fprintf(output, "\n\n "); fprintf(output," Leaf %%M Reflectance\n" ) ; fprintf(output, " M ) ; for(i-lower_bound;i<=upper_bound; i++) fprintf(output, "%3d",i); key = FALSE;
} else
LFINT,SMINT) ;
Figure imgf000148_0001
// End of COTTON.C
// This collection of procedures relates to color calibration based on
// the five tile procedure, the color measurement and measurement of
// other variables using the A/D converter. All readings of the A/D
// converter are made in this collection of procedures. In addition,
// the color code is obtained from the Rd and +b readings in this
// section.
// ColorF.c
#include "cainc.h" // all includes #include "cadef.h" // all defines #include "caext.h" // #include "caproto.h" // prototypes of all functions
// ColorF.c // // program color.c // calibate color, calculate color from // one of several cameras and save to RAM // // // // color calibration // This section is code takes readings // of five standard color tiles, compares the readings of the A/D // converter to the Rd and +b of each tile and calculates conversion // constants based on the readings. void color cal (int cthead)
{ int σx; // dummy get ch for wait for reading output float ycolor, zcolor; float rd_dif, b_dif; float s_wht__rd, s_wht_b, s_yel_rd, s_yel_b,
Figure imgf000149_0001
053
float fwht_z, fbrn_y, fbrn_z, fyel_y, fyel_z, fgray_y, fgray_z, fσen_y, fcen_z; double ysum, zsum, stdysum, stdzsum, ysumsq, zsumsq, stdysumcq, stdzsumsq; double prodl, pro 2, prod3, prod4, prod5, yavg, zavg, ystdavg, zstdavg; double sy, sz, systd, szstd, rl2y, rl3y, r23y, rl2z, rl3z, r23z; double str_tol, el_tol, rd_tol, pb_tol; int key_quit; in.t i; FILE *fptr; time t ltime; // //
_clearscreen (_GCLEARSCREEN) ; σcal_err=0; setup_vid(cthead) ; if( chdir("c:\\init"))
{ _settextposition(3,18) ; print ( "Unable to locate the directory: ctWinit" ); exit(0) ; } if((fptr « fopen("ct_ιtile.dat", "r")) «== NULL) { _settextposition(4,18); printf("CAN'T OPEN FILE CT_TILE.DAT" ) ; exit(O);
} fscanf (fptr, "%f %f, &s_wht_rd, ϊrs whtj ); fscanf (fptr, "%f %f", &s_brn_rd, &s_brn_b) ; fscanf (fptr, "%f %f", &s_yel_rd, &s_yel_b) ; fscanf (fptr, "%f *f", &s_gray_rd, &s_gray_b); fscanf (fptr, "%f If", 6s_cen_rd, &s_cen_b) ; fclose(fptr) ; if ((fptr «= fopen("cal tol.dat", "r")) « NULL)
{
_ββttextposition(5,18) ; printf("CAN'T OPEN FILE C:\\lNIT\\CAL_TOL.DAT" ) ', exit(l); ) fscanf (fptr, " %lf %lf %lf %lf",
&str_tol, Sel_tol, &rd_tol, &pb_tol); fσlose(fρtr) ; βettextposition(4,l ) ; printf ( "rd_tol«%8.31f pb_tol-%8.31 ",rd_tol,pb_tol ); if( chdirCotWhvi")) {
_settextposition(2, 18) ; print ( "Unable to locate the directory: c:\\hvi" ); exit(O) ; } s_wht_y=s_wht_rd*20.0; s_yel_y-s_yel_rd*20.0 ; s_gray_y=s_gray_rd*20.0 ; s_brn_y=s_brn_rd*20.0; s_cen__y=s_cen_rd*20.0 ;
(l+0.2*s_wht_rd) /(749.7+7.14
(l+0.2*s_yel_rd) /(749.7+7.14*s
( 1+0.2*s_gray_rd) / (749.7+7.14*s
(l+0.2*s_brn_rd) /(749.7+7.14*s
(l+0.2*s_cen_rd) /(749.7+7.14*s
Figure imgf000151_0001
__settextposition(l,20) ; printf ( "Press Esc key to exit " );
_settextposition(2,2) ; printf( "Please Place White Tile and Press 1 " ); rl ; key__quit=getch{ ) ; if (key_quit-=KEY_ESC) goto cal_exit; if (key_quit1-0x31) goto rl; delay(200); fwht y-( float) 0.0 ; f ht_z=(float)0.0 ; for(ι=0; i<10; I++)
{ adσ_mns (Y_CHANL[cthead ] , fiiwht_y, &iwht_z ) ; fwht_y+-iwht_ ; fwht z+=iwht z; } fwht_y=fwht_y/10.0 ; fwht_z=fwht_z/10.0;
_βottextposition(3,2); printf ( "Please Place Brown Tile and Press 2 " ) ; r2 i key_quit-getch( ) ; i (koy_quit«=KEYJESC) goto cal_exit; if ( koy_quit 1 -0x32 ) goto r2 ;
,&ibrn_z) ;
Figure imgf000152_0001
_settextposition(4,2) ; ");
;
Figure imgf000152_0002
_eettextposition(5,2); printf( "Please Place Gray Tile and Press 4 "); r : key_quit-getch( ) ; if (key_quit==KEY_ESC) goto cal_exit; if (key_quitl=0x34) goto r4; delay(200); fgray_y=(float)0.0; fgray z=(float)0.0; for(i-0; i<10; I++) "~
{ adα_mns( CHANL[cthead] ,&igray_y,&igray_z) ; fgray_y+-ϊgray_y; fgray z+-igray z;
} fgray_y=fgray_y/10.0; gray_z-fgray_z/10.0 ;
_βettθXtpoβition(6 , 2 ) ; printf( "Please Place Central Tile and Press 5 "); r5 J key_quit«=getch( ) ; if(key_quit—KEY ESC) goto cal_exit; if (koy_quiti-0x3"5) goto r5; delay(200); cen v-(float)0.0; fcon_z=( float)0.0; for(I-0 ; i<10 ; I++ ) 6053
, &icen_y,£icen_z) ;
Figure imgf000153_0001
_settextposition(6, 2) ; printf ( sgl) ;
// Start doing the calculations here. ysum=fwht_y+fbrn_y+fyel_y+fgray_y+fcen_y; zsum=fwht_z+fbrn_z+fyel_z+fgray_z+fcen_z; 3tdy8um-s_wht_y+s_bm_y+s_gray__y+s_yel_ y+s__cen_y; stdzsum=s_wht_z+s_brn_z+s_gray_z+s_yβl_z+s_cen_z; ysumsq- (fwht_y*fwht_y)+fbrn_y*fbrn__y+f ye l_y*fyel_y+fgray_y*fgray_y+fc n_y*fcen_y; zsumsq-fwht_z*fwht_z+fbrn_z*fbrn_z+fyel_z*fyel_z+fgray_z*fgray_z+fcen z*fcen_z; s tdy sumsq-s_wh t__y * s_wh t_y +s_brn_y * s_brn_y +s_gray_ * s_gray_y +s_yel_y * s y β l_y +s_ce n_y *s_cen_y ; stdzsumsq-s_wht_z*s_wht_z+s_brn_z*s_brn_z+s_gray_z*s_gray_z+s_ el_z*s yel_z+s_cen_z *s_cen_z ; prod 1 - f wh t_y * a_wh t_y+f brn_y *s_brn_y+f yβl_y * s_ye l_j y+f gray_y * s_gray__y+f e n_y * s_ce n__ ; prod2-fwht_y*s_wht_z+fbrn_y*s_brn_z+fyel_y*s__yel_z+fgray_y*s_gray_z+f en_y*s_cen_z ; prod3-fwht_z*β_Wht_y+fbrn_z*8_brn_y+fyel_z*s_yel_y+fgray_z*s_gray_y+f en_z * s cen y ; prod4-fwht_z*s_wht_z+fbrn_z*s_brn_z+fyel_z*s_yel_z+fgray_z*8_gray_z+f
Figure imgf000153_0002
prod5=fwht_y*fwht_z+fbrn_y*fbrn_z+fyel_y*fyel_z+fgray_y*fgray_z+fcen_ *fcen_z;
Figure imgf000153_0003
tcmp-(yβumsq/5-yavg*yavg) ;
sy-sqrt(temp) ;
Figure imgf000154_0001
l l fl d l 2 ( l 3 ) if( ohdir("oι\\init"))
{
_settextposition(2,18); printf("Unable to locate the directory! ciWinit" ); exit(0) ; if (cthead—0) fptr = fopen("ctcal0.dat", "w" ) ; _settextposition(22,20);printf("Opened file ctcal0.dat "); else if (cthead==l) fptr - fopenC'ctcall.dat", "w" ) ;
_settextposition(22, 20) ;printf ("Opened file ctcall.dat " ) ; else if (cthead«2) fptr - fopen( "ctcal2.dat", "w" ) ;
_settextposition(22,20); printf ("Opened file ctcal2.dat "); fprintf (fptr, "%f %f %f\n", y_cal.σl, y cal.c2, y_cal.σ3) ; fprintf (fptr, "%f %f %f\n", z_cal.cl, z_cal.c2, z_cal.c3); fcloso(fptr) ;
if( chdir("cι\\hvi"))
{
_settextposition(2,18); printf ( "Unable to locate the direetorys hvi" ); exit(0) ; }
// white tile ycolor=y_cal.cl+(fwht_y*y_cal.c2)+(fwht_z*y_cal.c3 ) ; zcolor=z_cal.cl+( fwht_y*z_cal.c2 )+(fwht_z*z_cal.c3 ) ; rd=ycolor/20.0; plus_b=((rd/100.0)-(0.847*zcolor/2000.0))*(35.7*(21+0.2*rd)/
(l+0.2*rd)); rd_dif-rd-s wht_rd; b_dif=plus_b-s_wht_b; settextposTtion(4,1); printf(" White Tile : Rd %4.1f +B %4.1f Rd %4.1f +B %4.1f Rd
%4.1f +B %4.1f ", s_wht_rd, s_wht_b, rd, plus_b, rd_dif, b dif ); Tf (fabs(rd_dif) > rd_tol)
{
_settextposition( 4, 37); printf( "Rd %4.1f",rd); if(fabs(rd_dif) > rd_tol*3.0 ) ccal_err++;
} if(fabs(b_dif ) > pb_tol )
{
_settextposition(4, 46); printf( "+B %4.1f",plU3_b); if (fabs(b_di ) > pb_tol*3.0) ccal_err++; >
// brown tile ycolor=y_cal .cl+(fbrn_y*y_cal.c2)+(fbrn_z*y_cal.c3) ; zcolor=z_cal.cl+(fbrn_y*z_cal.c2)+(fbrn_z*z_cal.c3) ; rd=ycolor/20.0;
Rd ;
Figure imgf000155_0001
_βettextpoaition(6, 46); printf("+B %4.1f",plus_b); if(fabs(b_dif ) > pb_tol*3.0) ccal err++; }
// yelow tile ycolor=y_cal.cl+(fyel_y*y_cal.c2 )+(fyel_z*y_cal .c3 ) ; zcolor=z_cal.cl+(fyel_y*z_cal.c2)+(fyel_z*z_cal.c3) ; rd=ycolor/20.0; plus_b=((rd/100.0)-(0.847*zcolor/2000.0))*(35.7*(21+0.2*rd)/
(l+0.2*rd)); rd_dif-rd-s_ι_yel_rd; b_dif-plus_b-s_yel_b; _settextposxtion(8,l) ; printf(" Yellow Tile : Rd %4.1f +B %4.1f Rd %4.1f +B %4.1f Rd
%4.1f +B %4.1f ", s_yel_rd,s_yel_b,rd,ρlus_b, rd_dif,b_dif); if(fabs(rd_dif ) > rd_tol)
{
_settextposition(8, 37); printf("Rd %4.1f",rd); if(fabs(rd_di ) > rd_tol*3.0 ) ccal_err++; } if(fabs(b_dif) > pb_tol)
{
_βettextposition(8, 46); printf C+B %4.1f ",plus_b) ; if (fabs(b_dif ) > pb_tol*3.0) σcal_err++; }
// gray tile ycolor=y_cal.cl+(fgray_y*y_cal.c2)+(fgray_z*y_cal.c3) ; zcolor=z_cal .cl+( fgray_y*z_cal .c2 )+( gray_z*z_cal .c3 ) ; rd-ycolor/20.0» plus_b=((rd/100.0)-(0.847*zcolor/2000.0))*(35.7*(21+0.2*rd)/
(l+0.2*rd)); - — -, _ ._ . rd_dif-rd-s gray_rd; b_dif=plus_b-s_gray_b;
_βettextposTtion( 10 , 1 ) ; printfC Gray Tile t Rd "44. If +B %4.1f Rd %4.1f +B %4.1f Rd
%4.1f +B %4.1f ", s_gray_rd,s gray_b,rd,plus b,rd_dif, b_dif); if(fabs(rd cfif) > rd tol) *"
{
_βettextposition(10, 37); printf("Rd %4.1f" ,rd); if (fabs(rd_dif) > rd_tol*3.0 ) cσal_err++; if(fabs(b dif) > pb tol)
_settextposition(10, 46); printf C+B %4. If " ,pluβ_b); if (fabs(b_dif ) > pb_tol*3.0) ccal_err++; }
// Central tile ycolor=y_cal . cl+ ( f cen__y*y_cal ,c2 ) + ( f cen_z*y_cal . c3 ) ; zcolor=zι cal.σl+(fcen y*z σal.c2)+(fcen z*z_cal.c3) ; rd=ycolor / 20.0; plus_b=((rd/100.0)-(0.847*zcolor/2000.0))*(35.7*(21+0.2*rd)/
(l+0.2*rd)); rd_dif=rd-s cen_rd; b_dif=plus_b-s_cen_b; _set textposXtio (12,1); printfC Central Tile j Rd %4.1f +B %4.1f Rd %4.1f +B %4.1f Rd
%4.1f +B %4.1f " ,ε_cen_rd,s_cen_b,rd,plus_b,rd_dif, b_dif); if (fabs(rd_dif ) > rd_tol)
{
_settextposition(12, 37); printf("Rd %4.1f",rd); if(fabs(rd_dif) > rd_tol*3.0 ) ccal_err++;
} if(fabs(b_dif) > pb_tol)
{
_βettextposition( 12, 46); printf("+B %4.1f",plus_b); i (fabs(b_dif) > pb_tol*3.0) ccal_err++;
} if (σσal_errl=0)
{
_settextposition(16, 1); printf(msg3) ;
_settextposition(20, 1); printf(msg3) ;
_βettextpθβition(21, 1); printf(msg2) ;
_settβxtposition(22, 1); printf(msg3) ;
_settextposition(23, 1); printf (msg2) ;
_βettextpoaition(24, 1); printf(msg3) ;
} dsk_colcal (cthead) ; if (ccal_err—0) {time(&ltimβ) ;
Figure imgf000157_0001
} cal__exitt int [ctheadJ-0.0; intz[cthead]=0.0; slpy[ctheadJ-1.0; slpz[ctheadj-1.0;
_sottoxtposition(17,20);printf(" ");
_settextposition(18, 20); rintfC Press any key to exit ");
_sottoxtposition(19,20)ιprintf(" "); cx=gotch( ) ;
} // end color_cal
// ColorF.c
// This code takes one reading of one A/D channel. void adc_value(int adch, int adgain, int* valuep)
{ int lb, hb, crd, rep=-30000, val; outp(ADBase+2,adch) ; delay(2); // settling time ?? outp(ADBase,0); do { crd « inp(ADStat); rep++;} while (((crd & 0x80) =- 0x80)&&rep<300) ; lb - inp(ADBasβ)»4; hb = inp(ADBase+l)«4; val = hb; val += lb;
*valuep = val; } // end adc value //
// ColorF.c
// This code is written to read the extra moisture sensor behind the // gin stand. It takes an average of eight readings of the one channel // when it is called. It then converts the raw A/D value to a real // number of moisture content (wet basis). void get_sjm( void )
{ int j, tmp; double sum; sum=0.0; for (j=0;j<8;3++)
{ adσ_yalue(07,l,&tmp); // channel, gain, data sum +- tmp;
}
SJ_dat[ll]*(iπt)( (sum+4.0)/8.0); // mean of 8 readings rSJ_dat[ 11 ]-((βum+4.0)/8.0-2048.0)*10.0/2047.0/1.98*1.29+2.1;
} // end get elm //
// ColorF.c
// This piece of code reads several different analog inputs. It can
// readily be modified by one of skill in the relevent art to
// accomodate the exact hardware in the system.
// It reads
// the appropriate analog input channel, takes a mean of the analog
// value, and converts it to a real number value. The variables
// that it roads have to do with analog moisture values and
// analog temperature data that is available in the system.
.213, 1.216};
only 4 readings ;
only 4 readings
Figure imgf000159_0001
outp( OBase+3 , i) ; sum-0; for (j=0;j<4;j++)
{ adc_value(15,1, &tmp) ; sum +- tmp;
}
SJ_dat[i]=(int) ( (sum+2.0)/4.0) ; // mean of only 4 readings
} } // end get mc
//
//
// This section of code gets
// the mean of 16 readings of one channel and the adjacent channel.
// The way the hardware has been connected the channel for
// the Y of the color of one of the stations and Z of the color will
// be located in the next higher analog channel. Therefore, when this
// procedure is called IS readings of the Y and 16 readings of the Z
// of an individual measurement station are taken and the resulting
// means are passed back to the calling procedure. A slight delay is
// added to the program so that the 16 values are spread out over
// approximately l/60th of a second which is the common noise
// frequency due to the power system in this country. void adσ_mns(int adch, int* yvp, int* zvp)
{ int i, lb, hb, crd, rep; unsigned ysum, zsum; ysum-0 ; zsum=0; for
Figure imgf000160_0001
delay(3);
}
*yvp = (ysum+8)»4;
*zvp = (zsum+8)»4;
} // end adc mns
//
//
//
// This procedure takes one reading of one channel of the A/D // converter. void εhowad(int ch) { int val; adc_value(ch,0x8,&val) ;
}
// end showad
//
//
// This section of code addresses the
// data translation video multiplexer card and changes the input
// channel used for the frame grabber to measure trash from the video
// cable running from station one, two, or three. It also instructs
// the frame grabber card to go live which means it. starts viewing the
// video coming from the camera. void setup vid(int ch)
{ // if (ch==0)
{ outp(DT2859,0); } // switch Video MUX here if (ch~l)
{ outp(DT2859,l); } // switch Video MUX here if (ch—2)
{ outp(DT2859,2); } // switch Video MUX here
HRTlive(HRTseg);
} // end setup_ id
//
// This is the moisture content measurement manager software. It
// controls data collection of the resistance moisture sensors at the
// three locations.
// void mcmgr(int cthead) // camera # int i, vail , val2; float si , 82 ;
CompOK ( ) ;
adc_mns (Y_CHAN [cthead ]+2 , S,vall , S,val2 ) ; SJ_dat[5+cthead] - vail; if (cthβad==0) last_read[cthead) .m=( ( (float) (vall-2048)*10.0/2047.0)
/0.1429+4.0);
6lS6 / / Ctl βdd —= 1 or 2 last_read[cthead] .m=( ( (float) (vall-2048)*10.0/2047.0) /
0.1429+4.0) ; if (cthead==0)
{
SJ_dat[10] = val2; rSJ dat[10] = val2*0.01515-29.75; }
//
// set these logically
1 st_read[cthead) .mok = 0;
// out of range resistance moisture readings if ( last_read[cthead) ,m< 4.7)
{ last_read[cthead] .mok - 1; last_read[cthead ] .m=0.0; } if ( last_read[cthead] .m>10.2)
{ last_read[cthead] .mok = 1; last_read[cthead) .m-0.0; } // get the temperatures all three each time sl>=0.0; 82-0.0; for (i=0;i<4;i++) // average of 16*4-64 readings
{ adc_mns(12,&vall,&val2); // TI at 12, T2 at 13 si += vail; s2 += val2;
}
SJ_dat[0] = (int)((sl+2.0)/4.0); SJ_dat[l] - (int)((s2+2.0)/4.0); rSJ_dat[0]=( 1910.0 -sl/4.0*0.894-5.0); rSJ_dat[l]=( 1929.0 -s2/4.0*0.903-5.0) ; sl-0.0; s2-0.0; for (i-0;i<4;i++) // average of 16*4-64 readings
{ adc_mns(14,&vall,&val2); // Tl at 12, T2 at 13 si += vail; s2 +- val2;
}
SJ_dat[2) - (int)((sl+2.0)/4.0); rSJ_dat[ 2 ]=( 1929.0 -sl/ .0*0.903-5.0);
}
//
// This code iβ the basic color measurement manger code.
// It reads the Y and Z of an analog channel. It
// calls the code which calculates the Rd value, the +b value and from
// that, the color code for the sample. int colrmgr(int cthoad) // camera #
Figure imgf000163_0001
CompOK( ) ; y_v=( float) 0.0; z_v-(float)0.0; for(i=0; i<10; I++)
{ adc_mns(Y_CHANL[camera] ,£ry_clr,-iz_clr) ; y_v+=y_clr; z v+-z_clr;
} y_v=y_v/10.0; z_v=z_v/10.0;
CompOK( ) ; if (compute_color(y_v, z__v)==PASS)
{ color_step=20;
} else
{ rd=( loat) 0.0; plua_b-(float)0.0; colr-1; // bad color_step=20;
} color_step=0; return(PASS) ;
}
//
//
// This section of code initializes the color measurement software by // reading the six coefficients for each of the color cameras that // have been most recently calculated with the calibration software. // These values are read from the hard disk of the controlling // computer. void color_init(void) int jnk;
FILE *ccal; if ((ccal = fopen("ct\\init\\ctcal0.dat", "r"))== NULL) {
_s e ttextpos ition (6,18); printf ("Can't open file σι\\init\\ctcal0.dat\n" ) ; printf ("press any key to continue"); jnk-gotch( ) ; olβo
{ fscanf(ccal, "%f %f %f", 4ccf[0)[0], Sccf[0][l],
&ccf[0][2]); fscanf(ccal, "%f %f %f", &ccf[0][3], &ccf[0][4],
&ccf[0][5]); fclose(ccal) ; } if ((ccal = fopen( "csWinitWctcall.dat", "r" ) }==NULL)
{
_settextposition (6,18); printf("Can't open file c»\\init\\ctcall .dat\n" ); printf("press any key to continue"); jnk-getch( ) ; else fscanf(ccal, "%f %f %f", &ccf[l][0], &ccf[l][l),
&ccf[l][2]); fscanf{ccal, "%f %f %f", 4ccf[l][3], &ccf[l][4], iccf[l][5]); fclose(ccal) ;
if ((ccal = fopenCcA\initWctcal2.dat", "r"))—NULL)
{
_settextposition(6,18); printf("Can't open file c:\\init\\ctcal2.dat\n" ) printf("press any key to continue"); jnk-getch( ) ;
} else
{ fscanf(ccal, "%f %f %f", &ccf[2][0], &ccf[2][l],
4ccf[2][2]); fscanf(ccal, "%f %f %f", -.σef[2][3], ϊ,cσf[2][4), ϊ,ccf[2][5]); fclose(ccal) ;
}
//
// The purpose of this code is to
// calculate the color code and quandrant biaed on the Y and 2 value
// measured from the frame grabber. Before the color code can be
// calculated, the RD and +b are calculatod and corrections are made
// to the Rd and +b value based on the autocalibration procβduro. int computo_color( float y_volt, float z_volt) βta iσ float g_f[10][5] =
{85.0, 31.468, 9.9655, -2.2792, 0.081001},
{80.0, 38.582, 5.9261, -1.024, 0.015288},
{75.0, 58.991, -0.7551, -0.046587, -0.016945},
{70.0, 74.096, -3.8331, 0.27064, -0.020759},
{65.0, 79.435,-3.2229,0.16912,-0.012738},
{60.0, 82.639,-1.8565,0.012919,-0.0055395},
{55.0, 86.638,-1.1747,-0.023637,-0.0040528},
{50.0, 92.997,-1.4781,0.03876,-0.0055587},
{45.0, 111.89,-4.8327,0.3288,-0.012375},
{40.0, 112.67,-1.0446,-0.07925,0.0006209};
} static float σ f[10][5) =
{
{85.0, -31.367,2.2224,0.32192,-0.0079989},
{80.0, -12.954,-2.4711,0.8563,-0.025021),
{75.0, -26.445,1.9071,0.5813,-0.019579},
{70.0, -35.051,5.1083,0.38343,-0.01612},
{65.0, -41.948,8.0383,0.15654,-0.01036),
{60.0, -41.597,8.6814,0.12265,-0.009735},
{55.0, -44.486,9.8471,0.04466,-0.0078969},
{50.0, -42.888,9.513,0.093693,-0.0092473},
{45.0, -49.896,11.552,-0.089758,-0.0032186},
{40.0, -54.457,12.609,-0.1676,-0.00075985};
} static int grange[17] = {0,15,20,25,30,35,40,45,50,55,60,65,70,
75,80,85,100}; static int crange[10] = {10,20,30,37,40,50,60,70,80,100}; static int grtbl[17] (10) =
{ {111,111,113,121,121,131,133,241,243,251}, {111,111,113,121,121,131,133,241,243,251}, {112,112,114,122,122,132,134,241,243,251}, {211,211,213,221,221,231,233,242,244,252}, {212,212,214,222,222,232,234,242,244,252}, {311,311,313,321,321,331,333,341,343,351}, {312,312,314,322,322,332,334,342,344,352}, {411,411,413,421,421,431,433,441,443,851}, {412,412,414,422,422,432,434,442,444,852}, {511,511,513,521,521,531,533,541,543,853}, {512,512,514,522,522,532,534,542,544,854}, {611,611,613,621,621,631,633,841,841,855}, {612,612,614,622,622,632,634,842,842,855}, {711,711,713,713,821,831,831,843,843,855}, {712,712,714,714,822,832,832,844,844,855}, {811,811,811,811,833,833,833,845,845,855}, {812,812,812,812,833,833,833,845,845,855}; static float p m=-1.4091; static float p"b[6] » {86.3183,83.9183,81.2183,78.4183,75.1183,
71.8183};
static float p_of[6] = {14.0, 13.8, 13.6, 13.4, 13.2, 13.0}; float gh, gl, gx, ch, cl, ex, temp; float grade, colour, ycolor, zcolor, yσlr, zclr; int dk, dm, i, /*j,*/ return_flg; float plus__b_2, plus__b_3; return_flg-PASS;
Figure imgf000166_0001
} for(i=0; i<=9; i++) if(colour < crange[i))
{ dm=i; break;
> if((dk >=0 && dk <=16) && (dm >=0 && dm <=9)) colr=grtbl[dk] [dm] ; else return_flg-FAIL; break; case ON: for(i=0; i<=5; I++)
{ temp=plus_b*p_m+p b[i]; if(rd > temp) Ereak;
> colr-i+1 ; if(plus_b > p of[i]) colr=colr+l;
} last_read[camera] .y = yclr; last_read[camera] .z = zclr; last_read[camera] .rd - rd; last_read[camer ] .pb = plus b; last_read{camera] .cc = colr7l0; last_read[camera] .eg - colr%10; if (return_flg) last_read[camera) .cok=0; else last_read[camer ] .cok=l; return( return flg) ;
}
//
// end compute color
//
// end program
// This is the section of code in which the calculations are made on // the number of lint cleaners or seed cotton cleaners to use.
// ContDecF.C
//
#include "cainc.h" // all includes
#include "cadef.h" // all defines
#include "caext.h" //
#include "caproto.h" // prototypes of all functions
// ContDecF.C
// This procedure opens the decision matrix file for read.
// int open_deσision_matrix_ ile( void )
{ lc_decision_file = fopen( "cι\\init\\lcdec95a.out" , "r"); if (lc_decision_file == NULL)
{ display_error{ " Unable to open file lcdec95a.outl " ); return(O) ;
} scc_decision_file - fopen( "c:\\init\\sccd95a.out", "r"); if (sec decision file -- NULL)
{ display_error( " Unable to open file sccd95a.outl " ); return(O) ; } return(l) ;
} //
// ContDecF.C
// This procedure initializes the decision matrix
// void initialize_dec_matrix( void )
/* initializes decision matrix to all decisions = ' ' (blank) */
/* and all predicted values to 0 */ int rdindx, // Rd subscript pbindx, // +b subscript mindx, // moisture subscript lindx; // leaf subscript for ( dindx-0;rdindx<31 ;rdindx++) for (pbindx-0; bindx<21 ;pbindx++) for (mindx=0;mindx<13;mindx++) for (lindx-0;lindx<13;lindx++)
{ lσ_dec_rkb[ rdindx] [pbind ][mindx][ lindx ]=(byto) 3; sec dec rkb[rdindx] [pbindx] [mindx] [ lindx ]=(byto )4;
} roturn;
}
//
// ContDecF.C
// This procedure reads the lint cleaner decision file
// into the decision matrix
// int read_lc_deσ_file( void )
/* reads decision matrix file into decision matrix variable */
{ int i, j, rdindx, // Rd subscript pbindx, // +b subscript mindx, // moisture subscript lindx; // leaf subscript float r , rl, rpb; char c[40];
_settextposition(21,l) ; printf("Reading lc_decision_file" ) ; rewind ( lc_decision_file ); for (i=0;i<3549 i++)
{ fscanf(lc_deciβion_file," %f *f",&rl,&rm) ; for ( j=0; j<31?j++) fscanf(lc decision_file, " %σ",&c[j]); fscanf(lc_decision_file, " %f\n",&rpb) ; pbindx = (int) (rpb*2.0-10.0) ; // for 5.0 to 15.0 by 0.5 mindx = (int) (rm*2.0-6.0) ; // for 3.0 to 9.0 b 0.5 lindx - (int) (rl*2.0-4.0); // for 2.0 for (rdindx=0 ;rdindx<31 ;rdindx++) if ((rdindx =0) &£. (rdindx<31) &&
(pbindx>-0) && (pbindx<21) it
(mindx >=0) && (mindx <13) &4
(lindx >-0) &£, (lindx <13)
Figure imgf000169_0001
) lc_deσ_rkb[rdindx] [pbindx] [mindx] [lindx] = (byte ) { [rdindxJ-0x30 ) ;
} return(l);
>
// — ContDecF.C
// This procedure reads the seed cotton cleaner decision file
// into the decision matrix
// int read_scc dβe_ ilβ( void )
/* reads decTsion matrix file into decision matrix variable */
{ int i, j, rdindx, // Rd subscript pbindx, // +b subscript mindx, // moisture subscript lindx; // leaf subscript float rm,
rl, rpb; char c(40]; εettextposition(21 l) ; printf( 'Reading scσ_decision_file" ) ; rewind( βσc_deciβion_file ); for (i=0;i<3549;i++) fscanf (εcσ_decision_file," %f %f",&rl,&rm) ; for ( j-0; j<31; j++) fscanf(sec deciβion_file, %c",&c[j]); fscanf(sec deσision_file, " %f\n",&rpb); pbindx = (Int) (rpb*2.0-10.0) ; // for 5.0 to 15, by 0.5 mindx - (int) (rm*2.0-6.0); // for 3.0 to 9. by 0.5 lindx = (int)(rl*2.0-4.0); // for 2.0 to 8.0 by 0.5 for (rdindx=0;rdindx<31;rdindx++) if ((rdindx>-0) && (rdindx<31) fiSr // for 50.0 80.0
(pbindx>=0) && (pbindx<21) && // for 5.0 15.0 (mindx >-0) && (mindx <13) // for 3.0 9.0 (lindx >-0) && (lindx <13) // for 2.0 8.0 βcc_deσ_rkb[rdindx] [pbindx] [mindx] [lindx] * (byte) (c[rdindx)-0x30) ;
} return(l) ; }
// — ContDecF.C
// This procedure converts a color index to a color code,
// used in the microqin.
// int index__to color( int index )
/* converts Tndex( 0 - 14 ) to color and returns color */
{ switch( index )
{ case 0 return( 31 case 1 retur ( 32 case 2 return( 33 case 3 return( 41 case 4 return( 42 case 5 return( 43 case 6 return( 51 case 7 return( 52 case 8 return( 53 case 9 return( 61 case 10 return( 62 case 11 return( 63 case 12 return( 71 case 13 return( 72 case 14 return( 73 default return( 0 ); } roturn( 0 );
}
// ContDecF.C
//
// This code converts the color code to a color index,
// used in the microgin. int σolor_to_index( int color )
// converts color to index( 0 - 14 ) and returns color index
Figure imgf000171_0001
ContDecF.C
// This procedure was used to check the decision made based on // measurements made behind the gin stand and using the prediction // method. It uses data from the measurements after // the lint cleaners.
// int lc check( int code, double areapc ) switch( code ) { case 0 i return( 2 );
// try to get at least leaf 2 in this section
// try to get at least leaf 3 in this section case 12 i case 22 case 24 case 32 case 33 case 34 if ((areapc<0.55)£«,(areapc>0.35)) return(2); else return(l)? // try to got at least leaf 4 in this section caso 11 t
reapc<0.85)iJ<(areapc>0.55)) return(2) ; else return(l) get at least leaf 5 in this section
Figure imgf000172_0001
if ((areapc<l , 25) &&(areapoO. 85)) return(2 ) ; else return(l) // try to get at least leaf 6 in this section case €1 i case 62 i case 63 : if ( (areapc<2.35)&&(areapc>l. .25)) return(2) ; else return(l); // try to get at least leaf 7 in this section case 71 : if ( (areapc>2.35) ) return(2); else return(l); default : return( 2 );
} }
// ContDecF.C —
// Converts color code to price based restricted color codes.
// int color_ unction( int code )
// converts color code from color/trash meter to allowable color codes
//
{ switch( code )
{
Figure imgf000172_0002
ContDecF.C
Figure imgf000173_0001
int moist_to_index( float mo st )
// converts molβt( integer value 256.0 times real moisture ) to
// index( 0 - 28 ) */ float real_index; int index; real_index <= (float) (( moist - 3.0) *4.0 ); index - (int) ( real_indβx +0.5); if (index < 0) return( 0 ) ϊ if (index > 26) return( 26 ); return( index ) ;
}
// ContDecF.C
// Converts the trash to an index which points into the decision
// matrix file.
// int trash_to_index( float trash )
// converts trash( 72 to 100 by 2 ) to index( 0 - 14 )
// and returns index
{ float real_index; int index; real_index - (float) (( trash - T2.0 ) / 2.0); index = (int)( real_index +0.5); if (index < 0) return( 0 ); if (index > 14) return( 14 ); return( index );
}
// ContDecF.C
// Round color index for use with the matrix.
// int round_color( float real_color )
// returns integer value index which is rounded value
// of real_color index
{ int color; if (real_color »= (float) -1.00) return( 0 ); if (real_color > (float) 14.00) color = 14; else color - (int)( real_color +0.5); return( index to color( color ));
} " "
// _-_ > ContDecF.C
// Rounds trash index.
// int round_trash( float real trash )
// returns integer value whTch is rounded value of real_trash rβturn( 72 + 2 * (int)( (real_trash - 71.5) / 2.0 ));
}
// ContDecF.C
// Converts trash readings to a trash index.
// int trash_function( int sa, int βσ )
// converts area and count from color/trash meter to trash code
{ float real_trash; int area, count ; aroa - sa/10 ; count - so ; real trash - ( float) ( 109.78 - 0.33 * area - 0.37 + count "~ + 0.00146 * aroa * aroa + 0.0015 * count * count) ;
return ( (int)( real_trash+0.5 ) );
}
// ContDecF.C
// Used to round and smooth the data for control.
// void RKB_measurement_process( int sta )
// gets raw data and filters it
{ static float f_cσ[3]= {(float)O.O, (float)O.O, (float)O.O }, f_ta[3]« {(float)200.0, (float)200.0, (float)200.0 }, f_tct[3]={(float)50.0, (float)50.0, (float)50.0 }, f_mc[3]= {(float)7.0, (float)7.0, (float)7.0 };
/* there is new mc data each time */ CompOK{ ) ; if (last_read[sta] .mok==0)
{ f_mc[ sta ] - (float)0.8*f_mc[ sta ] + 0.2*las _read[ sta ) .m; l_read_data[ sta ].fmc = f_mσ[ sta ];
} return;
}
// ContDecF.C
// Used to conert the percent area measured by the trash meter to an
// estimated leaf value, used in the procing of cotton.
// int parea_to_clgr( double pa)
{
0.15) return(2);
0.35) return(3)
0.55) return(4)
0.85) return(5);
1.25) return(6);
Figure imgf000175_0001
2.35) retum{7); re urn ) ; } // end parea_to_clgr( )
// ContDecF.C
// Seed cotton cleaner lookup, uses the values of Rd, +b, moisture and // percent area to look up the optimum seed cotton cleaner use based // on the ColorL program output. int scc_lookup( int rdc, double pbc, double mσ, double pac) { int rdindx, pbindx, mindx, lindx; int βcclu;
// for out of bounds conditions if ( rdσ < 50 ) roturn(O); // beyond the tablo limits
if ( pbc >13.0 ) return(O); // beyond the table limits if ( pac <0.41 ) return(O); // perhaps rdindx = rde-50; if (rdindx < 0) rdindx = 0; // 0 .. 30 if (rdindx > 30) rdindx = 30; pbindx = (int) (pbc*2.0-10.0) ; // for 5.0 to 15.0 by 0.5 if (pbindx<0) pbindx-0; // 0 .. 20 if (pbindx>20) pbindx=20; mindx = (int) (mc*2.0-6.0) ; // for 3.0 to 9.0 by 0.5 if (mindx < 0) mindx - 0; // 0 .. 12 if (mindx > 12) mindx - 12;
// convert percent area to leaf index leaf=2 -> index-0 if (pac<0.10) lindx - 0; else if (pac<0.15) lindx = 0; // leaf 2 else if (pac<0.25) lindx - 1; else if (pac<0.35) lindx - 2; // leaf 3 else if (pac<0.45) lindx - 3; else if (pac<0.55) lindx = 4; // leaf 4 else if (pac<0.70) lindx - 5; else if (pac<0.85) lindx « 6; // leaf 5 else if (pac<1.05) lindx - 7; else if <pac<1.25) lindx - 8; // leaf 6 else if (pac<1.80) lindx = 9; else if (pac<2.35) lindx -10; // leaf 7 else if (pac<2.90) lindx -11; else lindx = 12; scclu » scc_dβc_rkb[rdindx] [pbindx] [mindx] [lindx] } return( acσlu) ; } // end sec looku ()
// ~ ContDecF.C
// Lint cleaner recommendation based on Rd, +b, moisture content and // percent area based on the output of the colorL program. int lc_lookup( int rdc, double pbc, double mσ, double pac) // pao* = peccent srea trash { int rdindx, pbindx, mindx, lindx; int lcluj
// for out of bounds conditions if ( rdc < 50 ) return(l); // beyond the table limits if ( pbc >13.0 ) return(l); // beyond the table limits if { pac <0.41 ) return(l); // never need leaf below 3
// always have at least one lint cleaner
// convert values to table indiciea, and be sure they are in range rdindx - rdc-50; if (rdindx < 0) rdindx - 0; // 0 .. 30
if (rdindx > 30) rdindx - 30; pbindx - (int) (pbc*2.0-10.0); if (pbindx<0) pbindx=0; if (pbindx>20) pbindx=20; mindx - (int)(mc*2.0-6.0); if (mindx < 0) mindx « 0; if (mindx > 12) mindx = 12; // convert percent area to le
Figure imgf000177_0002
if (pac<0.10) lindx - 0; else if (pac<0.15) lindx = 0; // leaf 2 else if (pac<0.25) lindx - 1; else if (pac<0.35) lindx = 2; // leaf 3 else if (pac<0.45) lindx « 3; elae if (pac<0.55) lindx - 4; // leaf 4 else if (pac<0.70) lindx «= 5; else if (pac<0.85) lindx - 6; // leaf 5 else if (pac<1.05) lindx - 7; else if (pac<1.25) lindx = 8; // leaf 6 else if (pac<1.80) lindx - 9; else if (pac<2.35) lindx -10; // leaf 7 else if (pac<2.90) lindx -11; else lindx = 12; lclu - lc_dec_rkb[rdindx] [pbindx) [mindx] [lindx] ; return(lclu) ;
} // end lc_looku ( )
// ContDecF.C
// Rules of how many lint cleaners to use based on estimates.
// int rule_of_thumb( int color, double pa)
{ static int ltime=6, dir=0; if (cnlcl>=2) { switch (color)
{ case 51 i if (pa < 1.0) return(l); else return(2); case lit case 21: case 31 i case 12 i case 22i case 41s case 42 t if (pa < 0.7) return(l); else return(2); case 52 t if (pa < 0.5) return(l)} else return(2); turn(2);
Figure imgf000177_0001
olβo if (cnlc2>-2)
{ switch (color) { case 51 i if (pa < 0.7) return(l); else return(2); case lit case 21 t case 31t case 12 t case 22t case 41: case 42s if (pa 0.5) return(l); else return(2); case 52 t if (pa 0.3) return(l); else return(2); defaults return(2); } else return( 99 ); // not opperating normally
)
// ——_- ContDecF.C —
// Adjust the color index, when used as a pointer into the decision
// matrix.
// int fix_color index( int color index )
// temporary Junction to map allowable color indexes to
// ones in which data
// has been filled in for in decision matrix
{ switch( color__index ) { case 0 return( ); case 1 return! ); case 2 return! >; case 3 return! ); case 4 return! )ι case 5 return! ); case 6 return! ); case 7 return! )> case 8 return! ); case 9 return! )ι case 10 retur ( 8 ); case 11 return! 8 ) case 12 return! 8 ) ι caso 13 return! 8 ); case 14 return! 8 ); default return! color_index ) ;
}
}
// ContDecF.C
// End ContDecF.C
// This code
// relates to digital input and output. The main portion is for
// bitwise communication with the PLC, control of the samplers, and
// reading of the position sensors in the system. In addition,
// there is software to read files on the local area network for
// communication with other computers that are measuring things
// associated with the gin system.
// DigitallOF.C
#inσludβ "cainc.h" // all includes #include "cadef.h" // all defines /include "caβxt.h" // #include "caproto.h' // prototypes of all functions
// DigitallOF.C
// This iβ declaration of a local function that is only available // within this section of code. // local use function void doio(byte, int);
// DigitallOF.C
// This is the code for getting one byte of data from the digital I/O // board. There are two boards each of them has three bytes of data, // the addresses are not contiguous and this code reads one of the // first six eight bit bytes of digital input data. byte i_get(byte pt) { switch (pt)
{ // if port case Ot return (byte)inp(0x310) ; break; case It return !byte)inp!θx311) ; break; case 2ι return !byte)inp!θx312); break; case 3t return !byte)inp!θx314) ; break; case 4: return !byte)inp!θx315) ; break; case 5t return (byte) inp!0x316) ; break; defaults return !byte) (OxFF) ;
}
} // DigitallOF.C
// This code allows the program to change one bit of the data at a // time. void o_set(bytθ mode, byte βw )
( if ((mode«0) || (mode—1)) doio(mode,βw) ; }
// DigitallOF.C
//This code alternately switches one bit between high and low and is // attached to a monostable multi-vibrator. If the code iβ operating // properly, it will reset this switch so that the monostable stays in // the computer OK state at all times. If the software in tho computer // for βomo reason stops operation, this switch will chango to error
// condition which can be sensed by other computers or components in // the system to determine that the computer has lost control of the // process. This is a safety feature. void CompOK(void) { static byte lt-0; if (It) {lt=0;doio(0,20);} else (lt-l;doio(l,20);}
} //
// DigitallOF.C
// This section keeps a record of each bit of the six bytes of digital
// output that are possible with the digital input and output
// hardware. It allows software to change one bit at a time, turning
// it either to one or zero and then output the resulting value to
// the appropriate port to implement the change. This code allows
// the other software to be relatively transparent to the
// actual hardware but functions to switch individual bits in a
// controlled manner. void doio(byte func, int value)
{ static byte psβt[6)={0xFF,OxFF,0xFF,0xFF,OxFF,0xFF}; // for func=l - turn switch on // for func-0 - turn switch off // switches numbered 1 .. 48 // output ports are 0, 1, 2, 3, 4, 5 int prt> byte a; prt = (value-l)/8; value - l«((value-l)%8); if (prt<0) prt«=0; if (prt>5) prt-5; a»pset[prt] ; // 1 -> switch off, 0 -> switch on if (func»l) // turn switch or switches on if func=-l
{ psettprt] &β -value; \ else if (func»0) // else turn switch or switches off
{ psβt[prt] |- value; } if (prt<3) outp(0x310+prt,pβet[ r ) ) ; else if (prt<6) outp(0x314+prt-3,pset[prt] ) ;
//
// DigitallOF.C
// code to make PLC seed cotton cleaner control untrue,
// to set the PLC seed cotton cleaner control to rsσc, and then
// to make PLC seed cotton cleaner control true
//
// This code is used to control the signal sent to the PLC determining
// tho request for seed cotton cleaning equipment. It can either,
// depending on the function passed to it, be set to untrue, meaning // the value is invalid and no change should be made or it can be set // for 0, 1, 2, or 3 seed cotton cleaners and then can be set to true // to indicate the proper data is available on the bits that signal // how many seed cotton cleaners should be used. void PLC_scc(int func)
{ switch ( func)
{
// set false case Oi doio(l,19); break;
// set two bits to control number of seec cotton cleaners case It
// on rβcc 2-uβe stick machine, 1-use impact cleaner switch (rscc) // rscc - recommended number of seed cotton cleaners { case 0s doio(l,30); doio(l,31); break; case 1: doio!θ,30); doio!l,31); break; case 2t doio!l,30); doio!θ,31); break; case 3s doio!θ,30); doio!θ,31); break; break;
// set true case 2 i doio(0,19); break;
} }
// // DigitallOF.C // code to make PLC lint cleaner control untrue, // to set the PLC lint cleaner control to rnlc, and then // to make PLC lint cleaner control true void PLC_lc(int func)
// This code iβ used to control the signal sent to the PLC determining
// the request for lint cleaning equipment. It can either, depending
// on the function passed to it, be set to untrue, meaning the value
// is invalid and no change should be made or it can be set for 0, 1,
II 2 , or 3 lint cleaners and then can be set to true to indicate the
// proper data is available on the bits that signal how many lint
// cleaners should be used.
{ switch ( unc ) {
// set false case Oi doio(l,19); break; // set two bits to control number of lint cleaners case It if (rnlcl-l) // rnlc - recommended number of lint cleaners
{ doio(0,17); doio(0,18); } // set both bits high // use. two unless specifically one lint cleaner else { doio(0,17); doio(l,18); } // set one bit high break; // set true case 2t doio(0,19); break;
)
//
// DigitallOF.C
// This code implements switches of the bits which control the sample
// flappers. It allows one command to open or close all the
// flappers or open and close individual flappers in the pattern that
// is used under normal operation of ginning. Additional code
// allows opening and closing of the extra sampler and allows closing
// individual flappers one at a time. void flapper(int nextch)
{ switch (nextch) { // extra sampler controlled at 32 case 3t o_βet(0,9); o_βet(0,12); o_set(0,25); break; // open 0, 1, 2
Figure imgf000182_0001
defaults o_set(0,9) ;o_set(0,12) ;o_set(0,25) ;
// open 0, 1, 2 >
}
// DigitallOF.C
// This section controls movement of the calibration flappers. It
// allows opening and closing of individual calibration flappers at
// all three stations. It includes special code for station two to
// switch moro than ono lino so that tho dual stroke valvo will bo
// properly used.
// void calflap( int setup )
// close and open the correct calibration flappers based on setup //
{ switch (setup) case 10s doio(0,10) ;break; // open calibration flapper 1 case 20s doio(l,13); doio(0,14); doio(0,15); doio(l,16); delay(100) ;doio(0,13) ; break; // calibration
//flapper 2 to no tile // extend long, retract short case 30: doio(0,26); break; // open calibration flapper 3 case lit doio!l,10); break; // close calibration flapperl case 21s doio!θ,13); doio(0,14); doio{0,15); doio(0,16); break; // no use of this for 2 case 31s doio(l,26); break; // close calibration flapper 3 case 12s doio(0,ll); break; // calibration flapper 1 to color case 22s doio(0,13); doio(l,14) doio(0,15); doio(0,16); delay(lOO) ;doio(0,14) ; break; // calibration flapper 2 to color case 32s doio(0,27); break; // calibration flapper 3 to color case 13s doio(l,ll); break; // calibration flapper 1 to trash case 23s doio!l,13); doio(0,14); doio(l,15); doio(0,16); delay( 100) ;doio( 0,13); break; // calibration flapper to trash case 33 t doio(l,27); break; // calibration flapper to trash defaults break;
} } // end calflap
// // DigitallOF.C
// This code checks for a new tag message. This tag message is created II by & computer that reads the bar code tag that has been attached to // the bale. The message contains the bale weight. // If a new tag message is
// available it first renames the file, then reads, and then erases // the file on the network. The data iβ then used by the program, void chk tagmsg (void ) { int f;
FILE *fptr; int renval; renval»rename Cgι \\data002\\tag.msgV*gι \\data002\\yyy.msg" ) ; if (renval— 0 )
{ // file exists fptr « fopen( "gt\\data002\\yyy.msg" , "r" ) ; // read the data for (i=0; i<60; i++) fscanf ( fptr, "%α" ,fitag_msg[ i ] ) ; tag_msg[60 )«0x00j // null - end of string
a he at the
Figure imgf000184_0001
n // added so that extraneous bales are not counted. void chk_bc( void ) { static int l_bc-0; static time_t l_bctime; static bcβtαte ~ 0; int c_bc; timβ__t c bctime;
FILE *fptr; long int locbn, dif; int lwt; int renval; int i, j, ns, tmp; float sum; renval«rename("gt\.\data002\\bale.msg","gs\\data002\\xxx.msg"); if (renvalβ-0) fptr - fopen("gt\\data002\\xxx.msg","r");
// read the data f scanf (fptr, " %ld %d" ,&locbn, &lwt) ; fσlose!fptr) ;
// erase the file remove( Mgt\\dαta002\\xxx.msg" ) ;
Figure imgf000184_0002
rSJ_dat[ 12]=(SJ_dat[ 12 ]-2047)*20.0/4095.0*1.44+0.0; bdat[0] .b =!int) (rSJ_dat[ 12]*10.0+0.5) ; //save data to permanent data balm_dsk_save ( ) ;
;
Figure imgf000185_0001
time(&c_bctime) ; it 6 - D7 / / / / / C i {
Figure imgf000185_0002
else
{ // 0 if (difftime(c_bctime, l_bctime)>2) { bcstate = 1; inc_bn(2); if (lbn++>4) lbn=4; return;
} else return;
} else // bcstate »» 1
Figure imgf000186_0001
// read the bale moisture meter return;
} else return;
} else
{ l_bc-l; // 1 0 1 l_bctime-c_bctime; } } pi a Q
{ if (c_bc—0) // 1 1 0
{ l_bc-0; l_bctime«c_bctime; return; else return; // 1 1 1
} >
// DigitallOF.C
// This code reads the current number of lint cleaners for each of the // gin stands and the number of seed cotton cleaners being used aβ // transmitted to the control computer by the PLC. void ohk leu(void) // need to revise // looks OK
Figure imgf000186_0002
Figure imgf000187_0001
int wait_samp_open ((iinιt fl)
{ time_t inittime, c<time;, byte fladd[4] - { 16, 32, 2, 1 }; // bit for flapper open input byte flprt[4) = { 2, 4, 5, 2 }; // port for flapper input int dtf l = - {/ R8,. ft8,. 10, 8 }; // max wait for flapper to open, seconds byte flnopen; int done; int ret; done-0; time( &inittime) ;
;
Figure imgf000187_0002
olse rot-0; // low bit is signal that sample not open
if (done1-0) ret+-128; // Fl pressed return(ret) ;
}
// end wait_samp_open
// DigitallOF.C
// This code waits for a calibration paddle to close as measured by // the proximity switches. It operates just as the previous procedure. int wait_cal closed(int fl) { time_t inTttime, ctime; byte fladd[4] - {128,128, 4, 1 }; // bit for flapper open input byte flprt[4] - { 2, 4, 5, 2 ); // port for flapper input int dt[4] = { 8, 8, 10, 8 }; // max wait for flapper to open, seconds byte flnopen; int done; int ret; done=0; time( &inittime) ; if <fl«l) return(O); // temporary, no sensors at sta 2 do
{ chk_bc( ) ; time(&ctime) ; flnopen - (byte) (-(byte)i_get(flprt[ fl] ) & fladd[fl]); done»do_freq( ) ; while ( (ctime-inittime<dt[fl)) && (flnopen ) && (done l-l) ) ; delay(100); // wait another 0.1 second if (flnopen ) ret-8; else ret«=0; // low bit is signal that sample not open if (donel-0) ret+-128; // Fl pressed return(ret) ;
// end wait_cαl closed
// -..„—T— DigitallOF.C
// This code waits for calibration flapper to open as determined by // the proximity switches attached to the calibration flapper. It // operates in the same manner as the wait_samp_open procedure. int wαit_cαl open(int fl) { time t inTttime, ctime;
// "
// byte fladd[4] «= { 64, // bit for flapper open input byte flprt[4] - { 2, // port for flapper input int dt[4] - { 8,
Figure imgf000188_0001
// max wait for flapper to open, seconds byte flnopen; int done; int rot;
Figure imgf000189_0001
dif
Figure imgf000189_0002
fread(od,sizeof(od[0] ) ,8,kpdat) ; // data not needed fread(od,sizeof!od[0] ) ,5,kpdat) ; // data not needed fread!tag_msg,sizeof(char) ,60,kpdat); // needed
} if (kpdat 1- NULL) fclose( pdat) ;
// DigitallOF.C
//
// This code displays information on the operation of the machinery, // the control decisions, how the decisions are reached, the data, and // the bale averages for the past 10 bales on the screen in the gin.
//
// DisplayF.c
//
/include "cainc.h" // all includes
/include "cadef.h" // all defines
/include "caext.h" //
/include "caproto.h" // prototypes of all functions
//
// DisplayF.c void display_message( message ) char message[ ] ;
{ int i; static int nrow=24, ncol=0; _settextposition(nrow,ncol) ; for (i=0; ( (i<40)&&(message[i] 1=0x00) ) ;i++)
{ printf{ "%c" ,message[i]);
} if (ncoll-0) {nσol-0; nrow++;} else ncol-40; if !nrow>25) nrow=24;
} //
// DisplayF.c
// displays error message in the error message area // keeps error messages n order, does not write // outside message area, 30 char. Message ending in 0x00 // void display_error( error_message ) char error message! ];
{ int i; static int nrow-13; return; // testing
//
// DisplayF.c
//
// Prints the display headings , only, on the computer screen. void print_diβplay_heading3 ( void )
_βetbkcolor ( 0 ) ; "βettextcolor ( 3 ) ;
_sottoxtposition( l f 1 ) ; printf C Fl»Main Menu; F2=Bale N. vs . " ,
" Data- F4=BA/Cal"); _settextposition( 2 , 7 ) ; printf(" Color %% Area Moisture "); _settextposition(3,35); printf("Seed Cot."); _βettextposition!4,35); printf("Before LC"); _settextposition(5,35); printf("After LC" ) ;
> //
// — — DisplayF.c
// Displays color, trash, moisture contents, current decisions,
// current operating conditions (how many lint cleaners operating,
// etc.
// void showCT( int camera ) // camera — 0, 1, 2
{ int RBln /*, i*/ , cnlc; long dt; char string[80]; time t ltime, oldtime; doubϊe dtcall, dtcal2, msb; βhowCalBa(); // every time βhowCT is called if (camera—1)
{
_ββtbkcolo {0 ) ;
_clearscreen(_GCLEARSCREEN) ; print display headings ( ) ; showcτ(θ); /7 recursive, keep #0 data on screen longer showCT(2); // recursive, keep /2 data on screen longer
_settextcolor(7); // for all three displays switch (camera)
{ case Ot RBln-3;_setbkcolor(l);break; case It RBln«4;_setbkcolor!5);break; case 21 RBln*5;"~setbkcolor!4 ) ;break;
> settextposition(RBln,45) s"printf(string," %3d %4.1f \0x00" lαβt_reαd[camera] .rd,last_read[camera] .pb, last_read[camera] .cc, last_read[camera] .areapc) ; _outtβxt(string) ; _settextposition!RBln,61) ; sprintf(string," %5.1f %\0x00" , last_read[camera] . ) ; _outtext( strin ) ; _βetbkcolor( 0 ) ;_settextcolor(3 ) ; _βettextpositlon{9,2) ;_outtext!tag_msg) ; _8θttextposition!l0,8) ; time/iltime) ; oldtime - ccαltime[l];
if(tcaltime[l]<oldtime) oldtime = tcaltime[l]; dtcall-(ltime-oldtime) /3600.0; oldtime = ccaltime[2]; if(tcaltime[2]<oldtime) oldtime - tcaltime[2]; dtcal2=(ltime-oldtime) /3600.0 ; sprintf!string," hours since calibration %5.1f sta.2 %5.1f sta.3 \0x00", dtcall,dtcαl2);
_outtext( string) ;
" ,camβra+l ,cnlc) ; " ,camera+l,cnlσ) ;
Figure imgf000193_0001
break; case 1 :
_setbkcolor(4); // It blue _outtext{ "Working on Ch 3"); break; case 2t // was case 2t
_setbkcolor(l) ; // red _outtext("Working on Ch 1"); break;
_setbkcolor(0) ; // black _settextcolor(3) ; settextposition(9,30) ;
// DisplayF.c
//
// Displays data on the last 10 bales on the screen.
//
// void showBA( void )
{ int i; char st[30] ;
Figure imgf000194_0001
sprintf(st, " %2d %ld \0x00", ba[l][i].color, ba[ 1 ) [i] .leaf) ; _outtext(βt) ; _setbkcolor( ) ; settextcolor( 7 ) ; sprintf(st," %2d %ld \0x00", ba[2][i]-color,ba[2][i].leaf); _outtex (s ) ; _setbkcolor(0) ; settextcolo ( 3 ) ; sprintf(st," %4.1f %4.1f %4.1f ", ba[l] [i] .me, ba[2] [i] .mc, bdat_rate[i] ) ; _outtext(st) ;
} } else showCalBa();
}
// DisplayF.c
// Displays calibration and other data in the same area where the bale
// average data is normally displayed.
//
// void showCalBα( void )
{ int i, j; char st[80]; if (sbas=0) showBAOr else
{
_setbkcolo (5 ) ; _settextcolor(0) ; _εettextposition( 11,22); _outtext ( " Calibration and Temperature Data
");
_settβxtcolor(7 ) ;
_settextposition(12,22) ; . sprintf(st," %7.3f %7.3f %7.3f *7.3f \ inty[l], slpy[l], intz[l], slpz[l]); outtext(st) ; for ( j=0; j<3; j++)
{
1-0;
{
_BQttextposition( 13+j*2+i , 22 ) ; sprint (st, "%10.2f %10.2f %10.2f II / ctile[i][i].rd,ctile[i][j].pb,ctilβ[i][ ].areapc)
_outtext(BX);
) ;
Figure imgf000196_0001
// This is the main part of the program, where the processing starts.
// The first external file that is included
// in this file is "cainc.h", this file has all the included extra
// files most of which are part of the Microsoft "C" package. The next
// included file is "cadef.h" which has most of the defines of
// variables with defined values. Most of them are related to the
// color software but a few of them are related to the trash software.
// There are defines elsewhere also. The next statement defines this
// piece of code, "Lcadvl.C" as the main section which is used by the
// "c" compiler in the following piece of code "caext.h" which is the
// declaration of the global variables. This program uses many global
// variables through which most of the data is passed.
// The final include in this program is "caproto.h" which
// is a prototype of all functions that are used and has a list of
// included files. There is one *.h" file for each of the "C"
// source code files.
//
// LCADVl.C
/include "cainc.h" // all includes /include "cadef.h" // all defines /define MAIN_SECTION // this is the main section /include "caext.h" II /include "caproto.h" II prototypes of all functions
// LCADVl.C
// The processing starts and ends in this section. It records the
// current values of the computer screen setup, runs a setup
// procedure, runs the open menu procedure, and when the program
// returns from open menu, puts the screen back into the mode it was
// in when the program was called and exits the program. void main(void)
{ long oldbgd; short oldfgd; oldfgd - _gettextcolor( ) ; oldbgd - _getbkcolor( ) ; error-0 ; βetvideomode(_TEXTC80) ; _setbkcolor(0 ) ; βettextcolor(3) ;
openmenu( ) ; k _f _write ( ) ; // write the keep data file σleαrβcreen(__GCLEARSCREEN) ; βotvidoomodoT^DEFAULTMODE) ;
setbkcolor(oldbgd) ; settextcolor(oldfgd) ; } // end main
// LCADVl.C
// The sections of "o_set" are setting up output control lines
// to be either high or low depending on which is safest for the gin.
// Files and variables are set to initial conditions, O's and l's.
// void setup(void)
{ int fo=0, fr-0, i, j; time_t ltime; done -0; // not ready to exit yet if (read_tcal() 1=0) error=l;
// setup CIO_DI024 in CI0-DAS16/F Low 24 bits of PIA
// 1-8 Input, 9-16 output, 17-20 output, 21-24 input outp(0x313,0x98) ;
// setup CIO-DI024 High 24 bits of PIA
// 1-8 Output, 9-16 Input, 17-20 Input, 21-24 Input outp(0x317 ,0x8B) ;
// set all outputs to low o_set(0, 9); o set(0,10); o_set!θ,ll); o~set!θ,12) o_set(0,13); o_βet!θ,14); o_set!θ,15) o_set!l,16) ; o_set!l,17); o_set!l,18) o_set!θ,19); o_set!θ,20) o_βet!θ,25); o_set!θ,26) o_set!θ,27); o_set!θ,28) o_set(0,29) ; o_set!θ,30); o_βet!θ,31) o_set!θ,32);
PLC_lc(0); // set pic control to untrue _clearβcreen(_GCLEARSCREEN) ;
;}
Figure imgf000198_0001
tag_msg[0]=' ' ;tag_msg[l)='T' ;tag_msg[2]-'a' ; tag_msg[3]= 'g* ;tag_msg[4 ]= ' . ' ;tag_msg[5)='m' ; tag_msg[6]-*s' ;tag_msg[7]-*g* ;tag_msg[8]-' ' ; tag_msg[60]=0x00;
Figure imgf000199_0001
// If thoy press a 3, tho program outputs a vary ng βor os of b te to
// the output data lines so that they can be checked. If they press a // 5, the code to calibrate station 1 is entered, if they press a 6, // the code to calibrate station 2 is entered, and if they press a 7, // the code to calibrate station 3 is entered. If they press an b, // autocal for station 3 is switched on or off and the setting is // displayed on the menu. If they press a 9, station 3 is calibrated // by using autocal. If they press a small letter "a", station 1 is // calibrated for trash; "b" , station 2 iβ calibrated for trash; "c", // station 3 iβ calibrated for trash; "d", seed cotton cleaner // selection is changed. The bits that are passed to the PLC which // does the actual seed cotton switching so that those bits can be // debugged. If they press α "e", the values from the analog converter // are displayed so the analog inputs could be checked. If they press // " f , a measurement of color and trash iβ immediately obtained from // one of the stations and displayed on the screen. If they press "g", // the system requests the PLC to switch to one lint cleaner. If they // press "h" , the system requests that the PLC switch to two lint // cleaners. If they press an "I", all the sample flappers are // switched between open and closed with repeated pressings. If they // press "j", the system will cycle the calibration tiles for stations // 2 and 3, between open, color, open, trash. Pressing a "k" causes // the tag message to be checked. The tag message is a message the // computer at the bale press which reads the bar coded tag of the // bale sends to this controlling program over the network. If they // press a "1", the samplers cycle between station 1, station 2, and // station 3 as they normally would during a data collection phase. // When they press "m" , the extra sampler which is used for infrared // moisture measurements behind the gin stand is alternately opened // and closed. If they press "x" or a "X", the program will exit // to the operating system. void openmen (void)
{ int cx,cc-0; int io_ctr«l, ia, ib, i, sum, j, tmp, ii-O, ij=0; double volt; unsigned short PortX-O, Stat; unsigned char cl; static int recce, flcy, efl, mice; time_t ltime; // temp menulOs clearβcreen( GCLEARSCKEEN) ; time ( 6ltime)""
_βettextpoβition(24, 2) ; rintf ("%81d " , ltime);
_βettextpoβition( 4 ,26) ;printf CM A I N M E N U");
_ββttextposition( 6,26);print ("0. Self Calibrate Station 2 Now" ) > βettextposi ion( 7,26) ; rintf("1. Run Color/Trash CalcuTαtionβ" ) ;
_βottoxtpoβition ( 8,26);printf ("2. Ro d Digital Inputs");
"); "); "); Now" "); "); "); menu
Figure imgf000201_0001
; }
Figure imgf000202_0002
Figure imgf000202_0001
delay(200); camera — cc; getdata( ) ;
_settextposition(1 ,1 ) ; printfC for camera *2d area=%5.1f percent area= 5.2f
Figure imgf000203_0001
T/US97/13553
{ // cycle calibration flappers if (ij—0) { calflap(20); calflap(30); // open color calflap(32);
_8βttextposition(3,9); printf(" cal. fl. open color 0"); } if (ij—1) { calflap(23); cαlflαp(31); // close trash calflap!33);
_βettextposition(3,9); printf(" cαl. fl. closed tr sh 1");
} if (ij—2)
{ calflap(30); // open trash cal lap(33);
_βettextposition(3,9) ; printf(" cal. fl. open trash 2");
} if (ij—3)
{ calflap(22); cαlflαp(31); // close color calflap(32);
_βettextpoβition(3,9); printf(" cαl. fl. closed color 3");
} if (++ij>3) ij-0; goto menu20;
} if(ex —'k') { chk_tαgmsg(); goto menu20; } if(ex =='1' )
{ if (flcy>2) flcy«0; if (flcy<0) flcy=0; flapper(fley) ; flcy++; goto menu20;
Lf( («ex --'m') // toggle extra sampler open/closed
{ if (βfll-0) { efl-0;flαpper(β);} // close else {e l=l; flapper(9);) //open goto menu20;
} if (ex — 'f)
{ _βettext osition( 22 , 1 ) ; printf("%101d %101d %101d", ccaltime[0) ,ccaltime[ 1 ] ,ccaltime[2 ] ) ; printfC%101d %101d %101d", tcaltime[ 0] ,tcaltime[l] ,tcaltime[2 ] ) ; goto menu20;
) if (ex BB ' X ' ) return; if (ex — 'X ' ) return;
//missed j printf ( "\a" ) ;
goto menulO; // bell } // end openmenu //
// This is the main procedure for data collection and control. This // procedure starts by clearing the screen and initializing α few of // the variables and then cycles continuously until a function key is // pressed to exit this cycling software. It sets up the frame grabber // which is used in the trash measurement, checks for the function key // being pressed, and then measures some of the analog inputs not // related to color or trash. It checks the last moisture readings and // if they are within α reasonable range, leaves them unchanged, if // they are not within a reasonable range, it sets them to values // which are obviously extreme and so that the other software can // detect that they were incorrect readings. It then starts with // camera one, sets the flappers to collect α sample of flapper one, // adds the most recent readings from station three to the running // total so that the averages can be calculated, checks for a message // from the computer at the bale press, computes some of the factors // needed for automated control, and then does a wait closure one. The // wait closure waits for α certain period of time or for closure of // the sample flapper whichever comes first. There is nothing in this // program that waits infinitely long, every procedure exits in a // relatively short period of time so that if something malfunctions // the rest of the program will .continue to function. Once the flapper // has closed or has timed out, "getdata" collects the data for // station one. Similar procedures are repeated for station two and // then for station three. Every other cycle through this code, the // sampler behind the gin stand which collects samples for infrared // moisture readings is opened for a short time and then closed again. // Just before it is opened, a reading of the moisture content from // the infrared meter is taken and recorded. Next, the recommended // number of lint cleaners based on the readings of station two are // calculated and the recommended number of lint cleaners based on the // readings of station three are calculated. Also, the recommended // seed cotton cleaner settings are calculated. In all of these // calculations -in this code, the recommendations are based on // measured rd, measure +b, the measured percent area of trash, but 5% // moisture content is used. When adequate measures of moisture // content are available, the actual moisture content will be used in // these function. The next portion of code basically counts up and // down within rather narrow limits and when it reaches the upper // limit it uses two lint cleaners and when it reaches the lower one, // it uses one lint cleaner. This approach provides a hyβterβis into // the decisions so that the change from one to two lint cleaners is // never made immediately based on one set of readings and the amount // of hystereis can easily be changed in the software. There are two // counters, one for the decision at station 2 and one for the // decision at station 3. The counter for station 2 is run only if gin // stand 2 is "in" because otherwise there was no cotton for a valid // reading. If the decision based on the two totals agrees it is uβod. //
// If station 3 calls for 1 lint cleaner, only one is
// used. This section of code checks the time of day and if it is just
// past midnight, it switches to a new file. It keeps track of the
// next time for autocalibration and if autocalibration is turned on
// and it is time for a new autocalibration, it calls the autocal
// function. Finally, it goes back to the beginning of this procedure
// and repeats again.
// void getdata2(void)
{ int done, nlcn»0, nlcnl, nlcn2; static int ntb=4, nt3=4; static int phour; time^t ctime; βtruc"t doβdate_t ddate; struct doatime_t dtime; unsigned char cday; unsigned char cmo; unsigned int cyr; cday-0; cmo"0; cyr»0; cloarscreen(_GCLEARSCREEN) ; Hone=0; color_init( ) ; if (read_tcαl( ) 1-0 ) error-1 ; runscreen( ) ; flapper(8); // close SJ sampler _dos_gettimβ(fidti e) ; phour=dtime.hour;
// don't do autocalibration of station 3 immediately regetdatat
Figure imgf000206_0001
nc_bt(0); // add observed values to bale totals
Figure imgf000207_0001
nlcnl = lc_lookup( (int)last_read[l] .rd, last_read[ 1 ] . b, 5.0, // l_reαd__dαtα[1 } . f e lαst_reαd[l ] .αreαpc) ; rscc =scc_lookup( (int)last_readlOJ .rd, last_read[0) .pb, 5.0, // l_read__dαta[1) . f σ last_read[θ .areape) ; // correct for conditions at lint flue nlcn2 = lc__check(last__readt2) .cc,last_read[2) .areαpσ) ;
Figure imgf000207_0002
Figure imgf000208_0001
delay(200);
} // end getdatα2
//
// This section initializes the most recent measurements of
// color trash.
// void runscreen(void)
{ int i;
/* zero the readin array */
Figure imgf000209_0001
// LCADVl.C
// This procedure controls the actual color and trash data collection.
// There are three sets of code based on the camera count with camera
// counts being 0 1, and 2. It first sets up the frame grabber
// channel by switching the multiplexer between the three channels. It
// con switch up to eight channels with the current hardware. Next, it
// does a trash and color measurement, checks the measurements and if
// the readings are within a reasonable range it leaves them
// unchanged. Otherwise, it changes the readings to extreme values so
// that the other parts of the code can detect that the reading iβ
// incorrect.
// void getdata(void) int i-=0; int α_βtatus[4];
CompOK() ; setup_trash(camera) ; last_read[camera] .tok-0; switch (camera)
{ // wait a little and get traβh case O t delay( 400 ) ; do_a_frame ( camera ) ; break; case I t delay(400) ; do_a_frame ( camera ) ; break; case 2 ι delay( 400 ) ; do_a~frame ( camera ) ; break;
} colr= 0 ; c_status[i]= 1; c_βtatus[i]- colrmgr(camera) ; if ( last_read[camera] .pb<( float)4.0) las _rea [camera] .pb=(floa )0.1 ; if (last read[camera] .pb>( float) 17.0) last_rea3[cameraJ .pb-(float)99.9; if (last_read[camera].rd<(float) 45.0) last_read[camera] .rd=(float) 0.1; if (last_reαd[camera] ,rd>(float)86.0) last_read(camera] .rd=(float)99.9; if (last_read[camera] ,area<(float) 1.0) { last_read[camera] .area-(float)1.0; last_read[earnera] .tok—1;
} if ( last_read[camera].αreα (float)9999.0) last read[camera].areα=(float)9999.0; if (Tast__read[camera] .count<(float)1.0) { last_read[camera] .count*(float) 1.0; last_read(camera] .tok-1;
} if (last_read[camera].count>(float)999.0) ( last_read[camera] ,count-(float)999.0; last_read(camera] ,tok=l;
} if (last_read[camera) .leaf<(float)1.0) last_read[camera] .leaf=(float) 1.0 ; if ( laet_read[camera] .leaf>( float)9.9 ) last_read[camera) . leaf-(float)9.9; if (last read[camera].cc>88) last_read[camera] .cc= 99; if (last~~read[camera].cc<10) last~read(camera] .cc= 1? last__read~[camera] .ctsn-sample^no; last""read[camera] .cmpg-2 j if (last_reαd[cam ra].cmpg>88) last_read[camera) .cmpg-999; if ( lasthread[camera] .cmpg<10) last_read[camer ] .cmpg» 1; last_read[camera] . b-(float)0.0; } // end getdata
// LCADV.C
// This section of code runs automatic calibrations at
// station two or three. The code is divided into two
// large sections, one dealing with one type of calibration
// reference tile presentation and the other dealing with
// the other kind of tile presentation. The procedure
// begins by opening and closing the calibration tile
// flappers a few times because dust tends to settle
// on the calibration tiles especially at station two when the
// calibrator iβ not being used. Moving them while ginning
// removes most of the dust. When calibration is finished the flappers
// aro opened and closed quickly several times to help dislodge any // cotton that may have been caught on the flappers,
// void autocal(int sta)
// station 1, 2
Figure imgf000211_0001
flapper position 0, 1 and rep. t me_t ct mer for (i-0;i<6;i++)
{ ctile[i][βta].rd - 0.0; ctile[i][sta] .pb = 0.0; ctile[i][sta] .y = 0.0; ctile[i][sta) ,z s 0.0; ctile[i)[sta].areapc = 0.0;
} stao = sta*10+10; outp(DT2859,sta) ; // switch to Video input calibrating cf_ok[βta)-0; // set all bits low flapper(99); // open the sample flappers jnk = start fg(); // reset frame grabber
// divided Into two separate secions for station 1 and station 2 if (sta«l)
{ delay(200); // to allow time for cotton sampler to open // "jiggle" the flappers here, try to clear off dust for (i=0;i<3ji++) { _βettβxtposition(24,l); printf("Cαl. sta%ld stp %2d clear ",βtα+l,i); // trash position calflap(23)> delay(100), flαpper(l+stαo); delay(500); delay(500); dβlay(SOO); flapper(99); delay(400); delay(400); // color position calflap{22); delay(100); flapper(l+stao); delay(SOO); delay(500); delay(500); flapper(99); delay(400); delay(400);
// open position cal lap(20); delay(lOO); flapper{l+stao) ; delay(500); dela (500);
Figure imgf000212_0001
Figure imgf000213_0001
;
Figure imgf000214_0001
do a_frαme(cαm) ; do the tr s measuremen
ctile[cf os ] [cam] .areape » last_read[cam] .areape;
} flapper(99) ; // open all sample flappers outp(DT2859,sta) ; // switch to Video input "sta* delay(500); delay(500); delay(500);
// time to open 1 sec. too little calflap(30);
// open calibration flapper delay(500);
} // for all positions
// open calibration flappers calflap(30) ; delay(800 ) ; { calflap(32) ;
// be sure flappers are in color position
} delay(500); // wait a little
// check that cal flapper is in open position
// jiggle the flappers here calflap(stao+0) ; // start open calflap(βtao+2); // start color delay(500); calflap(8tao+l ) ; // close calflap(βtao+3); // trash delay(100); calflap(stao+0); // open calflap(stao+3) ; // trash delay(500); calflap(βtao+l) ; // close calflap(stao+2) ; // color delay(100); calflap(stao+0) j // open calflαp(stαo+2) ; // color delay(500); cαlflap(βtao+l) j // close calfla (βtao+3 ) ; // trash delay(100); calflap(stao+0) ; // open calflap(stao+3) ; // trash delay(SOO); calflap(βtao+2) ; // end color calflap(stao+0 \ ; // end open
// end autocal station -
// restore the regular readings last_read[cam] .rd rdkp[cam]; last_read[cam) .pb 3 pbkp[cam] ; last_read[cam] .cc = cckp[camj laβt~rcad[cam] .area areakp[cam] ; lasthread[cam] .areape arpckp[cam]; laβt_read[cam] .count countkp[cam] ;
last_read[cam] .leaf - leafkp[cam]; time(&ctime) ; cctime[sta]=ctime+3600;
// eetime is next time to check calc_ctmean(βta) ; dsk_save_cal_tile( sta ); // save readings to file // record the calibration check data to disk rec_ctile(st ) ; if (++sample_no>9999) βample_no=0;
// show missing sample no's due to calibration _βettextposition(24,l); printf("Cal sta %ld done ",βta+l); } // end autocal //
// LCADV.C
// This procedure waits for a predetermined period of time for an
// individual flapper to close. At the beginning of the procedure the
// location of the bit signaling whether the flapper is closed or not
// is entered as well as how many seconds the maximum wait for the
// closure is to be. The code checks whether the flapper is closed and
// also calls another procedure to do some items that need to be done
// frequently during running, checks to see if the maximum time for
// that flapper is exceeded and if either the flapper is closed or the
// maximum time has exceeded the procedure returns to the calling
// program. It passes back a flag telling whether the flapper was
// indeed closed.
// int wait_closure(int fl)
( time_t inittime, ctime; byte fladd[4] - { 16, 16, 1, 2 }; // bit for flapper input byte flprt[4] - { 2, 4, 5, 2 }j
// port for flapper input int dt[4] - { 3, 4, 4, 6 };
// max. wait for flapper to close, seconds // should be at least as great as min wait byte fInclosed; int done; done-0 ; flnclosed-1; time(&inittime); do
{ time ( &ctime) ; f Inclosed - (byte ) (-(byte) i_get( flprt[ fl ] ) & fladd [ fl ] ) ; done=«do_f req( ) ; while ((ctimβ-inittime<dt[fl]) && (fInclosed) 6& (doneJ=>1 ) ) ; do
{ // wait a minimum of ?? seconds timo(&ctime) ; dono β do__froq();
} while ( (ctime-inittime<l) && (donel-1)); last_read[f1] .flok = flnclosed ; delay(100); // wait another 1.0 seconds after closure indicated delay(100); // wait return (done);
} // end wait closure
//
// LCADVl.C
// This piece of code is several different things that are to be done // relatively frequently during the running of the program. It reads // the clock, prints the current date and time at the top of the // screen, and checks for an entering of an "F" key at the keyboard. // It will respond to several different "F" keys. The most important // of which or the most common would be Fl which indicates that the // operator wishes to exit the data collection portion of the program. int do_freq(void) { int done=0; int ex; struct dosdate_t date; struct dostime_t clock;
_dos_getd te(&date) ;
_dos_gettime(£clock) ;
_settextposition(1 ,1 ) j printf("%2.2u/%2.2u ",date.month, date.day); printf("%2.2u:%2.2u«%2.2u",clock.hour, clock.minute, clock.second) ; chk_bc( ); if (kbhit()) cx= getch(); else cx=32; if (cx—0) // two byte key
{ cx= getch( ) ; if (ox*=59) done9=l; done=l; // Fl if (ex—60) lbn—; // F2 if (cx«62) { if (sba==0) sba«=l; else sba=0; // F4 showCalBa( ) ;
) if (cx«=63) autoeal(l); // F5 if (ex—64) autocal(2); // F6
) CompOK( ) ; return(done) ; ) //
// LCADVl.C
// This procedure does not do anything, void βample_cτ(int fl)
}
Figure imgf000218_0001
// LCADV.C
// This procedure is used to increment the count of a particular
// channel between bale press changes. The totals of observations and
// numbers of observations are kept of variables including Rd and +b
// so that they αan be averaged when the bale is finished and other
// data iβ kept on color code so that the mode can be calculated of
// the color because color codes can not be averaged.
// void inc_bt(int ch)
{ int i,~ccf, ccs;
Figure imgf000218_0002
Figure imgf000219_0001
void calc bafvoid)
( int T, j, k, ccpf, ccps/*, cc*/; int ctn; struct dostime_t dti e; double dt;
// delta time for rate calculation int dtp; // pointer to data for dt // calculate the means and mode values for disk storage
_dos_gettime(£dtime); // time of bale change
// save the old values for ba matrix for (j=39;j>0;j~) { ba[0][j] * ba[0][j-l); ba[l][j) - ba[l)[j-l]; ba[2][j] - ba(2][j-l); ba[0][0).rd - 0.0; ba(0][0].pb = O.Oj ba[0][0].y = O.Oj
] ;
jj;
Figure imgf000220_0001
lee
Figure imgf000220_0002
balo_m_bn - 0 ; // chaged from bale_tot_bn ; not used now // balo numbers come from""tho scalo lator RKB
[k] )
];
Figure imgf000221_0001
// get new entries for (i=0;i<3;i++)
{ bale_av__net[i] [0] = bale_m_nct[i] ; bale_av~no[i] [ 0 ] « bale_m_no[ i] ; bale_av_lcu r i ] 10 ] - bαle_m_lcu[i] ; bαle_αv__co [ i ] [ 0 ] = bαle_m_cc [ i ) ; bale~av] > ιrβaiiπ0] e baTe_m_pa[i] ; bαle_αv_mc[ i ] [ 0 ] - bαlβ_m_mc[i] ; ba[ij[0] .color « bale_m_cc[i] ; ba[i)[0]. reape - bale~m_pa.[i); ba[ij[0].mc - bale_m_mc[i]; ba[i] [0] .leaf = parea__to_clgr(bale_m_pa[i] ) ; ba[0][0].omσ - rSJ_dαt[10]; // Sam Jackson Big J mc ba[l][0].omc β rSJ_dat[ll]; // NIR mc ba[2][0].omo ■ rSJ~dat[12]; // microwave mc balo_av_lcu[3][0] - bale m_lcu[3]; bale_av[0].fce β bale m.fco ; bale_av[0].ftcd = bale~m.ftcd; bale__a [ 0 ] . fmc - bale_m. £mσ ; balo_av_bn[0] β 0; balo_av~wt[0] - 0;
Figure imgf000222_0001
menu30 i
( βettQXtposition(23,40);print ("Bale #...7 ");
Tf(bale_n >0) bx- bale_n; else bx- 0;
_βettextposition(23,46);ρrintf (" %71d ",balβ_n); menu40ι hx- gβtch(); // get α digit if(hx «KEY_ESC) return; // they changed thoir minds
if(hx —OxOd) goto menu60; // 'enter', they're thru if(hx =-0) goto menu30; // start over if(hx ==0x08) // backspace, delete the last digit bx- bx/10; // subtract it
_settextposition(23,46);printf(" %71d ",bx); goto menu40; hx= hx-48; // make it 0-9 if(hx <0) goto menυ50; // not a number if(hx >9) goto menu50; if( ((bx*10)+hx) >99999999)
{ printf("\07"); // bell goto menu30; bx- (bx*10) +hx; // add it in _settextposi ion(23,46); printf(" % 1d ",bx); goto menu40; menuSOt printf("\07"); // beep if(bx >0)
{ _settextposition(23,46);printf(" %71d ",bx);
} else ( _settextposition(23,46);printf(" %71d ",bale_n);
} goto menu40; menuβO i if (bx i-0 ) bale_n- bx; else bale_n= -1 ; sample_no= -1 ; } // end getbalen // // LCADVl .C
// This code logs data to the hard disk and to the LAN. It also opens
// the files under unique names based on the date and the files which
// have already been opened on that date.
// Most of the procedures determine if a file is
// available on the LAN as well as on the hard disk of the control
// computer, if they are, the data iβ written to both locations.
// LogDataF.C
#include "cainc.h" // all includes
#include "cadef.h" // all defines
#include "caext.h" //
#include "caproto.h" // prototypes of all functions
// LogDataF.C
// save the mean/mode data to the average data file
// void dsk_save_av( void )
{ struct dosdate_t date; struct do8time_t time; int i, n=0 ; double lcus=0.0, lcum; if(dsk_dat_flg >0)
{ ctdat2 = fopen(sumfilename, "at" ) ; if (ctdat2 1- NULL)
{
_dos_getdate(&date) ; _dos_gettime(&tune) ; fprintf(ctdat2,"M%2u %2u %2u", date.month, date.day, date.year); fprintf(ctdat2, "%2u %2u %2u", time.hour, time.minute, time.second) ; fprintf(σtdat2," %71d",bale_m_bn) ; for (i-0;i<3;i++)
{ fprintf ( ctdat2 , " %ld %4 . 1f %4 . 1f %2d %4 . 0f
%4.0f %4 .1f %4.1f" , i , bale_m_rd [ i ] , bale_m_pb[i] , bale_m_cc[i] , bale_m_a[i] , bale_m_c[i] , bale_m_pa[i ] , bale m_mσ[i] ) ;
> fo
Figure imgf000224_0001
if (n>0) lcum = lcus/n; else lcum=0.0; fprintf (ctdat2," %3.1f" ,lcum) ; for (i=0; i<3; i++) if ( (bale_m_nct[i]<9999) && (bale_m_no[i]<9999) ) fprintf(ctdat2 ," %4d%4d" ,bale_m_nct [i] ,bale_m_no[i] ) ; else fprintf(ctdat2," %4d%4d" ,9999,9999) ; fprintf(ctdat, "\n" ) ; fclose(ctdat2 ) ; // close file } // end — if (ctdat2 != NULL) } // end — dsk_dat_flg >0 } // end -- dsk save av
// "
// LogDataF.C
// save the raw data to the raw data file
// void dsk_save( void )
( struct dosdate_t date; struct dostime_t time;
FILE *ndt; int i, fct; long file_size; unsigned int iy; int iαpc, pv; if(dsk_dat_flg >0)
{ ctdat <= fopen(datfilename, "at" ) ; netdat ■ fopen(ndatfname, "at") ; for (fct-0;fct<2;fct++) // send data to two output files
{ if (fct==0) ndtβctdat; else ndt-nctdat; if ( ndt 1= NULL)
{ // record data for color/crash for (I-0 i<3;i++) // number of color/trash measure.
Figure imgf000225_0001
else fprintf(ndt, "N");
; ; ; ;
Figure imgf000226_0001
Figure imgf000227_0001
can't bo larger than 99 or βmaller than 0
fprintf(ndt, "\n"); } } } for (fct=0;fct<2;fct++)
{ if (fct—0) ndt=ctdat; else ndt=nctdat; if ( ndt 1- NULL)
{ for (i-0;i<3;i++) // 0, 1, 2 the CTM meter
{ fprintf(ndt, "20%2u%2u%2u" ,iy,date.month, date.day) ; fprintf(ndt, "%2u%2u%2u" ,time.hour, time. inute, time.second) ; fprintf(ndt, "%2u",4); // record the RB moisture data fprintf(ndt, "%lu",i); pv «= (int)(last_read[i].m*10.0+0.5); if (pv>999) pv-999;else if(pv<0)pv=0; fprintf(ndt,"%3d",pv); fprintf(ndt,"\n" ) ;
}
// 5 the SJ seed cotton sensor in the feed control
// 7 the microwave bale moisture
// 8 the SJ sensor behind the gin stand
II 9 the NIR meter behind the gin stand i=5;
( fprintf (ndt, "20%2u%2u*2u",iy,date.month, date.day) ; f rintf (ndt, "*2u%2u%2u" ,time.hour, time.minute, time.second) ; fprintf (ndt, "%2u%lu" ,4 ,i); // record the data pv - (int)(rSJ_dat[i]*10.0+0.5); // if (pv>999) pv-999; else if(pv<0) pv-0; fprintf(ndt, "%3d" ,pv) ; fprintf(ndt,"\n");
} i=7;
{ fprint (ndt, "20%2u%2u%2u",iy,date.month, date.day) ; fprintf (ndt,"%2u%2u 2u",time.hour, time.minute, time.second) ; fprintf (ndt,"%2u%lu", 4,i); // record the data pv = (int)(rSJ_dat[12]*10.0+0.5); // if (pv>999) pv-999; else if(pv<0) pv-0; fprintf (ndt, "%3d" ,pv) ; fprintf(ndt," \n");
} } for ( fet-0 ; fct<2 ; fct++)
{ if (fct==0) ndt=ctdat; else ndt-nctdαt; if ( ndt != NULL) { { fprintf(ndt,"20%2u%2u%2u",iy,date.month, date.day) ; fprintf(ndt, "%2u%2u%2u" ,time.hour, time. inute, time.second) ; fprintf(ndt, "%2u",4); // record the IR moisture data fprintf(ndt, "%lu" ,9) ; pv = (int)(rSJ_dat[ll)*10.0+0.5); if (pv>999) pv-999;else if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; fprintf(ndt,"\n"); } } } for (fct-0;fct<2;fct++)
{ if (fct==0) ndt=ctdat; else ndt=nctdat; if ( ndt I- NULL)
{ for ( i>=0;i<3 ;i++)
{ fprintf (ndt, "21%2u%2u%2u",iy,date.month, date.day) ; fprintf (ndt, "%2u%2u%2u",time,hour, time.minute, time.second) ; fprintf (ndt, "%2u%2u" ,5,i) ; // record the temperatures pv - (int)(rSJ_dat[i]+0.5); if (pv>999) pv-999;βlse if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; fprintf(ndt,"\n"); > } } if (nctdat 1= NULL) fclose(nctdαt) ; if ( ctdat 1- NULL)
{ file_βize » filelength(fileno(ctdαt)); fclose (ctdat); if(file size > max_file_βize) // check file size
{ open data_save_f ile (date, day, date, month, date , year) ; /* alT files reopened and closed*/
} } // end — if (ctdat i= NULL) } // end — if (dsk_dat_flag>0) end — dsk save
//
// — LogDataF.C
// save the cal tile data to the raw data file
// void dsk_save eal_tile( int eta )
{ struct dosdate_t date; struct dostime_t time;
FILE *ndt; int i, fσt; long file_si2e; unsigned int iy; int iapc, pv; if(dsk dat_flg >0)
{ ctdat = fopen(datfilename, "at") ; nctdat - fopen(ndatfname, "at") ; for (fct-0; fct<2 ; fct++) // send data to two output files
{ if (fct—0) ndt-ctdat; else ndt-nctdat;
Figure imgf000230_0001
e
}
Figure imgf000231_0001
//
// ___ _-»»—.. LogDataF.C — — —
// save press turn data to the raw data file
// void pt_dsk_save( void )
( struct dosdate__t date; struct dostime_t time; FILE *ndt; int fct; unsigned int iy; if(dsk_dat_flg >0)
{ ctdat = fopen(datfilename,"at"); nctdat - fopen(ndatfname, "at"); for (fct-0;fct<2;fct++)
{ if (fct—0) ndt-ctdat; else ndt=nctdat; if ( ndt 1- NULL) { _dos_getdate(&date) ; dos_gettime(£time) ; Xy - date.yeαr-1900; if (iy>100) iy—100; fprintf(ndt, "16%2u 2u%2u" , iy,date.month, date.day) ; fprintf (ndt,"%2u%2u%2u",time.hour, time. inute, time.second) ; fprintf (ndt, "%2u",6) ; // press turn code fprintf(ndt,"\n"); } } if (nctdat 1= NULL) fclose(nctdat) ; if ( ctdat !« NULL) fclose( ctdat); } // end — if (dsk_dat_flag>0) } // end — pt_dsk__save
//
// —_»_ „.. »_ LogDataF.C—
// save the bale moisture data to the raw data file // microwave meter void balm_dsk save( void ) ( struct dos5ate_t date; struct dostime_t time;
FILE *ndt> int imc , fct; unsigned int iy; if(dsk_dat fig >0)
{ ctdat - f open (dat filename , "at" ) ; nctdat - fopen ( ndat name, "at" ) ; doe gotdato ( &date ) ; dos gettime( &time) ; Iy -"dato .yβar-1900 ; If (Ty>100 ) iy--100 ;
imc - (int) (bdat[lj.bm) ; if (imc<0) imc=0; if (imc>999) imc=999; for (fc -0;fct<2;fct++)
{ if (fct==0) ndt=ctdat; else ndt=nctdαt; if ( ndt 1= NULL)
{ fprintf(ndt,"19%2u%2u%2u",iy,date.month, date.day) ; fprintf(ndt, "%2u%2u%2u",time.hour, time. inute, time.second) ; fprintf(ndt, " 2u", 12); // bale scale data fprintf(ndt, "%3d",imc); // bale moisture content fprintf(ndt,"\n"); } } if (nctdat I- NULL) fclose(nctdat) ; if ( ctdat != NULL) fclose( ctdat); } // end — if (dsk_dat_flag>0) } // end — balm_dsk_save
//
// LogDataF.C
// log the tag_msg to the data file void tm dsk_save( void )
{ struct dosdαte_t date; struct dostime_t time; FILE *pdt; int i, k, imc; unsigned int iy; dos_getdate(&date) ; dos gettime(&time) ;
ate.day) ; nute, time.second) ; tag_msg
Figure imgf000233_0001
//
LogDataF.C data to the network file ss ( void )
Figure imgf000234_0001
izeof( bdat[0] ); for (k=0;k<2;k++) if (k—0) pdt - fopen("P:\\ginstand\\bdatf.dat","w+b" ) ; else pdt - fopen( "C:\\INIT\\bdatf.dat" , "w+b" ) ; if (pdt 1= NULL) rite(bdat,size,20,pdt); if (pdt 1- NULL) fclose(pdt);
> } // end — bdat_dsk_pass
//
// LogDataF.C
// pass the bale average data to the network file, and local file
// void ba_dsk_pass ( void )
{
FILE *pdt; int i, j, k; si2β_t size- sizeof( ba[0][0] ); for (k=0;k<2;k++) if (k—0) pdt - fopen( "PjWginstandWba.dat", -w+b"); else pdt = fopen( "C: \\INITWba.dat" , "w+b") ; if (pdt I- NULL)
{ for(i=0;i<20;i++) for (j-0;j<3; j++) fwrite(&ba[j][i],size,l,pdt);
> if (pdt !- NULL) fclose(pdt);
} // end — ba_dsk_pass
//
// LogDataF.C
// pass the other data to the network file, and local file
// void other_dβkj?ass ( void )
FILE *pdt; int i, k; int od[ 10 ] ;
for (k=0;k<2;k++) if (k—0) pdt = fopen("P:\\ginstand\\other.dat","w+b")j else pdt = fopen( "C: WlNITWother.dat" , "w+b" ) ; if (pdt J- NULL) fwrite(ccaltime,sizeof(ccaltime[0 ] ) ,3 , dt) ; fwrite(tcaltime,sizβof(tealtime[0] ),3,pdt) ; od[0] = rnlc; // rec. number lint cleaners od[l] = (int) (rscc/2) ; // rec. stick machine od[2] - (int) (rscc%2) ; // rec. impact cleaner od[3] - lcu(O); // no. lc's used gin 1 od[4] = lcu[l]; // no. lc's used gin 2 od[5] - lcu[2]; // no. lc's used gin 3 od[6] - scu[l]£0x01; // stick machine 1 used od[7) = (scu[l]&0x02)»l; // stick machine 2 used od[8] » 0} // od[9] - 0; fwrite(od,βizeof(od[0] ),8,pdt); od[0] - scu[0]£0x01; // impact cleaner 1 in use od[l] - (scu[0]&0x02)»l; // impact cleaner 2 in use for (i=0;i<3;i++) if (last_read[i].gsuse«0) od[2+i] - 0; // GS in else od[2+i] = 1; II GS not in
} od[5] = 0; fwrite(od,βizeof(od[0] ) ,5,pdt) ; fwrite(tag_msg,sizeof(char) ,60,pdt) ;
} if (pdt I- NULL) fclose(pdt); > } // end — other_dsk_pass
//
// LogDataF.C
// save the bale scale data to the raw data file
// void bs_dsk_save( long int bnp, int wtp ) struct dosdate_t date; struct dostime_t time; FILE *ndt; int fct; unsigned int iy; if(dsk_dat_flg >0) ctdat " fopen(datfilename, Hat" ) ; nctdat - fopen (ndatf name, "at" ) ; for ( fot-0;fct<2 ; fct++)
Figure imgf000236_0001
// //
/* DCFIO.C */
// save the calibration check tile data to the raw data file // autocalibration data void rec ctile( int ch )
( struct dosdate_t date; struct dostime_t ti«ne; unsigned int iy; int i,/* j,*/ pv, fct; FILE *ndt;
Figure imgf000236_0002
fprintf(ndt, "%2u%2u%2u",time.hour, time.minute, time.second) ; fprintf(ndt, "%2u",50); // Trash Auto Calibration fprintf(ndt, "%ld",i); pv - (int) (ctilβ[0][i).areapc*10.0+0.5); if (pv 999) pv=999;olse if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; pv = (int)(ctile[l][i].areapc*10.0+0.5); if (pv 999) pv=999;else if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; pv B (int)(fareaoff[i]+0.5); if (pv>999) pv-999;else if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; pv - (int)(fareaslp[i]*1000.0+0.5); if (pv>9999) pv=9999;elβe if(pv<0)pv=0; fprintf(ndt, "%4d",pv); switch (i)
{ case Oi pv = lut0[255); break; case 1* pv - lutl[255]; break; case 2 i pv - lut2[255]; break;} if (pv 999) pv=999;elee if(pv<0)pv=0; fprintf(ndt, "%3d",pv); fprintf(ndt,"\n");
} i=ch; // number of color autocalibrate
{ f rintf(ndt, "41%2u%2u%2u" ,iy,date.month, date.day) ; fprintf (ndt,"%2u%2u%2u",time,hour, time.minute, time.second) ; fprintf(ndt,"%2u",51); // Color Auto Calibration fprintf(ndt,"%ld",i); pv - (int)(ctile[0][i].rd*10.0+0.5); if (pv>999) pv=999;else if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; pv - (int)(ctilθ[0][i].pb*10.0+0.5); if (pv>999) pv-999;elβe if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; pv - (int)(ctile[l][i].rd*10.0+0.5); if (pv 999) pv=999;else if(pv<0)pv=0; fprint (ndt, "%3d" ,pv) ; pv - (int)(ctile[l][i].pb*10.0+0.5); if (pv 999) pv-999;elβe if(pv<0)pv=0; fprintf(ndt,"*3d",pv); pv - (int)(inty[i]+0.5); if (pv>999) pv-999;elβe if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; pv - (int)(slpy[i]*100.0+0.5); Jf (pv>999) pv-999»elβθ if(pv<0)pv=0; fprintf (ndt, "%3d" ,pv) ;
pv - (int)(intz[i)+0.5); if (pv>999) pv=999;else i (pv<0)pv=0; fprintf(ndt,"%3d",pv); pv - (int)(slpz[i]*100.0+0.5); if (pv>999) pv=999;else if(pv<0)pv=0; fprintf(ndt, "%3d",pv); fprintf(ndt,"\n"); } // end i= } // end ndt 1= NULL } // end ~ fct- if (nctdat l» NULL) fclose(nctdat) ; if ( ctdat 1- NULL) fclose( ctdat); } // end — if (dsk_dat_flag>0)
} // end — rec_ctile()
//
/* DCFIO.C */
// save trash calibration data to the raw data file
// void dsk_trβeal( int chd )
{ struct dosdate_t date; struct doβ ime_t time; unsigned int iy; int pv;
FILE *ndt; int fct; if(dsk_dat fig >0) { ctdat B fopen(datfilename,"at" ) ; nctdat B open(ndatfname, "at" ) ;
_dos_getdate(&date) ; dos_gettine( &time) ;
Iy - date.year-1900; if (iy>100) iy-=100; for ( fct-0; fct<2 » fct++)
{ if (fct==0) ndt=ctdat; else ndt=nctdat; if ( ndt 1= NULL)
{ , date.day); .minute, l Calibration
Figure imgf000238_0001
pv - (int) (cal_count); if (pv>999) pv=999;βlβe if(pv<0)pv=0; fprintf(ndt, "%3d" ,pv) ; pv = (int)(thresh*10000.0+0.5); if (pv>9999) pv=9999;else if(pv<0)pv=0; fprintf(ndt, "%4d",pv); fprintf(ndt,"\n"); } } if (nctdat 1= NULL) fclose(nctda ) ; if ( ctdat 1= NULL) fclose( ctdat); } // end — if (dsk_dat_flαg>0) } // end — dsk_trscal
II II
/* DCFIO.C
// save the color calibration data to the raw data file
// void dsk_colcal(int chd )
{ struct dosdate_t date; struct dostime_t time; unsigned int iy; int pv; FILE *ndt; int fct; if (dsk_dat fig >0)
{ ctdat = fopen(datfilename,"at") ; nctdat - fopen(ndat name, "at" ) ; _dos_getdate(&date) ; doβ_gettime(&time) ; Iy - date.year-1900; if (iy>100) iy-=100; or (fct-0; fct<2;fct++)
( if (fct«Bθ) ndt-ctdatf-else ndt-nctdat; if ( ndt is NULL)
{ fprintf(ndt, "61%2u%2u%2u",iy,date.month, date.day) ; fprintf(ndt, "*2u%2u%2u",time.hour, time.minute, time.second) ; fprintf(ndt,"%2u",53)j // Color Manual Calibration fprintf(ndt, "%Id" ,chd) ; fprintf(ndt, "%7.If",y cal.el); fprintf(ndt, "%7.3f",y cal.c2); fprintf(ndt, "%7.3f",y cal.c3); fprintf(ndt,"%7. If",z""cal.el); fprintf(ndt,"%7.3f",z~cal.c2) ;
fprintf(ndt, "%7.3f" , z eal.c3 ) ; pv - ccal_err; if (pv 99) pv-*99; else if (pv<0) pv=0; fprintf (ndt, "*2d",pv); // always prints 0 ?? fprintf(ndt, "\n");
}
} if (nctdat 1= NULL) fclose(nctdat) ; if ( ctdat 1= NULL) fclose( ctdat); } // end — if (dsk_dαt_flαg>0) } // end — dskjcolcal
// //
/* DCFIO.C */
// open the raw data and bale average data files void open_data_βave_file(int day, int month, int year)
//int chret; int nfle, i; int f handle /* , f_handle2*/; char fmsg(14) - "disk full !\0"; char cemβg[18] ="cannot open file\0"; char nmsg[18] - "no new file names\0"; fcloseall( ) ; // be sure all files are released fileday-(unsigned char)day; filemo -(unsigned char)month; fileyr = (unsigned int )year; datfilenαme[18] - (char) 48 ; // start name search at 0 ndatf ame[18] — (ch r) 48 ; sumfilename[18] = (char) 48 ; if (day>31) day - 31; if (day<0) day ' 0; datfilename[13] *'(char) (day/10+48); ndatfname[13] *>(char)_(day/10+48); sumfilenαme[ 13 ] ' «'(char) (day/10+48); day %= 10; datfilename[14] -(char) (day+48), ndatfname[14] -(char) (day+48); sumfilename[14] =(char) (day+48); if (month>12) month-12 if (month<0) month* 0; datfilename[15] =(char) (month/10+48); ndatfname[15) -(char) (month/10+48); βumfilenαme[15] -(char) (month/10+48); month %=10; datfilename[16) «(char) (month 48); ndαtfnαmo[16] -(char) (month 48);
sumfilename[16] =(ehar) (month + 48); if (year<0) year=0; year %= 10; /* 0..9 */ datfilenamβ[17] -(char) (year+48); ndatfname[17] -(char) (year+48); sumfilename[17] -(Char) (year+48); settextposition(25,02) ; for (i-0;i<23;i++)printf("%c",dαtfilenαme[i]),- settextposition(25,30); for (i=0;i<23;i++) printf("%c" ,ndatfname[i] ) ; settextposition(25,57); for (i-0;i<23;i++) printf("%c" ,sumfilename[i] ) ;
// open raw data file on control computer nfle-0; do
{ if (access (datfilename, 0) 1=0)
{ nfle = 1; if ((f_handle - open(datfilename,
0_WRONLYI 0_TEXT| 0_CREAT) ) -= -1 )
_settextposition(25, 2) ;printf(cemsg, "0") ; /* give up */
) else /* - found it, new file open, give R/W attrib */ chmod(datfilename,S_I RITE | S_IREAD) ; else
{ close(f_handle) ; datfilename[18]++; if (datfilename[18]—58) datfilename[18]=(char) 65; sottoxtposition(25,02); ϊor (i-0,i<23ji++) printf("%c",datfilename[i]);
} while (nfle—0); setmode(f handle,0 TEXT); ctdat = fdopenff handle, "wt" ) ; // open raw data file on networked computer nfle=0; do { if (access (ndatfname, 0) 1=0) nfle - 1; if ((f_handle - open(ndatfname,
0 WRONLYlO EXTIO CREAT)) — -1)
{ "
_βottoxtposition ( 25 , 30 ) prin ( cemsg , " 0 " ) >
*/
Figure imgf000242_0001
// This section of code deals mostly with measurements of trash.
// TRASHF.C
#include "cainc.h" // all includes
#include "cadef.h" // all defines
#include "caext.h" //
#include "caproto.h" // prototypes of all functions
// TRASHF.C void do_trash(int ch)
{ delay(100); do_a rame(ch) ;
HRTlIve(HRTseg) ; ) // end do trash //
// TRASHF.C
// process a frame of data
// This section of code takes a reading from an individual frame of
// the channel being pointed to by the video multiplexer. It
// determines whether an individual pixel should be considered trash
// or not. It counts the number of pixels that are trash in the
// complete image and then converts that reading to the percent of the
// total number of pixels that are tr sh in the image.
// Because of the problem of the
// camera seeing the frame around the sample, this code does
// not include the at edges of the picture from the camera. It
// uses the autocalibration parameters.
// void do_a frame(int chan)
{ static int areaoff[3] - { 0, 0, 0}; // offset /10 in area measurement static int countoff[3] =( 0, 0, 0); // offset in area measurement int i;
ount;
)) *np_lut;
Figure imgf000243_0001
areaoff[chan] - (int) (fareaofffchan]+0.5) ; if (areaoff[chan]<0) areaoff[chan]»0; switch (chan) {
Figure imgf000244_0001
bu - bf[indx]; asm
MOV AX, [hiref] ; LOAD THE HIREF THRESHOLD... CMP AX,buff ; COMPARE DATA IN MEM. TO REF... JBE CENH_HI ; NOT A DARK SPOT, GO PAINT IT WHITE. MOV BX,np lut ; POINT TO THE START OF THE TABLE.. ADD BX, [hiref] ; INDEX TO THE RIGHT TABLE ENTRY... add bx, [hiref] MOV AX,[BX] ; GET THE ENTRY.. CMP AX, uff ; IS IT 'tresh'% ?.. JB CENH HI ; call it white ...
;xor al,αl
;mov buff_sav,al ; make it black MOV [wht_flg],01 mov ax,l add [raw_area] ,ax JMP SHORT CENH3 NEXT MEMORY POSITION
CENH-Hit
;mov al,bu±ι
; call it white
CENH2 I
Figure imgf000244_0002
AND AX,7FFFH
MOV [hiref],AX ; SAVE THE NEW REF... CENH2aι
CENH3 t
} // bottom of _asm
} // bottom of 'indx* — columns
Figure imgf000245_0001
{ by to hugo *baddr;
baddr= MAKE_FP(HRTseg) ; *(baddr + CNTL_REG)= 0x99;
} //
// TRASHF.C
// This procedure simply waits for a given amount of time
// void delay(unsigned int dlay)
{ static int cal_factor= 0; int i, j; do_freq( ) ; if( lcal_factor)
{ char far *t- (char far *) 0x0000046CL;
// timer tick address j- *t; while(j —*t); j= *t; while(j —*t)
{
CompOK( ) ; cal_factor++; for(i-0; K100 ; i++) ;
} cal_factor- cal_factor/55;
} while(dlay—)
{ for( j-0 ; <cαl_factor; j++)
} /
//
Figure imgf000246_0001
TRASHF.C
// void setup_trash ( int ch ) if (ch— 0 ) thresh- threshO ; // for calibration Ti if (ch— 1 ) thresh* throshl ; // trash first . . .
} if (ch==2) thresh- thresh2; // trash first...
}
} //
// TRASHF.C
// This procedure takes the mean of several readings of Rd, +b, or // percent area and stores it in a matrix. Used to check the correct // readings of the autocalibration tiles.
// void cale_ctmean(int sta) // calc means
{ ctm[0][sta] .rd - (ctile[0][βta].rd+ctile[2][sta].rd+ctile[4][sta].rd)/3.0; ctm[l ] [sta] .rd - (ctile[l][sta].rd+ctile[3][sta].rd+ctile[5][sta].rd)/3.0; ctm[0] [sta] .pb s
(ctile[0][βta].pb+ctile[2][βta).pb+ctile[4][sta].pb)/3.0; ctm[l] [sta] .pb B (ctile[l][βta].pb+ctile[3)[sta].pb+ctile[5][sta].pb)/3.0; ctm[0][stα] .y -
(ctilβ[0][stα].y +ctile[2] [sta] .y +ctile[4] [sta] .y )/3.0; ctm[l] [eta] .y =
(ctile[l][βta].y +ctile[3] [sta] .y +ctile[5] [sta] .y )/3.0; ctm[0] [sta] .z -
(etile[0][sta].z +ctile[2] [sta] .z +ctile[ ) [sta] .z )/3.0; ctm[l) [sta] .z -
(ctile[l][sta].z +ctile[3] [sta] .z +ctile[5] [sta] .z )/3.0; ctm[0) [sta] .areape =
(ctile[0] [sta] .areape +ctile[2] [sta] ,areapc+ctile[4 ] [sta] . reape) /3.0; ctm[l] [sta] .areape -
(ctile[l][8ta].areapc +ctile[3][sta] .areape+ctile[5] [sta] .areape) /3.0; ) // end calc ct ean //
// TRASHF.C
// This is the software calculates the
// adjustments to the Y,Z, and percent area readings based on the
// calibration tiles that are presented automatically at stations two
// and three. The procedure is a linear fit for Y, α linear fit for Z,
// but it'β a nonlinear approach for the percent area.
// void cαlc ctile adj (int camera) // adjust for tiles
{ int i;~ double ex, sy, βxy, sxs , don; double yc[3 ] (2 ) ; double zσ[3 ] [2 ] ; doublo cal_chk_aroapσ[ 3 ] - {2.04 , 1.76, 2.05} ;
double fslpy, fslpz, finty, fintz, ffareaoff, ffareaslp;
// yc[station] [tile] tile=0->trash, tile=l->color yc[0][0]=1305.0; yc[0][lj- 947.0; yc[l][0]-1305.0; // trash yc[lj[l]= 947.0; // color yc[2][0]=1418.0; yc[2][l)-1025.0;
// trash // color
Figure imgf000248_0001
βx-0.0; sy-0.0; βxy-0.0; sxs=0.0; for (i=0;i<6;i++)
{ sx +«ctile[i] [camera] .y; sy +-yc[camera] [i%2]; sxy+=ctile[i] [camera] .y*yc[camera] [i%2 ] ; sxs+=ctile[i] [camer ] „y*ctile[i] [camera] .y;
) _settextposition(10+camera,5) ; printfC'cam %2d sx %6.2f sy %6.2f sxy %6.2f sxs %6.2f " ,camera, sx,sy,βxy,sxs) ; den = sxs - sx*sx/6.0; if (den>0.01) fslpy - (sxy - βx*βy/6.0)/den; else slpy[camera) = 1.0; finty - sy/6.0 - slpy[camera]*sx/6.0;
.z ;
Figure imgf000248_0002
f ntz - βy 6.0 - slpz[camera]*sx . ;
// correct for offset, based on color tile ffareaoff +B (ctilβ[ 1] [camera] .areapc-0.1
+ctile[3] [camera] .areape-0.1
+ctile[ 5) [cameraJ .arβapc-0.1)*2.0; // was 10.0 if (ffareαoff<0.0) ffareαoff-0.0;
// correct for slope based on trash tile ffareaslp += (cal_chk_areapc[camera]*3.0 -ctile[ 0] [camera] .areape -ctile[2 ] [camera] .areape -ctile[4 ) [camera] .areape) *0.01 ; // 0.05 works // 0.01 works
_settextposition(2 ,2 ) ; printfC* %2d %6.3 %6.4 %6.3 %6.4 %6.4 %6.4 ", camera, finty, fslpy, fintz, fslpz, ffareaoff, ffareaslp); switch(camera)
{ case 0> for (i-0;i<256;i++) lut0[i) = (int)(i*thresh0*fareaslp[0]+0.5); break; case 1: for (i=0;i<256;i++) lutl[i) - (int)(i*threshl*fareaslp[l]+0.5); break; case 2 i for (i-0;i<256;i++) lut2[i) - (int)(i*thresh2*fαreαslp[2)+0.5); break; default! break; }
} // end calo ctile adj // ~
// TRASHF.C
// This procedure is the calibration of the trash reading based on a
// properly presented trash tile. his procedure calls "trash^calOOO,
// trash_eall00, for trash_cal200," depending on whether calibration
// is at station one, two or three. These procedures determine a
// new threshold which determines what the new lookup table will be
// for whether a pixel is considered trash or not based on successive
// approximations. The threshold is stored in a file on the hard disk
// after the calibration is complete.
// int trsh_cal(int ch)
FILE *tcal; // trash calibration int ex, hx, ix, i; int iarea, icount; float farea, fdif , rx, pacal; float chg coeff-(float)0.00008; time__t ltime ; cal l σloarβσrβen(_GCLEARSCREEN) ; faroaoff (ch) = o . O ;
fαreaslp[ch] •= 1.0; settextpcsition(12,31);printf( "TRASH CALIBRATION"); If(tcret ==0) { _settextposition(13,31) ;printf("CAMERA #1") ;} else if (tcretj—1) { settextposition(13, 31) ;printf( "CAMERA #2" ) else { _βettextpositϊon(13,31);printf("CAMERA #3");} _settextposition(15,34 ) ;printf( "TILE VALUES" ) ;
_Bettextposition(16,29) ; printf(" " ) ; pαcαl - cαl_αreα; // needs to be float pacal B pacal*pacal/205040.0;
_settextposition(17,29) ; printf(" Area Count");
_βettextposition(19,29) ; printf(" %4d %3d", cal_area,cal__count) ; _settextposition(22,29) ; printf(" Percent area«%6.2f ",pacal); _βettextpoβition(05,14); printf("Fit F5» ESCJ")
_settextposition(06, 14); printf( "Change Tile Values Calibrate Quit" ) ; cal90: cx= getch(); if(ex —0) cx= getch(); if(ex —59) goto callOO; if(ex =-KEY_ESC) return(ll); if(ex ==63 )~" goto re__cal;
Figure imgf000250_0002
printf("\07"); // bell goto cal90; callOOt // get a new area value
Figure imgf000250_0001
goto cαlllO; call20: printf("\07"); // beep if(ix >0)
{ _settextposition(20,29);printf(" %d ", ix); } else
{ _settextposition(20,29);printf{" %d ", cal_area); } goto call10; cal200ι // get a new count value if(ix 1-0) cal_area= ix; // save 'cal_area' first... goto cal; // added
_settextposition(20,29);printf( "Area Count" ) ;
_βettextposition( 19,29) ;printf{" Count");
_settextposition(19,29);printf("%d %d" , cal_area, cal_count) ; _settextposition( 19 ,47 ) ;printf( "Count" ) ;
cal202ι
_settextposition(20,29) ;print (" td ", cal count); ix- 0; ca!210x
Figure imgf000251_0001
if(ix 1=0) cal_count= ix; _settextposition(17,47) ;printf( "Count ); _settextposition(15,49);printf(" %d " cal_count) ; goto cal; re_calt
_clearscreen( GCLEARSCREEN) ; _settextposit!on( 4,31) ;printf("TRASH CALIBRATION' "settextpoβition( 7,3 ) print ( "TILE VALUES"); _aettextposition( 8,29) ; rintf( ) _settextposition( 9,29) ;print ( Area Count" ) ; _settextposition(ll,29) ;printf( %4d %d ", cal_area,cal_count) _settextpoβition(16,35) ;printf( SCAN RESULTS"); _settextposition(17, 8);printf( _setteκtposition(18,28) ;printf( Area Count Threshold1 _settextposition(22,29) ;printf( CALIBRATION STARTING"); _settextposition(23,29) printf( (Esc to quit)");
re_call0ι
rea tion area ange
Figure imgf000252_0001
iarea. icount, thresh);
_settextposition(22,29);printf( "CALIBRATION CONTINUING..."); _settextposition(23, 29);printf(" (Esc to quit)");
Figure imgf000253_0001
iarea, icount, thresh); _sβttextposition(22, 29) ;printf("CALIBRATION COMPLETE... " ) ; _settextposition(23,29);printf(" (Esc to quit)"); delay(3000); // wait a while
if( kbhit() ) // see if they want to quit
{ cx= getch( ) ; if(ex ==KEY ESC) return(ll);
} if( (teals fopen("c:\\init\\TRSHCAL.DAT", "wb")) --NULL ) // guess not, βave 'em
{ printf ("\n open error, TRSHCAL.DAT"); return(10) ;
} else
{ fprintf(tcαl,"%d\t d\t%f\n", cal_αreα,cal_count,thresh) ; fclose(teal) ;
} dsk_trscal( ch ); if(tcret =»0) // see where we came from return(O); // finish up camera #1 else return(0) ; // camera #2 } // end trsh cal // // TRASHF.C
// void traβh_cal000(void) // camera #0 trash int i, ix; float rx;
FILE *tcal; // trash calibration flappor(l) ; // open sampler at 0, close 1, 2
outp(DT2859,0) ; // switch to video input 0
Figure imgf000254_0001
// changed for plunger sampler at 0 flapper(l); // oppn sampler at 0, close 1, 2 out (DT2859,1) ; // change to video input 1 if( (teal- fopen("ct\\init\\trshcall.dat","rb")) —NULL )
_βettextposition(16,55); printf("open error, trshcall.dat"); trcret-12; fscanf (teal, "%d\t%d\t%f\n" , &cal_αrea,&cal_count,& thresh) ; foloso(tcal) ; for(i-O) i<256> I++) // look-up table
it\\trshcall.dat>nul") ;
Figure imgf000255_0001
// TRASHF.C
// void trash_cal200(void) // camera #2 trash
{ int i, ix; float rx;
FILE *tcal; // trash calibration
// changed for plunger sampler at 0 flapper(l); // open sampler at 0, close 1, 2 outp(DT2859,2) ; // change to video input 2
) ;
Figure imgf000255_0002
tcret- 2; trcret = trβh_cal(2); if (trcret<10) ix- syβtem("copy ctWinitWtrshcal.dat oi \\lnitWtrshcal2.dat>nul") J // in case thoy didn't } // end trash cal200 //
// TRASHF.C
// This procedure reads the trash calibration data from the hard disk
// and calculates the lookup table for the three trash heads, station
// one, two, and three
// int reαd_tcαl(void)
{ int i; float rx;
FILE *tcal; // trash calibration if( (tcal= fopen("c:\\init\\trshcal0.dat","rb") ) —NULL )
// camera #0
{
_βettextposition(13,55); printf("open error, trshcal0.dat"); return(10) ; } else
( fscanf(tcal,"%d\t%d\t%f\n", Sea _area0,&cal_count0 , &threshO ) ; fclose(teal) ;
} for(i-0; i<256; i++)
{ rx» (i*thresh0) +0.5; // round up lut0[i]= (int)rx;
} if( (teal- fopen("ct\\initWtrshcall.dat","rb") ) —NULL ) // camera #1
{
_settextposition(14,55) ; printf("open error, trshcall.dat"); retur (10) ;
} else
{ fscanf(tcal,"%d\t%d\t%f\n",
£cal_areal , ϋcal_count 1 , & thresh 1 ) ; fclose (teal) ; > for(i=0; i<256; i++) rx- (i*threshl) +0.5; // round up lutl[i]- (int)rx; } if( ftcal- fopen("ct\\init\\trshcal2.dat","rb")) ==NULL ) // camera #2 {
_sextextposition( 14 , 55 ) ; print ("open error, trshcal2.dat"); return(10) ; else fscanf(tcal,"%d\t%d\t%f\n",
&cal_area2 ,&cal_count2 ,&thresh2 ) ; fclose(tcal) ; for( -0; i<256; i++) rx= (i*threβh2) +0.5; // round up lut2[i]« (int)rx; return(O) ;
} // end read teal
//
// TRASHF.C
// This file contains many of the "defines" used in the program. They // are addresses and unchanging variable values that can be used in // the file.
// cadef.h
//
// from ColorF.c
#define ADBase 0x300
#define ADStat ADBase+8
#define DT2859 0x2E3
#define KEY_ESC 27
#define byte unsigned char
#define PASS 1
^define FAIL 0
#define OK 1
// end from ColorF.c
// from trashF.C
#define Y_REG 0x2002
#define CNTL_REG 0x2000
#define lfl -0.01785
#define lf2 0.00815
#define If3 0.0915
#define If4 0.000003575
#define If5 0.000367
// end from trashF.C
// cadef.h
// This file contains declarations for all the global variables that // are used int he program. This program uses a lot of global // variables for passing data from one procedure to the other.
//
// caext.h
//
// A/D vars
#ifdef MAIN_SECTION
// Frame grabber is memory mapped unsigned HRTseg=0xD800; #else extern unsigned HRTβeg ;
#endif //
// Color vars —— — — —— ——
#ifdef MAIN_SECTION int Y CHANL[3] = {0,4,8};
/7 in ut, Z_CHANNEL[nJ=Y_CHANNEL[n]+l
Figure imgf000259_0001
Figure imgf000259_0002
#ifdθf MAIN SECTION #define EXTERN
#else
#deflne EXTERN extern
#ondif II calibration tile check data
EXTERN double fareaoff[3];
EXTERN double fareaslp[3J;
EXTERN double slpy[3], slpz[3], inty[3]. intz [ 3 ] ;
II storage for last manual calibration time
EXTERN time_t ccaltime[3], tcaltime[3], e time[3];
EXTERN struct RB ctdat ctile[6][3); // thiree readings of each
// of the 2 tiles per each of 3 C/T heads ctile[read] [sta]
EXTERN struct RB_ctdat ctm[2 ] [3 ] ; // mean of tvo tiles, three stations
// ctm[tile] [sta]
II
EXTERN float ccf[3][6]; // color conversioi: constants
EXTERN int color_step;
EXTERN float plus_b, rd;
EXTERN struct color_const y_cal;
EXTERN struct color_const z_cal;
EXTERN int coir, pima_flg;
EXTERN int ccal_err; // count of errors in color mαnυαl cal ,
// Trash vars
EXTERN float chg_coeff;
EXTERN double area;
EXTERN double count;
EXTERN double leaf;
EXTERN int lut0[256], lutl[256), lut2[256], lut[256];
EXTERN int *p_lut; // to point to the current lut EXTERN float thresh; EXTERN float threshO; EXTERN float threshl ; EXTERN float thresh2 ; EXTERN int cal_area; EXTERN int cal_area0 ; EXTERN int cal_areal; EXTERN int cal_area2 ; EXTERN int cal__count; EXTERN int cal~countl ; EXTERN int cal_count2; EXTERN int treret; EXTERN int tcret;
//
// Color and Trash vars
EXTERN int camera ;
EXTERN unsigned HRTseg;
EXTERN struct RB_data last_read[ 3 ] ;
// Overall variables struct RBbaledat { long bn; int bw; long btime; int bm; } ;
for last 40 bales
EXTERN struct RBbadat ba[3][40]; // bale average rd, pb, y, z, areape, leaf, color, mc
EXTERN int bale_tot_ct_n[3] , // number of obs. added for color/trash means bale_tot_o_n[3] , // number of times in sum sub. bale_tot_ct_nra[3] , // number of good obs. of moisture bale_av_nct[3 ] [ 10] , bale_ay_no[3 J [ 10] , bale_m_nct[3 j , bale_av_wt[10] , // the bale weight from scale bale_m__no[3] ;
EXTERN double bale_tot_rd[3] ,
leu of gin 0..3, sum., number of obs
Figure imgf000261_0001
EXTERN double bale_αv_time[10] ;
EXTERN float bdat rate[40];
EXTERN int lbn; ~~ // the last bale number received
EXTERN
Figure imgf000261_0002
EXTERN struct RB_fldat bale_tot, // total number of obs of indices used bale_av[10], // .fee, .ftcd, . fmc bale_m;
EXTERN int bale tot_cc[9) [6] [3 ] ;
EXTERN int bale~av_cσ[3][10);
EXTERN int bale m_co[3);
EXTERN int lcu[4~]; // current LC in use, 4 gin stands 0..3
EXTERN int scu[2); // current SCC in use, 2 machines
// 0 = none; 1, 2 = one; 3 = two EXTERN int cnlcl; // current number of gin stands with setting 1 EXTERN int cnlc2 ; // current number of gin stands with setting 2
EXTERN float bvolt[6]; // to hold voltage going to the bulbs EXTERN int sba; // show bale averages, or self calibration data EXTERN FILE *lc_decision_file; EXTERN FILE *scc_decision_file; struct dec matrix_entry { char fIret_atage_machine_sequence; char dryer_sequence; unsigned int predicted_moist_station_2; unsigned char predicted_trash_station_2 ; unsigned char predicted_color_βtation_2 ; char sec_stage_machine_sequence; unsigned int predicted_moist station_3; unsigned char predicted_trash*_βtation_3; unsigned char predicted color station_3;
};
EXTERN byte huge lc_dec_rkb[31][21 ] [13] [13] ;
// [Rd][+B][%M][leaf] EXTERN byte huge scc_dec_rkb[31] [21] [13] [13] ;
// [Rd][+b')[%M][leaf]
EXTERN struct dβo_matrix_entry current_decision[ 2 ];
EXTERN struct moist_color_trash_entry predicted_data[ 2 ] ; EXTERN struct moist_color_trash_entry lu_d[2];
EXTERN int rnlc; // recommended number of lint cleaners EXTERN int rscc; // recommended number of seed cotton cleaners EXTERN float p stl; // recommended gin stand moisture content EXTERN int flok[3); // flapper has timed out EXTERN int done9; // Fl pressed EXTERN long bale n; EXTERN int βampTe_no; EXTERN int error; EXTERN int us3 ; // switch to use station 3 EXTERN long max_file size; EXTERN unsigned char flleday; EXTERN unsigned char filemo; EXTERN unsigned int fileyr; EXTERN int dsk dat_flg; // =0 not log data, =1 log data EXTERN FILE *ct3at; // file to hold all data EXTERN FILE *nctdat; // network file to hold all data EXTERN FILE *ctdat2; // file for summary data EXTERN struct RB_fldat 1 read_data[3) ;
EXTERN int SJ_dat[15J; // data from temperature and other moisture devices EXTERN double rSJ_dat(15]; EXTERN char tag_msg[65]; // tag label from net
#ifdef MAIN_SECTION
/* prototype name for the all data file, change code if it is changed*/ char datfilename[25) = "C: \\DATA002WSVOOOOOO.DAT\0\0" ;
/* prototype name for the network data file, change code if it is changed*/ char ndatfname[25] = "Pt\\DATA002WSV000000.DAT\0\0";
/* prototype name for the summary data file, change code if changed*/ char sumfilename[25] = "C: \\BGlDATA\\SM000O00.DAT\O\0" ;
extern char datfilename[25] extern char ndatfname[25] extern char sumfilename[25] #endif // caext.h
// This file has many of the external "includes" in it. The three
// files "vicdefs.h, vicfcts.h, and vicerror.h" are part of the Victor
// Software Library that came with the frame grabber card. The three
// files, "hviconst.h, hvimain.h, and driver.h" are part of the MCI
// package that came with the color and trash measurement cameras.
// The rest of the files are all part of the basic Microsoft "C
II package. These are all files that contain drivers and software for
// doing many of the things that have to do with hardware in the
// system including the operating system.
//
// cainc.h
#include <time.h>
#include <sys\types ,h>
// from color .c
#include "vicdefs .h"
#include "vicfcts.h"
#include "vicerror.h"
#include "hviconst.h"
#include "hvimain.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <process.h>
#include <dos.h>
#include <io.h>
#includo <SYS\TYPES.H>
#include <SYS\STAT.H>
#include <ERRNO.H>
#include <FCNTL.H>
#include <conio.h>
#inclu-lβ <graph.h>
#inelude <strlng.h>
#include <direct.h>
#include "driver.h"
// end from colorf.c
//
// cainc.h
// This file contains the seven "include" files that have the
// declaration of the types for each of the procedures. They are
// located in separate files that correspond to the source code files
// that contain the "C" source code.
// caproto . h
/include "ColorPrt.h" /include "TrashPrt.h" /include "DgtIIPrt.h" /include "DispLPrt.h" /include ••ContDPrt.h" /include "LogDaPrt.h" /include "LcadvPrt.h" // caproto . h
// These are the declarations of the procedures that are in the
// "eolor .C" program. They mostly have to do with color measurement
// and color calibration but also include declarations of all the
// analog data collection that's used in the system.
//
// - ColorPrt.h
// void runcolor( oid) ; int colrmgr(int) ; void mcmgr(int) ; void delay(unβigned int); int system(const char*); void _dos_gβtdate(struct dosdate_t*) ; void _dos_gettime(struct dostimβ_t*) ; int compύte_color(float, float) ; void color_cal(int) ; void color_init (void) ; void adc_value(int, int, int*); // don't use for rd or +b void adc_mns(int, int* , int*) ;
// mean of 8 readings 2 consec. chan. void showed (int ) ; void showadp(int) ; void setup_vid ( int ) ; void get_bvolt( void ) ; void get_mc ( void ) ; void get_sjm( void ) ;
//
// - ColorPrt.h
// These are declarations of procedures used in the control process in
// the control computer.
//
// ContdPrt.h
// int open_decision_matrix_file( void ); void initialize_dec_matrix( void ); int read_lc_dec_file( void ) ; int read_βcc_dec_file( void ) ; int index_to_color( int ); int color_to__index( int ); int moiβt_to"index( float ); int trash_to_index( float ); int round_color( float ); int round_trash( float ); void RKB_measurement_proceBs( int ); int color_function ( int ) ; int traβh_function( int, int ); int rule_of_thumb( int, double ); int fix_color_index( int ); int parea_to_clgr( double ); int lc_lookup ( int, double, double, double); int scc_lookup( int, double, double, double); int lc_check( int, double) ;
// ContdPrt.h
// This file contains declarations of all the procedures used for
// digital input and output having to do with opening and closing
// flappers for sample collection as well as the bitwise data transfer
// between the PLC and the control computer signaling how many lint
// cleaners should be used, how many are being used, and the like.
// - DgtliPrt.h
// void o_set ( byte, byte); byte i_get ( byte ) void CompOK ( void ) void flapper ( int ) void chk_lcu ( void ) void chk_bc ( void ) void calflap ( int ) int wait_samp_open ( int ) ; int wait~cal_closed ( int ) ; int wait_cal_open ( int ) ; void PLC_lc ( int ) ; void PLC_scc ( int ) ; void chk_tagmsg( void ) ; void kp_f_read( void ) ;
// DgtliPrt.h
// This file has declarations of procedures used to display data on // the screen in the gin which is the computer that is being used for // control .
//
// DisplPrt.h
// void βhowCT ( int ) ; void print_display_headings ( void ) ; void display_error ( char error_message[ ] ) ; void display_message ( char message [ ] ) ; void showBA ( void ) ; void showCalBa ( void ) ;
//
// DisplPrt.h
II
II -HVICONST.H-
If
#define ON 1 #define OFF 0 struct color_const
( float cl; float c2; float c3;
); struct cal_const
{ float slope; float offset;
}; struct RB data
{ int flok; // flapper error codes int cok; // color in reasonable range int tok; // trash in reasonable range int mok; // moisture in reasonable range long ctsn; float m; // moisture reading float y; // color y float z; // color z float rd; // color Rd float pb; // color +b int cc; // color code int cq; // color quad. float area; // trash area - raw float count; // trash count float leaf; // trash leaf code float areape; // percent area of trash int empg; int gsuse; // code for which gin stands are running int llight; // reading of intensity of one light int rlight; // reading of intensity of other light
};
Figure imgf000270_0001
struct moiβt_color_trash_entry
{ int moist; int color; int trash;
};
//
// HVICONST.H
// This file is a declaration of procedures used in the main program.
// These procedures mostly have to do with getting the program started
// and doing the basic control of data collection. It also has
// procedures having to do with calculating means and nodes of the
// data that has been collected and running autocalibration.
// - IcadvPrt.h
// void getbalen ( void void setup ( void void openmenu ( void void getdata ( void void getdata2 ( void int wait_closure (int ) ; void εample_CT ( int void runscreen ( void void getdata ( void void inc_bt ( int void calo ba ( void void inc_En ( int void dec_bn ( int void autocal ( int int do_freq ( void
// IcadvPrt.h
// These procedures have to do with
// logging data to either the hard disk on the computer thats being
// used to control or on a network so that the data is available on a
// separate computer in the office of the gin. // // LogDaPrt.h void open_data_save_file ( int, int, int) ; void dsk_save ( void ) ; void dsk_colcal ( int ) ; void dsk#_trscal ( int ) ; void dsk~βave_av ( void ) ; void dsk_βave_cal_tile( int ) ; void rec_ctile int ) ; void bs_dsk_save long int. int ) ; void balm_dsk_save ( void ) ; void tm_dsk_βave ( void ) ; void bdat_dsk_pass ( void ) ; void ba_dsk pass ( void ) ; void other dsk_pass ( void ) ; void pt_dsl _βave ( void ) ;
// // — LogDaPrt . h
// This file contains declarations of procedures in "trashf.c" and are
// related to the frame grabber and trash measurements.
//
// TrashPrt.h
// void setup_trash(int) ; int β tart_f g ( void ) ; void f reeze_f rame ( void ) ; void do a_f rame { int ) ; void delay (unsigned int) ; int system (const char*) ; void _dos_getdate (struct dosdate_t* ) ; void _dos_gβttime(βtruct dostime_t*) ; int trsh_cal (int) ; void trash_cal000(vold) ; void trash_cαll00(void) ; void trash_cal200(voJ d) ; int read__tcal(void) ; void do trash (int) ; void caTc_ctile_ad j (int) ; void calc_ctmean( int ) ;
//
// - TrashPrt.h
Figure imgf000275_0001
GREENCCCDAT
Figure imgf000276_0001
51-7 -1235 -1235 -1235 -1235 -1085 -1085 -1085 -1085 -1085 61-2 -1215 -1215 -1215 -1215 -1065 -1065 -1065 -1065 -1065 61-3 -1215 -1215 -1215 -1215 -1065 -1065 -1065 -1065 -1065 61-4 -1215 -1215 -1215 -1215 -1065 -1065 -1065 -1065 -1065 61-5 -1230 -1230 -1230 -1230 -1080 -1080 -1080 -1080 -1080 61-6 -1230 -1230 -1230 -1230 -1080 -1080 -1080 -1080 -1080 61-7 -1505 -1505 -1480 -1480 -1330 -1330 -1330 -1330 -1330 71-2 -1515 -1515 -1500 -1500 -1350 -1350 -1350 -1350 -1350 71-3 -1515 -1515 -1500 -1500 -1350 -1350 -1350 -1350 -1350 71-4 -1515 -1515 -1500 -1500 -1350 -1350 -1350 -1350 -1350 71-5 -1515 -1515 -1500 -1500 -1350 -1350 -1350 -1350 -1350 71-6 -1515 -1515 -1500 -1500 -1350 -1350 -1350 -1350 -1350 71-7 -1515 -1515 -1500 -1500 -1350 -1350 -1350 -1350 -1350 12-2 -530 -530 -375 -280 -130 0 0 0 0 2-3 -535 -535 -380 -290 -140 -10 -10 -10 -10
Figure imgf000276_0002
12-7 -1355 -1355 -1355 -1350 -1200 - 2 - - -
22-2 -530 -530 -375 -280 -130 0 0 0 0
22-3 -535 -535 -380 -290 -140 -10 -10 -10 -10
22-4 -600 -600 -445 -350 -200 -75 -75 -75 -75 GREENCCCDAT
22-5 -695 -695 -560 -530 -380 -290 -290 -290 -290 22-6 -970 -970 -895 -895 -745 -745 -745 -745 -745 22-7 -1355 -1355 -1355 -1350 -1200 -1200 -1200 -1200 -1200
Figure imgf000277_0001
42-7 -1355 -1355 -1355 -1355 -1205 -1205 -1205 -1205 -1205
52-2 -755 -755 -595 -595 -445 -430 -430 -430 -430
52-3 -760 -760 -600 -600 -450 -440 -440 -440 -440
52-4 -945 -945 -880 -880 -730 -730 -730 -730 -730
52-5 -960 -960 -885 -885 -735 -735 -735 -735 -735
52-6 -1365 -1365 -1365 -1365 -1215 -1215 -1215 -1215 -1215
52-7 -1370 -1370 -1370 -1370 -1220 -1220 -1220 -1220 -1220
62-2 -1330 -1330 -1310 -1310 -1160 -1160 -1160 -1160 -1160
62-3 -1330 -1330 -1310 -1310 -1160 -1160 -1160 -1160 -1160
62-4 -1330 -1330 -1310 -1310 -1160 -1160 -1160 -1160 -1160
62-5 -1380 -1380 -1380 -1380 -1230 -1230 -1230 -1230 -1230
62-6 -1380 -1380 -1380 -1380 -1230 -1230 -1230 -1230 -1230
13-2 -850 -850 -740 -710 -560 -560 -560 -560 -560
13-3 -930 -930 -820 -820 -670 -670 -670 -670 -670
13-4 _94o -940 -830 -830 -680 -680 -680 -680 -680
13-5 -1185 -1185 -1150 -1135 -985 -985 -985 -985 -985
13-6 -1420 -1420 -1410 -1410 -1260 -1260..-1260 -1260 -1260
13-7 -1625 -1625 -1595 -1595 -1445 -1445 -1445 -1445 -1445
23-2 -850 -850 -740 -710 -560 -560 -560 -560 -560
23-3 -930 -930 -820 -820 -670 -670 -670 -670 -670
23-4 -940 -940 -830 -830 -680 -680 -680 -680 -680
23-5 -1185 -1185 -1150 -1135 -985 -985 -985 -985 -985
23-6 -1420 -1420 -1410 -1410 -1260 -1260 -1260 -1260 -1260
23-7 -1625 -1625 -1595 -1595 -1445 -1445 -1445 -1445 -1445
33-2 -930 -930 -820 -820 -670 -670 -670 -670 -670
33-3 -930 -930 -820 -820 -670 -670 -670 -670 -670
33-4 -1175 -1175 -1135 -1130 -980 -980 -980 -980 -980
33-5 -1185 -1185 -1150 -1135 -985 -985 -985 -985 -985
33-6 -1420 -1420 -1410 -1410 -1260 -1260 -1260 -1260 -1260
33-7 -1625 -1625 -1595 -1595 -1445 -1445 -1445 -1445 -1445
43-2 -940 -940 -905 -905 -755 -755 -755 -755 -755
43-3 -1190 -1190 -1190 -1190 -1040 -1040 -1040 -1040 -1040
43-4 -1190 -1190 -1190 -1190 -1040 -1040 -1040 -1040 -1040
43-5 -1455 -1455 -1455 -1455 -1305 -1305 -1305 -1305 -1305
43-6 -1460 -1460 -1460 -1460 -1310 -1310 -1310 -1310 -1310
43-7 -1630 -1630 -1620 -1620 -1470 -1470 -1470 -1470 -1470
53-2 -1210 -1210 -1210 -1210 -1060 -1060 -1060 -1060 -1060 GREENCCCDAT
Figure imgf000278_0001
UPLNDCOL.DAT
40040812
40041812
40042812
40043812
40044812
40045812
40046812
40047812
40048812
40049812
40050812
40051812
40052812
40053812
40054812
40055812
40056812
40057812
40058812
40059812
40060812
40061812
40062812
40063812
40064812
40065812
40066812
40067812
40068812
40069812
40070812
40071812
40072812
40073812
40074812
40075812
40076812
40077812
40078812
40079812
40080812
40081812
40082833
40083833
40084833
40085833
40086833
40087833
40088833 40089833
40090833
40091833
40092833
40093833
40094833
40095833
40096833
40097833
40098833
40099833
40100833
40101833
40102833
40103833
40104833
40105833
40106833
40107845
40108845
40109845
40110845
40111845
40112845
40113845
40114845
40115845
40116845
40117845
40118845
40119845
40120845
40121845
40122845
40123845
40124845
40125845
40126845
40127845
40128845
40129845
40130845
40131855
40132855
40133855
40134855
40135855
40136855
40137855
40138855
40139855 40140855 40141855 40142855 40143855 40144855 40145855 40146855 40147855 40148855 40149855 40150855 40151855 40152855 40153855 40154855 40155855 40156855 40157855 40158855 40159855 40160855 40161855 40162855 40163855 40164855 40165855 40166855 40167855 40168855 40169855 40170855 40171855 40172855 40173855 40174855 40175855 40176855 40177855 40178855 40179855 40180855 41040812 41041812 41042812 41043812 41044812 41045812 41046812 41047812 41048812 41049812 41050812
41051812
41052812
41053812
41054812
41055812
41056812
41057812
410.58812
41059812
41060812
41061812
41062812
41063812
41064812
41065812
41066812
41067812
41068812
41069812
41070812
41071812
41072812
41073812
41074812
41075812
41076812
41077812
41078812
41079812
41080812
41081812
41082833
41083833
41084833
41085833
41086833
41087833
41088833
41089833
41090833
41091833
41092833
41093833
41094833
41095833
41096833
41097833
41098833
41099833
41100833 41101833 41102833 41103833 41104833 41105833 41106833 41107845 41108845 41109845 41110845 41111845 41112845 41113845 41114845 41115845 41116845 41117845 41118845 41119845 41120845 41121845 41122845 41123845 41124845 41125845 41126845 41127845 41128845 41129845 41130845 41131845 41132855 41133855 41134855 41135855 41136855 41137855 41138855 41139855 41140855 41141855 41142855 41143855 41144855 41145855 41146855 41147855 41148855 41149855 41150855 41151855 41152855
41153855
41154855
41155855
41156855
41157855
41158855
41159855
41160855
41161855
41162855
41163855
41164855
41165855
41166855
41167855
41168855
41169855
41170855
41171855
41172855
41173855
41174855
41175855
41176855
41177855
41178855
41179855
41180855
42040812
42041812
42042812
42043812
42044812
42045812
42046812
42047812
42048812
42049812
42050812
42051812
42052812
42053812
42054812
42055812
42056812
42057812
42058812
42059812
42060812
42061812 42062812
42063812
42064812
42065812
42066812
42067812
42068812
42069812
42070812
42071812
42072812
42073812
42074812
42075812
42076812
42077812
42078812
42079812
42080812
42081812
42082833
42083833
42084833
42085833
42086833
42087833
42088833
42089833
42090833
42091833
42092833
42093833
42094833
42095833
42096833
42097833
42098833
42099833
42100833
42101833
42102833
42103833
42104833
42105833
42106833
42107845
42108845
42109845
42110845
42111845
42112845
42113845
42114845
42115845
42116845
42117845
42118845
42119845
42120845
42121845
42122845
42123845
42124845
42125845
42126845
42127845
42128845
42129845
42130845
42131845
42132855
42133855
42134855
42135855
42136855
42137855
42138855
42139855
42140855
42141855
42142855
42143855
42144855
42145855
42146855
42147855
42148855
42149855
42150855
42151855
42152855
42153855
42154855
42155855
42156855
42157855
42158855
42159855
42160855
42161855
42162855
42163855 42164855 42165855 42166855 42167855 42168855 42169855 42170855 42171855 42172855 42173855 42174855 42175855 42176855 42177855 42178855 42179855 42180855 43040812 43041812 43042812 43043812 43044812 43045812 43046812 43047812 43048812 43049812 43050812 43051812 43052812 43053812 43054812 43055812 43056812 43057812 43058812 43059812 43060812 43061812 43062812 43063812 43064812 43065812 43066812 43067812 43068812 43069812 43070812 43071812 43072812 43073812 43074812
43075812
43076812
43077812
43078812
43079812
43080812
43081812
43082833
43083833
43084833
43085833
43086833
43087833
43088833
43089833
43090833
43091833
43092833
43093833
43094833
43095833
43096833
43097833
43098833
43099833
43100833
43101833
43102833
43103833
43104833
43105833
43106833
43107833
43108845
43109845
43110845
43111845
43112845
43113845
43114845
43115845
43116845
43117845
43118845
43119845
43120845
43121845
43122845
43123845
43124845 43125845
43126845
43127845
43128845
43129845
43130845
43131845
43132855
43133855
43134855
43135855
43136855
43137855
43138855
43139855
43140855
43141855
43142855
43143855
43144855
43145855
43146855
43147855
43148855
43149855
43150855
43151855
43152855
43153855
43154855
43155855
43156855
43157855
43158855
43159855
43160855
43161855
43162855
43163855
43164855
43165855
43166855
43167855
43168855
43169855
43170855
43171855
43172855
43173855
43174855
43175855 43176855
43177855
43178855
43179855
43180855
44040812
44041812
44042812
44043812
44044812
44045812
44046812
44047812
44048812
44049812
44050812
44051812
44052812
44053812
44054812
44055812
44056812
44057812
44058812
44059812
44060812
44061812
44062812
44063812
44064812
44065812
44066812
44067812
44068812
44069812
44070812
44071812
44072812
44073812
44074812
44075812
44076812
44077812
44078812
44079812
44080812
44081812
44082833
44083833
44084833
44085833
44086833
44087833
44088833
44089833
44090833
44091833
44092833
44093833
44094833
44095833
44096833
44097833
44098833
44099833
44100833
44101833
44102833
44103833
44104833
44105833
44106833
44107833
44108845
44109845
44110845
44111845
44112845
44113845
44114845
44115845
44116845
44117845
44118845
44119845
44120845
44121845
44122845
44123845
44124845
44125845
44126845
44127845
44128844
44129844
44130844
44131844
44132844
44133855
44134855
44135855
44136855 44137855
44138855
44139855
44140855
44141855
44142855
44143855
44144855
44145855
44146855
44147855
44148855
44149855
44150855
44151855
44152855
44153855
44154855
44155855
44156855
44157855
44158855
44159855
44160855
44161855
44162855
44163855
44164855
44165855
44166855
44167855
44168855
44169855
44170855
44171855
44172855
44173855
14174855
44175855
44176855
44177855
44178855
44179855
44180855
45040812
45041812
45042812
45043812
45044812
45045812
45046812
45047812
45048812
45049812
45050812
45051812
45052812
45053812
45054812
45055812
45056812
45057812
45058812
45059812
45060812
45061812
45062812
45063812
45064812
45065812
45066812
45067812
45068812
45069812
45070812
45071812
45072812
45073812
45074812
45075812
45076812
45077812
45078812
45079812
45080812
45081812
45082833
45083833
45084833
45085833
45086833
45087833
45088833
45069833
45090833
45091833
45092833
45093833
45094833
45095833
45096833
45097833
45098833
45099833
45100833
45101833
45102833
45103833
45104833
45105833
45106833
45107833
45108845
45109845
45110845
45111845
45112845
45113845
45114845
45115845
45116845
45117845
45118845
45119845
45120844
45121844
45122844
45123844
45124844
45125844
45126844
45127844
45128844
45129844
45130844
45131844
45132844
45133855
45134855
45135855
45136855
45137855
45138855
45139855
45140855
45141855
45142855
45143855
45144855
45145855
45146855
45147855
Λ«1 Aftft«?ς 45149855 45150855 45151855 45152855 45153855 45154855 45155855 45156855 45157855 45158855 45159855 45160855 45161855 45162855 45163855 45164855 45165855 45166855 45167855 45168855 45169855 45170855 45171855 45172855 45173855 45174855 45175855 45176855 45177855 45178855 45179854 45180854 46040812 46041812 46042812 46043812 46044812 46045812 46046812 46047812 46048812 46049812 46050812 46051812 46052812 46053812 46054812 46055812 46056812 46057812 46058812 46059812
46060812
46061812
46062812
46063812
46064812
46065812
46066812
46067812
46068812
46069812
46070812
46071812
46072812
46073812
46074812
46075812
46076812
46077812
46078812
46079812
46080812
46081812
46082812
46083833
46084833
46085833
46086833
46087833
46088833
46089833
46090833
46091833
46092833
46093833
46094833
46095833
46096833
46097833
46098833
46099833
46100833
46101833
46102833
46103833
46104833
46105833
46106833
46107833
46108845
46109845 46110845
46111845
46112844
46113844
46114844
46115844
46116844
46117844
46118844
46119844
46120844
46121844
46122844
46123844
46124844
46125844
46126844
46127844
46128844
46129844
46130844
46131844
46132844
46133843
46134855
46135855
46136855
46137855
46138855
46139855
46140855
46141855
46142855
46143855
46144855
46145855
46146855
46147855
46148855
46149855
46150855
46151855
46152855
46153855
46154855
46155855
46156855
46157855
46158855
46159855
46160855 46161855
46162855
46163855
46164855
46165855
46166855
46167855
46168855
46169855
46170855
46171855
46172855
46173855
46174854
46175854
46176854
46177854
46178854
46179854
46180854
47040812
47041812
47042812
47043812
47044812
47045812
47046812
47047812
47048812
47049812
47050812
47051812
47052812
47053812
47054812
47055812
4705681?
47057812
47058812
47059812
47060812
47061812
47062812
47063812
47064812
47065812
47066812
47067812
47068812
47069812
47070812 47071812
47072812
47073812
47074812
47075812
47076812
47077812
47078812
47079812
47080812
47081811
47082811
47083833
47084833
47085833
47086833
47087833
47088833
47089833
47090833
47091833
47092833
47093833
47094833
47095833
47096833
47097833
47098833
47099833
47100833
47101833
47102833
47103833
47104833
47105832
47106832
47107832
47108832
47109844
47110844
47111844
47112844
47113844
47114844
47115844
47116844
47117844
47118844
47119844
47120844
47121844 47122844
47123844
47124844
47125844
47126843
47127843
47128843
47129843
47130843
47131843
47132843
47133843
47134855
47135855
47136855
47137855
47138855
47139855
47140855
47141855
47142855
47143855
47144855
47145855
47146855
47147855
47148855
47149855
47150855
47151855
47152855
47153855
47154855
47155855
47156855
47157855
47158855
47159855
47160855
47161855
47162855
47163855
47164855
47165855
47166855
47167855
47168854
47169854
47170854
47171854
47172854 47173854
47174854
47175854
47176854
47177854
47178854
47179853
47180853
48040812
48041812
48042812
48043812
48044812
48045812
48046812
48047812
48048812
48049812
48050812
48051812
48052812
48053812
48054812
48055812
48056812
48057812
48058812
48059812
48060812
48061812
48062812
48063812
48064812
48065812
48066812
48067812
48068812
48069812
48070812
48071812
48072812
48073811
48074811
48075811
48076811
48077811
48078811
48079811
48080811
48081811
48082811 48083833
48084833
48085833
48086833
48087833
48088833
48089833
48090833
48091833
48092833
48093833
48094833
48095833
48096833
48097833
48098832
48099832
48100832
48101832
48102832
48103832
48104832
48105832
48106832
48107832
48108832
48109844
48110844
48111844
48112844
48113844
48114844
48115844
48116844
48117844
48118844
48119843
48120843
48121843
48122843
48123843
48124843
48125843
48126843
48127843
48128843
48129843
48130843
48131843
48132843
48133843
48134843
48135855
48136855
48137855
48138855
48139855
48140855
48141855
48142855
48143855
48144855
48145855
48146855
48147855
48148855
48149855
48150855
48151855
48152855
48153855
48154855
48155855
48156855
48157855
48158855
48159855
48160855
48161855
48162855
48163854
48164854
48165854
48166854
48167854
48168854
48169854
48170854
48171854
48172854
48173854
48174853
48175853
48176853
48177853
48178853
48179853
48180853
49040812
49041812
49042812
49043812
49044812
49045812
49046812
49047812
49048812
49049812
49050812
49051812
49052812
49053812
49054812
49055812
49056812
49057812
49058812
49059812
49060812
49061812
49062812
49063812
49064812
49065811
49066811
49067 11
49068811
49069811
49070811
49071811
49072811
49073811
49074811
49075811
49076811
49077811
49078811
49079811
49080811
49081811
49082811
49083833
49084833
49085833
49086833
49087833
49088833
49089833
49090833
49091833
49092832
49093832
49094832 49095832
49096832
49097832
49098832
49099832
49100832
49101832
49102832
49103832
49104832
49105832
49106832
49107832
49108832
49109844
49110844
49111844
49112844
49113843
49114843
49115843
49116843
49117843
49118843
49119843
49120843
49121843
49122843
49123843
49124843
49125843
49126843
49127843
49128843
49129843
49130842
49131842
49132842
49133842
49134842
49135855
49136855
49137855
49138855
49139855
49140855
49141855
49142855
49143855
49144855
49145855 49146855
49147855
49148855
49149855
49150855
49151855
49152855
49153855
49154855
49155855
49156855
49157855
49158854
49159854
49160854
49161854
49162854
49163854
49164854
49165854
49166854
49167854
49168854
49169853
49170853
49171853
49172853
49173853
49174853
49175853
49176853
49177853
49178853
49179852
49180852
50040812
50041812
50042812
50043812
50044812
50045812
50046812
50047812
50048812
50049812
50050812
50051812
50052812
50053812
50054812
50055812 50056811
50057811
50058811
50059811
50060811
50061811
50062811
50063811
50064811
50065811
50066811
50067811
50068811
50069811
50070811
50071811
50072811
50073811
50074811
50075811
50076811
50077811
50078811
50079811
50080811
50081811
50082811
50083833
50084833
50085822
50086822
50087832
50088832
50089832
50090832
50091832
50092832
50093832
50094832
50095832
50096832
50097832
50098832
50099832
50100832
50101832
50102832
50103832
50104832
50105832
50106832 50107831
50108831
50109831
50110843
50111843
50112843
50113843
50114843
50115843
50116843
50117843
50118843
50119843
50120843
50121843
50122843
50123843
50124843
50125842
50126842
50127842
50128642
50129842
50130842
50131842
50132842
50133842
50134842
50135842
50136855
50137855
50138855
50139855
50140855
50141855
50142855
50143855
50144855
50145855
50146855
50147855
50148855
50149855
50150855
50151855
50152854
50153854
50154854
50155854
50156854
50157854 50158854
50159854
50160854
50161854
50162854
50163854
50164853
50165853
50166853
50167853
50168853
50169853
50170853
50171853
50172853
50173853
50174852
50175852
50176852
50177852
50178852
50179852
50180852
51040812
51041812
51042812
51043812
51044812
51045812
51046812
51047812
51048811
51049811
51050811
51051811
51052811
51053811
51054811
51055811
51056811
51057811
51058811
51059811
51060811
51061811
51062811
51063811
51064811
51065811
51066811
51067811 51068811
51069811
51070811
51071811
51072811
51073811
51074811
51075811
51076811
51077714
51078714
51079714
51080714
51081714
51082714
51083714
51084822
51085822
51086822
51087832
51088832
51089832
51090832
51091832
51092832
51093832
51094832
51095832
51096832
51097832
51098832
51099832
51100831
51101831
51102831
51103831
51104831
51105831
51106831
51107831
51108831
51109831
51110843
51111843
51112843
51113843
51114843
51115843
51116843
51117843
51118843 51119842 51120842 51121842 51122842 51123842 51124842 51125842 51126842 51127842 51128842 51129842 51130842 51131842 51132842 51133842 51134841 51135841 51136855 51137855 51138855 51139855 51140855 51141855 51142855 51143855 51144855 51145855 51146855 51147854 51148854 51149854 51150854 51151854 51152854 51153854 51154854 51155854 51156854 51157854 51158854 51159853 51160853 51161853 51162853 51163853 51164853 51165853 51166853 51167853 51168853 51169852 51170852
51171852
51172852
51173852
51174852
51175852
51176852
51177852
51178852
51179851
51180851
52040811
52041811
52042811
52043811
52044811
52045811
52046811
52047811
52048811
52049811
52050811
52051811
52052811
52053811
52054811
52055811
52056811
52057811
52058811
52059811
52060811
52061811
52062811
52063811
52064811
52065811
52066811
52067811
52068811
52069811
52070714
52071714
52072714
52073714
52074714
52075714
52076714
52077714
52078714
52079714 52080714 52081714 52082714 52083714 52084822 52085822 52086822 52087832 52088832 52089832 52090832 52091832 52092832 52093832 52094831 52095831 52096831 52097831 52098831 5209SS31 52100831 52101831 52102831 52103831 52104831 52105831 52106831 52107831 52108831 52109831 52110831 52111843 52112843 52113842 52114842 52115842 52116842 52117842 52118842 52119842 52120842 52121842 52122842 52123842 52124842 52125842 52126842 52127842 52128841 52129841 52130841 52131841
52132841
52133841
52134841
52135841
52136841
52137855
52138855
52139855
52140855
52141855
52142854
52143854
52144854
52145854
52146854
5214785
52148854
52149854
52150854
52151854
52152854
52153854
52154853
52155853
52156853
52157853
52158853
52159853
52160853
52161853
52162853
52163853
52164853
52165852
52166852
52167852
52168852
52169852
52170852
52171857
52172852
52173852
52174851
52175tt51
52174851
52177851
52178851
52179851
£2180851
R OilΛfll 1 53041811
53042811
53043811
53044811
53045811
53046811
53047811
53048811
53049811
53050811
53051811
53052811
53053811
53054811
53055811
53056811
53057811
53058811
53059811
53060811
53061811
53062811
53063712
53064712
53065712
53066714
53067714
53068714
53069714
53070714
53071714
53072714
53073714
53074714
53075714
53076714
53077714
53078714
53079714
53080714
53081714
53082714
53083714
53084822
53085822
53086822
53087821
53088831
53089831
53090831
53091831 53092831 53093831 53094831 53095831 53096831 53097831 53098831 53099831 53100831 53101831 53102831 53103831 53104831 53105831 53106831 53107634 53108634 53109634 53110634 53111842 53112842 53113842 53114842 53115842 53116842 53117842 53118842 53119842 53120842 53121842 53122842 53123841 53124841 53125841 53126841 53127841 53128841 53129841 53130841 53131841 53132841 53133841 53134841 53135841 53136841 53137544 53138854 53139854 53140854 53141854 53142854 53143854
53144854
53145854
53146854
53147854
53148854
53149853
53150853
53151853
53152853
53153853
53154853
53155853
53156853
53157853
53158853
53159853
53160852
53161852
53162852
53163852
53164852
53165852
53166852
53167852
53168852
53169852
53170851
53171851
53172851
53173851
53174851
53175851
53176851
53177851
53178851
53179352
53180352
54040811
54041811
54042811
54043811
54044811
54045811
54046811
54047811
54048811
54049811
54050811
54051811
54052811 54053811
54054811
54055811
54056712
54057712
54058712
54059712
54060712
54061712
54062712
54063712
54064712
54065712
54066714
54067714
54068714
54069714
54070714
54071714
54072714
54073714
54074714
54075714
54076714
54077714
54078714
54079714
54080714
54081713
54082713
54083711.
54084713
54085821
54086821
54087821
54088831
54089831
54090831
54091831
54092831
54093831
54094831
54095831
54096831
54097831
54098831
54099831
54100831
54101634
54102634
54103634 54104634
54105634
54106634
54107634
54108634
54109634
54110634
54111634
54112842
54113842
54114842
54115842
54116842
54117841
54118841
54119841
54120841
54121841
54122841
54123841
54124841
54125841
54126841
54127841
54128841
54129841
54130841
54131841
54132544
54133544
54134544
54135544
54136544
54137544
54138544
54139854
54140854
54141854
54142854
54143854
54144853
54145853
54146853
54147853
54148853
54149853
54150853
54151853
54152853
54153853
54154853 54155852
54156852
54157852
54158852
54159852
54160852
54161852
54162852
54163852
54164852
54165851
54166851
54167851
54168851
54169851
54170851
54171851
54172851
54173851
54174851
54175352
54176352
54177352
54178352
54179352
54180352
55040811
55041811
55042811
55043811
55044811
55045811
55046811
55047811
55048811
55049712
55050712
55051712
55052712
55053712
55054712
55055712
55056712
55057712
55058712
55059712
55060712
55061712
55062712
55063712
55064712 55065712 55066714 55067714 55068714 55069714 55070714 55071714 55072714 55073714 55074714 55075713 55076713 55077713 55078713 55079713 55080713 55081713 55082713 55083713 55084713 55085821 55086821 55087821 55088831 55089831 55090831 55091831 55092831 55093831 55094831 55095632 55096632 55097632 55098632 55099632 55100634 55101634 55102634 55103634 55104634 55105634 55106634 55107634 55108634 55109634 55110634 55111634 55112841 55113841 55114841 55115841 55116841
55117841
55118841
55119841
55120841
55121841
55122841
55123841
55124841
55125841
55126544
55127544
55128544
55129544
55130544
55131544
55132544
55133544
55134544
55135544
55136544
55137544
55138544
55139543
55140853
55141853
55142853
55143853
55144853
55145853
55146853
55147853
55148853
55149853
55150853
55151852
55152852
55153852
55154852
55155852
55156852
55157852
55158852
55159852
55160852
55161851
55162851
55163851
55164851
55165851
55166851 55167851 55168851 55169851 55170352 55171352 55172352 55173352 55174352 55175352 55176352 55177352 55178352 55179351 55180351 56040811 56041712 56042712 56043712 56044712 56045712 56046712 56047712 56048712 56049712 56050712 56051712 56052712 56053712 56054712 56055712 56056712 56057712 56058712 56059712 56060712 56061712 56062712 56063712 56064712 56065712 56066712 56067714 56068713 56069713 56070713 56071713 56072713 56073713 56074713 56075713 56076713 56077713 56078713 56079713 56080713 56081713 56082713 56083713 56084713 56085821 56086821 56087821 56088821 56089632 56090632 56091632 56092632 56093632 56094632 56095632 56096632 56097632 56098632 56099632 56100632 56101634 56102634 56103634 56104634 56105634 56106633 56107633 56108633 56109633 56110633 56111633 56112633 56113841 56114841 56115841 56116841 56117841 56118841 56119841 56120841 56121542 56122542 56123542 56124542 56125542 56126544 56127544 56128544 56129544 56130544 56131544 56132544 56133544 56134543 56135543 56136543 56137543 56138543 56139543 56140543 56141853 56142853 56143853 56144853 56145853 56146852 56147852 56148852 56149852 56150852 56151852 56152852 56153852 56154852 56155852 56156851 56157851 56158851 56159851 56160851 56161851 56162851 56163851 56164851 56165851 56166352 56167352 56168352 56169352 56170352 56171352 56172352 56173352 56174352 56175351 56176351 56177351 56178351 56179351
56180351
57040712
57041712
57042712
57043712
57044712
57045712
57046712
57047712
57048712
57049712
57050712
57051712
57052712
57053712
57054712
57055712
57056712
57057712
57058712
57059712
57060712
57061711
57062711
57063711
57064711
57065711
57066711
57067713
57068713
57069713
57070713
57071713
57072713
57073713
57074713
57075713
57076713
57077713
57078713
57079713
57080713
57081713
57082713
57083622
57084622
57085622
57086622
57087622
57088622 57089632 57090632 57091632 57092632 57093632 57094632 57095632 57096632 57097632 57098632 57099632 57100632 57101633 57102633 57103633 57104633 57105633 57106633 57107633 57108633 57109633 57110633 57111633 57112633 57113633 57114841 57115841 57116542 57117542 57118542 57119542 57120542 57121542 57122542 57123542 57124542 57125542 57126542 57127544 57128544 57129543 57130543 57131543 57132543 57133543 57134543 57135543 57136543 57137543 5713B543 57139543 57140543
57141444
57142852
57143852
57144852
57145852
57146852
57147852
57148852
57149852
57150852
57151852
57152851
57153851
57154851
57155851
57156851
57157851
57158851
57159851
57160851
57161851
57162352
57163352
57164352
57165352
57166352
57167352
57168352
57169352
57170351
57171351
57172351
57173351
57174351
57175351
57176351
57177351
57178351
57179252
57180252
58040712
58041712
58042712
58043712
58044712
58045712
58046712
58047712
58048712
58049712 58050712
58051712
58052712
58053712
58054711
58055711
58056711
58057711
58058711
58059711
58060711
58061711
58062711
58063711
58064711
58065711
58066711
58067711
58068713
58069713
58070713
58071713
58072713
58073713
58074713
58075713
58076614
58077614
58078614
58079622
58080622
58081622
58082622
58083622
58084622
58085622
58086622
58087622
58088622
58089622
58090632
58091632
58092632
58093632
58094632
58095631
58096631
58097631
58098631
58099631
58100631 58101631
58102633
58103633
58104633
58105633
58106633
58107633
58108633
58109633
58110633
58111534
58112534
58113534
58114542
58115542
58116542
58117542
58118542
58119542
58120542
58121542
58122542
58123542
58124541
58125541
58126541
58127541
58128543
58129543
58130543
58131543
58132543
58133543
58134543
58135543
58136444
58137444
58138444
58139444
58140444
58141444
58142444
58143852
58144852
58145852
58146852
58147851
58148851
58149851
58150851
58151851 58152851
58153851
58154851
58155851
58156851
58157352
58158352
58159352
58160352
58161352
58162352
58163352
58164352
58165352
58166351
58167351
58168351
58169351
58170351
58171351
58172351
58173351
58174351
58175252
58176252
58177252
58178252
58179252
58180252
59040712
59041712
59042712
59043712
59044712
59045712
59046712
59047711
59048711
59049711
59050711
59051711
59052711
59053711
59054711
59055711
59056711
59057711
59058711
59059711
59060711
59061711 59062711
59063711
59064711
59065711
59066711
59067711
59068713
59069713
59070614
59071614
59072614
59073614
59074614
59075614
59076614
59077614
59078614
59079622
59080622
59081622
59082622
59083622
59084622
59085622
59086622
59087622
59088622
59089621
59090621
59091631
59092631
59093631
59094631
59095631
59096631
59097631
59098631
59099631
59100631
59101631
59102631
59103633
59104633
59105534
59106534
59107534
59108534
59109534
59110534
59111534
59112534 59113534
59114534
59115542
59116542
59117542
59118542
59119541
59120541
59121541
59122541
59123541
59124541
59125541
59126541
59127541
59128541
59129543
59130543
59131543
59132444
59133444
59134444
59135444
59136444
59137444
59138444
59139444
59140444
59141444
59142444
59143443
59144851
59145851
59146851
59147851
59148851
59149851
59150851
59151851
59152851
59153352
59154352
59155352
59156352
59157352
59158352
59159352
59160352
59161352
59162351
59163351 59164351
59165351
59166351
59167351
59168351
59169351
59170351
59171252
59172252
59173252
59174252
59175252
59176252
59177252
59178252
59179252
59180252
60040712
60041711
60042711
60043711
60044711
60045711
60046711
60047711
60048711
60049711
60050711
60051711
60052711
60053711
60054711
60055711
60056711
60057711
60058711
60059711
60060711
60061711
60062711
60063711
60064612
60065612
60066612
60067612
60068614
60069614
60070614
60071614
60072614
60073614 60074614 60075614 60076614 60077614 60078614 60079614 60080622 60081622 60082622 60083621 60084621 60085621 60086621 60087621 60088621 60089621 60090621 60091631 60092631 60093631 60094631 60095631 60096631 60097631 60098631 60099631 60100532 60101532 60102532 60103534 60104534 60105534 60106534 60107534 60108534 60109534 60110534 60111534 60112534 60113534 60114533 60115533 60116541 60117541 60118541 60119541 60120541 60121541 60122541 60123541 60124541 60125541
60126541
60127442
60128442
60129442
60130444
60131444
60132444
60133444
60134444
60135444
60136444
60137444
60138443
60139443
60140443
60141443
60142443
60143443
60144443
60145851
60146851
60147851
60148851
60149352
60150352
60151352
60152352
60153352
60154352
60155352
60156352
60157352
60158351
60159351
60160351
60161351
60162351
60163351
60164351
60165351
60166351
60167252
60168252
60169252
60170252
60171252
60172252
60173252
60174252
60175252 60176252
60177252
60178252
60179252
60180252
61040711
61041711
61042711
61043711
61044711
61045711
61046711
61047711
61048711
61049711
61050711
61051711
61052711
61053711
61054711
61055711
61056711
61057711
61058612
61059612
61060612
61061612
61062612
61063612
61064612
61065612
61066612
61067612
61068612
61069614
61070614
61071614
61072614
61073614
61074614
61075614
61076614
61077614
61078613
61079613
61080613
61081621
61082621
61083621
61084621
61085621 61086621
61087621
61088621
61089621
61090621
61091621
61092631
61093631
61094631
61095532
61096532
61097532
61098532
61099532
61100532
61101532
61102532
61103532
61104534
61105534
61106534
61107534
61108534
61109533
61110533
61111533
61112533
61113533
61114533
61115533
61116533
61118541
61119541
61120541
61121541
61122442
61123442
61124442
61125442
61126442
61127442
61128442
61129442
61130442
61131444
61132444
61133444
61134443
61135443
61136443 61137443
61138443
61139443
61140443
61141443
61142443
61143443
61144344
61145344
61146352
61147352
61148352
61149352
61150352
61151352
61152352
61153351
61154351
61155351
61156351
61157351
61158351
61159351
61160351
61161351
61162252
61163252
61164252
61165252
61166252
61167252
61168252
61169252
61170252
61171252
61172252
61173252
61174252
61175252
61176252
61177251
61178251
61179251
61180251
62040711
62041711
62042711
62043711
62044711
62045711
62046711 62047711
62048711
62049711
62050711
62051612
62052612
62053612
62054612
62055612
62056612
62057612
62058612
62059612
62060612
62061612
62062612
62063612
62064612
62065612
62066612
62067612
62068612
62069612
62070614
62071614
62072613
62073613
62074613
62075613
62076613
62077613
62078613
62079613
62080613
62081621
62082621
62083621
62084621
62085621
62086621
62087621
62088621
62089621
62090522
62091522
62092522
62093532
62094532
62095532
62096532
62097532 62098532
62099532
62100532
62101532
62102532
62103532
62104532
6210557.3
62106533
62107533
62108533
62109533
62110533
62111533
62112533
62113533
62114533
62115533
62116533
62117533
62118442
62119442
62120442
62121442
62122442
62123442
62124442
62125442
62126442
62127442
62128442
62129441
62130441
62131441
62132443
62133443
62134443
62135443
62136443
62137443
62138443
62139344
62140344
62141344
62142344
62143344
62144344
62145344
62146344
62147344
62148352 62149351
62150351
62151351
62152351
62153351
62154351
62155351
62156351
62157252
62158252
62159252
62160252
62161252
62162252
62163252
62164252
62165252
62166252
62167252
62168252
62169252
62170252
62171252
62172251
62173251
62174251
62175251
62176251
62177251
62178251
62179251
62180251
63040711
63041711
63042711
63043711
63044711
63045612
63046612
63047612
63048612
63049612
63050612
63051612
63052612
63053612
63054612
63055612
63056612
63057612
63058612 63059612
63060612
63061612
63062612
63063612
63064612
63065612
63066611
63067611
63068611
63069611
63070611
63071613
63072613
63073613
63074613
63075613
63076613
63077613
63078613
63079613
63080613
63081613
63082621
63083621
63084522
63085522
63086522
63087522
63088522
63089522
63090522
63091522
63092522
63093522
63094532
63095532
63096532
63097532
63098532
63099532
63100531
63101531
63102531
63103531
63104531
63105531
63106533
63107533
63108533
63109533 63110533
63111533
63112533
63113434
63114434
63115434
63116434
63117434
63118434
63119442
63120442
63121442
63122442
63123442
63124442
63125441
63126441
63127441
63128441
63129441
63130441
63131441
63132441
63133443
63134443
63135344
63136344
63137344
63138344
63139344
63140344
63141344
63142344
63143344
63144343
63145343
63146343
63147343
63148343
63149351
63150351
63151351
63152351
63153252
63154252
63155252
63156252
63157252
63158252
631592S2
63160252 63161252
63162252
63163252
63164252
63165252
63166252
63167251
63168251
63169251
63170251
63171251
63172251
63173251
63174251
63175251
63176251
63177251
63178251
63179251
63180251
64040612
64041612
64042612
64043612
64044612
64045612
64046612
64047612
64048612
64049612
64050612
64051612
64052612
64053612
64054612
64055612
64056612
64057612
64058612
64059612
64060611
64061611
64062611
64063611
64064611
64065611
64066611
64067611
64068611
64069611
64070611 64071611
64072613
64073613
64074613
64075613
64076613
64077613
64078613
64079514
64080514
64081514
64082514
64083522
64084522
64085522
64086522
64087522
64088522
64089522
64090522
64091522
64092522
64093522
64094522
64095531
64096531
64097531
64098531
64099531
64100531
64101531
64102531
64103531
64104531
64105531
64106531
64107533
64108533
64109434
64110434
64111434
64112434
64113434
64114434
64115434
64116434
64117434
64118434
64119434
64120442
64121441 64122441
64123441
64124441
64125441
64126441
64127441
64128441
64129441
64130441
64131342
64132342
64133342
64134342
64135344
64136344
64137344
64138344
64139344
64140343
64141343
64142343
64143343
64144343
64145343
64146343
64147343
64148244
64149244
64150244
64151252
04152252
64153252
64154252
64155252
64156252
64157252
64158252
64159252
64160252
64161252
64162252
64163251
64164251
64165251
64166251
64167251
64168251
64169251
64170251
64171251
64172251 64173251
64174251
64175251
64176251
641772S1
64178251
64179251
64180251
65040612
65041612
65042612
65043612
65044612
65045612
65046612
65047612
65048612
65049612
65050612
65051612
65052612
65053612
65054611
65055611
65056611
65057611
65058611
65059611
65060611
65061611
65062611
65063611
65064611
65065611
65066611
65067611
65068611
65069611
65070611
65071611
65072613
65073514
65074514
65075514
65076514
65077514
65078514
65079514
65080514
65081514
65082514 65083514
65084522
65085522
65086522
65087522
65088522
65089522
65090521
65091521
65092521
65093521
65094521
65095521
65096531
65097531
65098531
65099531
65100531
65101531
65102531
65103531
65104432
65105432
65106432
65107432
65108434
65109434
65110434
65111434
65112434
65113434
65114434
65115434
65116433
65117433
65118433
65119433
65120433
65121433
65122441
65123441
65124441
65125441
65126441
65127342
65128342
65129342
65130342
65131342
65132342
65133342 65134342
65135342
65136343
65137343
65138343
65139343
65140343
65141343
65142343
65143343
65144343
65145244
65146244
65147244
65148244
65149244
65150244
65151244
65152252
65153252
65154252
65155252
65156252
65157252
65158252
65159251
65160251
65161251
65162251
65163251
65164251
65165251
65166251
65167251
65168251
65169251
65170251
65171251
65172251
65173251
65174251
65175251
65176251
65177251
65178251
65179251
65180251
66040612
66041612
66042612
66043612 66044612
66045612
66046612
66047612
66048612
66049611
66050611
66051611
66052611
66053611
66054611
66055611
66056611
66057611
66058611
66059611
66060611
66061611
66062611
66063611
66064611
66065611
66066611
66067611
66068512
66069512
66070512
66071512
66072512
66073514
66074514
66075514
66076514
66077514
66078514
66079514
66080514
66081514
66082514
66083514
66084514
66085521
66086521
66087521
66088521
66089521
66090521
66091521
66092521
66093521
66094521 66095521
66096521
66097531
66098531
66099432
66100432
66101432
66102432
66103432
66104432
66105432
66106432
66107432
66108432
66109432
66110434
66111433
66112433
66113433
66114433
66115433
66116433
66117433
66118433
66119433
66120433
66121433
66122334
66123342
66124342
66125342
66126342
66127342
66128342
66129342
66130342
66131341
66132341
66133341
66134341
66135341
66136341
66137341
66138343
66139244
66140244
66141244
66142244
66143244
66144244
66145244 66146244
66147244
66148244
66149244
66150244
66151244
66152244
66153244
66154251
66155251
66156251
66157251
66158251
66159251
66160251
66161251
66162251
66163251
66164251
66165251
66166251
66167251
66168251
66169251
66170251
66171251
66172251
66173251
66174251
66175251
66176251
66177251
66178251
66179251
66180251
67040612
67041612
67042612
67043612
67044611
67045611
67046611
67047611
67048611
67049611
67050611
67051611
67052611
67053611
67054611
67055611 67056611
67057611
67058611
67059611
67060611
67061611
67062611
67063512
67064512
67065512
67066512
67067512
67068512
67069512
67070512
67071512
67072512
67073512
6-O74514
67075514
67076514
67077514
67078514
67079514
67080513
67081513
67082513
67083513
67084513
67085513
67086521
67087521
67088521
67089521
67090521
67091521
67092521
67093521
67094422
67095422
67096422
67097422
67098422
67099432
67100432
67101432
67102432
67103432
67104432
67105432
67106432 67107431
67108431
67109431
67110431
67111433
67112433
67113433
67114433
67115433
67116433
67117334
67110334
67119334
67120334
67121334
67122334
67123334
67124334
67125342
67126342
67127341
67128341
67129341
67130341
67131341
67132341
67133341
67134341
67135242
67136242
67137242
67138242
67139244
67140244
67141244
67142244
67143244
67144244
67145244
67146244
67147244
67148244
67149243
67150243
67151243
67152243
67153243
67154243
67155243
67156251
67157251 67158251
67159251
67160251
67161251
67162251
67163251
67164251
67165251
67166251
67167251
67168251
67169251
67170251
67171251
67172251
67173251
67174251
67175251
67176251
67177251
67178251
67179251
67180251
68040611
68041611
68042611
68043611
68044611
68045611
68046611
68047611
68048611
68049611
68050611
68051611
68052611
68053611
68054611
68055611
68056611
68057512
68058512
68059512
68060512
68061512
68062512
68063512
68064512
68065512
68066512
68067512 68068512 68069512 68070512 68071512 68072512 68073512 68074512 68075511 68076513 68077513 68078513 68079513 68080513 68081513 68082513 68083513 68084513 68085513 68086513 68087513 68088521 68089521 68090422 68091422 68092422 68093422 68094422 68095422 68096422 68097422 68098422 68099422 68100432 68101432 68102431 68103431 68104431 68105431 68106431 68107431 68108431 68109431 68110431 68111431 68112431 68113334 68114334 68115334 68116334 68117334 68118334 68119334
68120334
68121334
68122333
68123333
68124333
68125333
68126341
68127341
68128341
68129341
68130242
68131242
68132242
68133242
68134242
68135242
68136242
68137242
68138242
68139242
68140242
68141244
68142244
68143244
68144243
68145243
68146243
68147243
68148243
68149243
68150243
68151243
68152243
68153243
68154243
68155243
68156243
68157243
68158243
68159251
68160251
68161251
68162251
68163251
68164251
68165251
68166251
68167251
68168251
68169251 68170251
68171251
68172251
68173251
68174251
68175251
68176251
68177251
68178251
68179251
68180251
69040611
69041611
69042611
69043611
69044611
69045611
69046611
69047611
69048611
69049611
69050611
69051611
69052512
69053512
69054512
69055512
69056512
69057512
69058512
69059512
69060512
69061512
69062512
69063512
69064512
69065512
69066512
69067512
69068512
69069512
69070511
69071511
69072511
69073511
69074511
69075511
69076511
69077513
69078513
69079513 69080513
69081513
69082513
69083513
69084513
69085414
69086414
69087414
69088414
69089422
69090422
69091422
69092422
69093422
69094422
69095422
69096422
69097422
69098421
69099421
69100421
69101431
69102431
69103431
69104431
69105431
69106431
69107431
69108431
69109332
69110332
69111332
69112332
69113332
69114334
69115334
69116334
69117334
69118333
69119333
69120333
69121333
69122333
69123333
69124333
69125333
69126234
69127234
69128242
69129242
69130242 69131242
69132242
69133242
69134242
69135242
69136242
69137242
69138242
69139242
69140241
69141241
69142241
69143243
69144243
69145243
69146243
69147243
69148243
69149243
69150243
69151243
69152243
69153243
69154243
69155243
69156243
69157243
69158243
69159243
69160243
69161251
69162251
69163251
69164251
69165251
69166251
69167251
69168251
69169251
69170251
69171251
69172251
69173251
69174251
69175251
69176251
69177251
69178251
69179251
69180251
70040611 70041611
70042611
70043611
70044611
70045611
70046611
70047512
70048512
70049512
70050512
70051512
70052512
70053512
70054512
70055512
70056512
70057512
70058512
70059512
70060512
70061512
70062512
70063512
70064512
70065511
70066511
70067511
70068511
70069511
70070511
70071511
70072511
70073511
70074511
70075511
70076511
70077511
70078513
70079513
70080513
70081414
70082414
70083414
70084414
70085414
70086414
70087414
70088414
70089414
70090422
70091422 70092422
70093422
70094421
70095421
70096421
70097421
70098421
70099421
70100421
70101421
70102421
70103431
70104431
70105332
70106332
70107332
70108332
70109332
70110332
70111332
70112332
70113332
70114331
70115331
70116333
70117333
70118333
70119333
70120333
70121333
70122234
70123234
70124234
70125234
70126234
70127234
70128234
70129242
70130242
70131242
70132242
70133242
70134242
70135242
70136241
70137241
70138241
70139241
70140241
70141241
70142241 70143241
70144241
70145243
70146243
70147243
70148243
70149243
70150243
70151243
70152243
70153243
70154243
70155243
70156243
70157243
70158243
70159243
70160243
70161243
70162243
70163251
70164251
70165251
70166251
70167251
70168251
70169251
70170251
70171251
70172251
70173251
70174251
70175251
70176251
70177251
70178251
70179251
70180251
71040611
71041611
71042611
71043512
71044512
71045512
71046512
71047512
71048512
71049512
71050512
71051512
71052512 71053512
71054512
71055512
71056512
71057512
71058512
71059512
71060512
71061511
71062511
71063511
71064511
71065511
71066511
71067511
71068511
71069511
71070511
71071511
71072511
71073511
71074511
71075511
71076511
71077412
71078412
71079414
71080414
71081414
71082414
71083414
71084414
71085414
71086414
71087414
71088414
71089414
71090413
71091413
71092421
71093421
71094421
71095421
71096421
71097421
71098421
71099421
71100421
71101322
71102322
71103322 71104322
71105332
71106332
71107332
71108332
71109332
71110331
71111331
71112331
71113331
71114331
71115331
71116331
71117331
71118234
71119234
71120234
71121234
71122234
71123234
71124234
71125233
71126233
71127233
71128233
71129233
71130233
71131233
71132241
71133241
71134241
71135241
71136241
71137241
71138241
71139241
71140241
71141241
71142241
71143241
71144241
71145241
71146241
71147243
71148243
71149243
71150243
71151243
71152243
71153243
71154243 71155243
71156243
71157243
71158243
71159243
71160243
71161243
71162243
71163243
71164243
71165251
71166251
71167251
71168251
71169251
71170251
71171251
71172251
71173251
71174251
71175251
71176251
71177251
71178251
71179251
71180251
72040512
72041512
72042512
72043512
72044512
72045512
72046512
72047512
72048512
72049512
72050512
72051512
72052512
72053512
72054512
72055512
72056512
72057511
72058511
72059511
72060511
72061511
72062511
72063511
72064511 72065511
72066511
72067511
72068511
72069511
72070511
72071511
72072511
72073412
72074412
72075412
72076412
72077412
72078412
72079412
72080412
72081414
72082414
72083414
72084414
72085414
72086413
72087413
72088413
72089413
72090413
72091413
72092413
72093413
72094421
72095421
72096322
72097322
72098322
72099322
72100322
72101322
72102322
72103322
72104322
72105322
72106331
72107331
72108331
72109331
72110331
72111331
72112331
72113331
72114232
72115232 72116232 72117232 72118232 72119232 72120234 72121233 72122233 72123233 72124233 72125233 72126233 72127134 72128134 72129134 72130134 72131134 72132134 72133133 72134241 72135241 72136241 72137241 72138241 72139241 72140241 72141241 72142241 72143241 72144241 72145241 72146241 72147241 72148241 72149243 72150243 72151243 72152243 72153243 72154243 72155243 72156243 72157243 72158243 72159243 72160243 72161243 72162243 72163243 72164243 72165243 72166243 72167243
72168251
72169251
72170251
72171251
72172251
72173251
72174251
72175251
72176251
72177251
72178251
72179251
72180251
73040512
73041512
73042512
73043512
73044512
73045512
73046512
73047512
73048512
73049512
73050512
73051511
73052511
73053511
73054511
73055511
73056511
73057511
73058511
73059511
73060511
73061511
73062511
73063511
73064511
73065511
73066511
73067511
73068412
73069412
73070412
73071412
73072412
73073412
73074412
73075412
73076412 73077412 73078412 73079412 73080412 73081411 73082411 73083413 73084413 73085413 73086413 73087413 73088413 73089413 73090413 73091413 73092314 73093314 73094314 73095322 73096322 73097322 73098322 73099322 73100322 73101321 73102321 73103321 73104321 73105321 73106321 73107321 73108331 73109232 73110232 73111232 73112232 73113232 73114232 73115232 73116231 73117231 73118231 73119231 73120231 73121231 73122233 73123134 73124134 73125134 73126134 73127134 73128134
73129133
73130133
73131133
73132133
73133133
73134133
73135133
73136241
73137241
73138241
73139241
73140241
73141241
73142241
73143241
73144241
73145241
73146241
73147241
73148241
73149241
73150241
73151243
73152243
73153243
73154243
73155243
73156243
73157243
73158243
73159243
73160243
73161243
73162243
73163243
73164243
73165243
73166243
73167243
73168243
73169243
73170251
73171251
73172251
73173251
73174251
73175251
73176251
73177251
73178251 73179251
73180251
74040512
74041512
74042512
74043512
74044512
74045511
74046511
74047511
74048511
74049511
74050511
74051511
74052511
74053511
74054511
74055511
74056511
74057511
74058511
74059511
74060511
74061511
74062511
74063412
74064412
74065412
74066412
74067412
74068412
74069412
74070412
74071412
74072412
74073412
74074412
74075412
74076412
74077411
74078411
74079411
74080411
74081411
74082411
74083411
74084413
74085413
74086413
74087413
74088314 74089314
74090314
74091314
74092314
74093314
74094314
74095314
74096314
74097321
74098321
74099321
74100321
74101321
74102321
74103321
74104321
74105222
74106222
74107222
74108222
74109222
74110232
74111232
74112231
74113231
74114231
74115231
74116231
74117231
74118132
74119132
74120132
74121132
74122132
74123132
74124133
74125133
74126133
74127133
74128133
74129133
74130133
74131133
74132133
74133133
74134133
74135133
74136133
74137133
74138241
74139241 74140241
74141241
74142241
74143241
74144241
74145241
74146241
74147241
74148241
74149241
74150241
74151241
74152241
74153241
74154243
74155243
74156243
74157243
74158243
74159243
74160243
74161243
74162243
74163243
74164243
74165243
74166243
74167243
74168243
74169243
74170243
74171243
74172243
74173251
74174251
74175251
74176251
74177251
74178251
74179251
74180251
75040511
75041511
75042511
75043511
75044511
75045511
75046511
75047511
75048511
75049511 75050511
75051511
75052511
75053511
75054511
75055511
75056511
75057511
75058412
75059412
75060412
75061412
75062412
75063412
75064412
75065412
75066412
75067412
75068412
75069412
75070412
75071412
75072411
75073411
75074411
75075411
75076411
75077411
75078411
75079411
75080411
75081411
75082411
75083312
75084312
75085312
75086314
75087314
75088314
75089314
75090314
75091314
75092313
75093313
75094313
75095313
75096313
75097313
75098313
75099321
75100222 75101222
75102222
75103222
75104222
75105222
75106222
75107221
75108221
75109221
75110221
75111221
75112231
75113231
75114132
75115132
75116132
75117132
75118132
75119131
75120131
75121131
75122131
75123131
75124131
75125131
75126133
75127133
75128133
75129133
75130133
75131133
75132133
75133133
75134133
75135133
75136133
75137133
75138133
75139133
75140241
75141241
75142241
75143241
75144241
75145241
75146241
75147241
75148241
75149241
75150241
75151241 75152241
75153241
75154241
75155241
75156243
75157243
75158243
75159243
75160243
75161243
75162243
75163243
75164243
75165243
75166243
75167243
75168243
75169243
75170243
75171243
75172243
75173243
75174243
75175251
75176251
75177251
75178251
75179251
75180251
76040511
76041511
76042511
76043511
76044511
76045511
76046511
76047511
76048511
76049511
76050511
76051511
76052511
76053412
76054412
76055412
76056412
76057412
76058412
76059412
76060412
76061412 76062412 76063412 76064412 76065412 76066412 76067412 76068411 76069411 76070411 76071411 76072411 76073411 76074411 76075411 76076411 76077411 76078411 76079312 76080312 76081312 76082312 76083312 76084312 76085312 76086312 76087312 76088313 76089313 76090313 76091313 76092313 76093313 76094313 76095313 76096214 76097214 76098214 76099214 76100214 76101222 76102222 76103221 76104221 76105221 76106221 76107221 76108221 76109122 76110122 76111122 76112122 76113122
76114132
76115131
76116131
76117131
76118131
76119131
76120131
76121131
76122131
76123131
76124131
76125131
76126131
76127131
76128133
76129133
76130133
76131133
76132133
76133133
76134133
76135133
76136133
76137133
76138133
76139133
76140133
76141133
76142241
76143241
76144241
76145241
76146241
76147241
76148241
76149241
76150241
76151241
76152241
76153241
76154241
76155241
76156241
76157241
76158241
76159243
76160243
76161243
76162243
76163243 76164243
76165243
76166243
76167243
76168243
76169243
76170243
76171243
76172243
76173243
76174243
76175243
76176243
76177243
76178243
76179251
76180251
77040511
77041511
77042511
77043511
77044511
77045511
77046511
77047511
77048412
77049412
77050412
77051412
77052412
77053412
77054412
77055412
77056412
77057412
77058412
77059412
77060412
77061412
77062412
77063412
77064411
77065411
77066411
77067411
77068411
77069411
77070411
77071411
77072411
77073411 77074411
77075312
77076312
77077312
77078312
77079312
77080312
77081312
77082312
77083312
77084311
77085311
77086311
77087311
77088311
77089311
77090313
77091214
77092214
77093214
77094214
77095214
77096214
77097214
77098213
77099213
77100213
77101213
77102213
77103221
77104221
77105122
77106122
77107122
77108122
77109122
77110121
77111121
77112121
77113121
77114121
77115121
77116121
77117131
77118131
77119131
77120131
77121131
77122131
77123131
77124131 77125131
77126131
77127131
77128131
77129131
77130133
77131133
77132133
77133133
77134133
77135133
77136133
77137133
77138133
77139133
77140133
77141133
77142133
77143133
77144133
77145241
77146241
77147241
77148241
77149241
77150241
77151241
77152241
77153241
77154241
77155241
77156241
77157241
77158241
77159241
77160241
77161241
77162243
77163243
77164243
77165243
77166243
77167243
77168243
77169243
77170243
77171243
77172243
77173243
77174243
77175243 77176243
77177243
77178243
77179243
77180243
78040511
78041511
78042412
78043412
78044412
78045412
78046412
78047412
78048412
78049412
78050412
78051412
78052412
78053412
78054412
78055412
78056412
78057412
78058412
78059411
78060411
78061411
78062411
78063411
78064411
78065411
78066411
78067411
78068411
78069411
78070312
78071312
78072312
78073312
78074312
78075312
78076312
78077312
78078312
78079311
78080311
78081311
78082311
78083311
78084311
78085311 78086311
78087212
78088212
78089212
78090212
78091212
78092214
78093214
78094213
78095213
78096213
78097213
78098213
78099213
78100114
78101114
78102114
78103114
78104114
78105114
78106121
78107121
78108121
78109121
78110121
78111121
78112121
78113121
78114121
78115121
78116121
78117121
78118121
78119131
78120131
78121131
78122131
78123131
78124131
78125131
78126131
78127131
78128131
78129131
78130131
78131131
78132131
78133133
78134133
78135133
78136133 78137133
78138133
78139133
78140133
78141133
78142133
78143133
78144133
78145133
78146133
78147133
78148241
78149241
78150241
78151241
78152241
78153241
78154241
78155241
78156241
78157241
78158241
78159241
78160241
78161241
78162241
78163241
78164241
78165243
78166243
78167243
78168243
78169243
78170243
78171243
78172243
78173243
78174243
78175243
78176243
78177243
78178243
78179243
78180243
79040412
79041412
79042412
79043412
79044412
79045412
79046412 79047412
79048412
79049412
79050412
79051412
79052412
79053412
79054411
79055411
79056411
79057411
79058411
79059431
79060411
79061411
79062411
79063411
79064411
79065411
79066312
79067312
79068312
79069312
79070312
79071312
79072312
79073312
79074312
79075311
79076311
79077311
79078311
79079311
79080311
79081311
79082311
79083212
79084212
79085212
79086212
79087212
79088212
79089211
79090211
79091211
79092211
79093211
79094213
79095114
79096114
79097114 79098114
79099114
79100114
79101113
79102113
79103113
79104113
79105113
79106113
79107113
79108121
79109121
79110121
79111121
79112121
79113121
79114121
79115121
79116121
79117121
79118121
79119121
79120121
79121121
79122131
79123131
79124131
79125131
79126131
79127131
79128131
79129131
79130131
79131131
79132131
79133131
79134131
79135131
79136133
79137133
79138133
79139133
79140133
79141133
79142133
79143133
79144133
79145133
79146133
79147133
79148133 79149133
79150133
79151241
79152241
79153241
79154241
79155241
79156241
79157241
79158241
79159241
79160241
79161241
79162241
79163241
79164241
79165241
79166241
79167241
79168243
79169243
79170243
79171243
79172243
79173243
79174243
79175243
79176243
79177243
79178243
79179243
79180243
80040412
80041412
80042412
80043412
80044412
80045412
80046412
80047412
80048412
80049411
80050411
80051411
80052411
80053411
80054411
80055411
80056411
80057411
80058411 80059411
80060411
80061411
80062312
80063312
80064312
80065312
80066312
80067312
80068312
80069312
80070312
80071311
80072311
80073311
80074311
80075311
80076311
80077311
80078212
80079212
80080212
80081212
80082212
80083212
80084212
80085211
80086211
80087211
80088211
80089211
80090211
800S1112
80092112
80093112
80094112
80095112
80096113
80097113
80098113
80099113
80100113
80101113
80102113
80103113
80104113
80105113
80106113
80107113
80108113
80109113 80110121 80111121 80112121 80113121 80114121 80115121 80116121 80117121 80118121 80119121 80120121 80121121 80122121 80123121 80124131 80125131 80126131 80127131 80128131 80129131 80130131 80131131 80132131 80133131 80134131 80135131 80136131 80137131 80138133 80139133 80140133 80141133 80142133 80143133 80144133 80145133 80146133 80147133 80148133 80149133 80150133 80151133 80152133 80153241 80154241 80155241 80156241 80157241 80158241 80159241 80160241 80161241
80162241
80163241
80164241
80165241
80166241
80167241
80168241
80169241
80170241
80171243
80172243
80173243
80174243
80175243
80176243
80177243
80178243
80179243
80180243
81040412
81041412
81042412
81043412
81044411
81045411
81046411
81047411
81048411
81049411
81050411
81051411
81052411
81053411
81054411
81055411
81056411
81057312
81058312
81059312
81060312
81061312
81062312
81063312
81064312
81065312
81066311
81067311
81068311
81069311
81070311 81071311
81072311
81073311
81074212
81075212
81076212
81077212
81078212
81079212
81080211
81081211
81082211
81083211
81084211
81085211
81086112
81087112
81088112
81089112
81090112
81091112
81092111
81093111
81094111
81095111
81096111
81097111
81098111
81099113
81100113
81101113
81102113
81103113
81104113
81105113
81106113
81107113
81108113
81109113
81110113
81111113
81112113
81113121
81114121
81115121
81116121
81117121
81118121
81119121
81120121
81121121 81122121
81123121
81124121
81125121
81126121
81127131
81128131
81129131
81130131
81131131
81132131
81133131
81134131
81135131
81136131
81137131
81138131
81139131
81140131
81141133
81142133
81143133
81144133
81145133
81146133
81147133
81148133
81149133
81150133
81151133
81152133
81153133
81154133
81155133
81156133
81157241
81158241
81159241
81160241
81161241
81162241
81163241
81164241
81165241
81166241
81167241
81168241
81169241
81170241
81171241
81172241 81173241
81174241
81175243
81176243
81177243
81178243
81179243
81180243
82040411
82041411
82042411
82043411
82044411
82045411
82046411
82047411
82048411
82049411
82050411
82051411
82052411
82053312
82054312
82055312
82056312
82057312
82058312
82059312
82060312
82061312
82062311
82063311
82064311
82065311
82066311
82067311
82068311
82069212
82070212
82071212
82072212
82073212
82074212
82075212
82076211
82077211
82078211
82079211
82080211
82081211
62082112 82083112
82084112
82085112
82086112
82087111
82088111
82089111
82090111
82091111
82092111
82093111
82094111
82095111
82096111
82097111
82098111
82099111
82100111
82101113
82102113
82103113
82104113
82105113
82106113
82107113
82108113
82109113
82110113
82111113
82112113
82113113
82114113
82115121
82116121
82117121
82118121
82119121
82120121
82121121
82122121
82123121
82124121
82125121
82126121
82127121
82128121
82129121
62130131
82131131
82132131
82133131 82134131
82135131
82136131
82137131
82138131
82139131
82140131
82141131
82142131
82143131
82144131
82145133
82146133
82147133
82148133
82149133
82150133
82151133
82152133
82153133
82154133
82155133
82156133
82157133
82158133
82159133
82160241
82161241
82162241
82163241
82164241
82165241
82166241
82167241
82168241
82169241
82170241
82171241
82172241
82173241
82174241
82175241
82176241
82177241
82178241
82179243
82180243
83040411
83041411
83042411
83043411 83044411
83045411
83046411
83047411
83048411
83049312
83050312
83051312
83052312
83053312
83054312
83055312
83056312
83057312
83058311
83059311
83060311
83061311
83062311
83063311
83064311
83065212
83066212
83067212
83068212
83069212
83070212
83071211
83072211
83073211
83074211
83075211
83076211
83077112
83U78112
83079112
83080112
83081112
83082111
83083111
83084111
83085111
83086111
83087111
83088111
83089111
83090111
83091111
83092111
83093111
83094111 83095111
83096111
83097111
83098111
83099111
83100111
83101111
83102111
83103113
83104113
83105113
83106113
83107113
83108113
83109113
83110113
83111113
83112113
83113113
83114113
83115113
83116113
83117113
83118121
83119121
83120121
83121121
83122121
83123121
83124121
83125121
83126121
83127121
83128121
83129121
83130121
83131121
83132121
83133131
83134131
83135131
83136131
83137131
83138131
83139131
83140131
83141131
83142131
83143131
83144131
83145131 83146131
83147131
83148133
83149133
83150133
83151133
83152133
83153133
83154133
83155133
83156133
83157133
83158133
83159133
83160133
83161133
83162133
83163133
83164241
83165241
83166241
83167241
83168241
83169241
83170241
83171241
83172241
83173241
83174241
83175241
83176241
83177241
83178241
83179241
83180241
84040411
84041411
84042411
84043411
84044411
84045312
84046312
84047312
84048312
84049312
84050312
84051312
84052312
84053312
84054311
84055311 84056311 84057311 84058311 84059311 84060311 84061212 84062212 84063212 84064212 84065212 84066212 84067211 84068211 84069211 84070211 84071211 84072112 84073112 84074112 84075112 84076112 84077111 84078111 84079111 84080111 84081111 84082111 84083111 84084111 84085111 84086111 84087111 84088111 84089111 84090111 84091111 84092111 84093111 84094111 84095111 84096111 84097111 84098111 84099111 84100111 84101111 84102111 84103111 84104111 84105111 84106113 84107113
84108113
84109113
84110113
84111113
84112113
84113113
84114113
84115113
84116113
84117113
84118113
84119113
84120113
84121121
84122121
84123121
84124121
84125121
84126121
84127121
84128121
84129121
84130121
84131121
84132121
84133121
84134121
84135121
84136131
84137131
84138131
84139131
84140131
84141131
84142131
84143131
84144131
84145131
84146131
84147131
84148131
84149131
84150131
84151133
84152133
84153133
84154133
84155133
84156133
84157133 84158133
84159133
84160133
84161133
84162133
84163133
84164133
84165133
84166133
84167241
84168241
84169241
84170241
84171241
84172241
84173241
84174241
84175241
84176241
84177241
84178241
84179241
84180241
85040411
85041312
85042312
85043312
85044312
85045312
85046312
85047312
85048312
85049312
85050311
85051311
85052311
85053311
85054311
85055311
85056311
85057212
85058212
85059212
85060212
85061212
85062211
85063211
85064211
85065211
85066211
85067211 85068112
85069112
85070112
85071112
85072112
85073111
85074111
85075111
85076111
85077111
85078111
85079111
85080111
85081111
85082111
85083111
85084111
85085111
85086111
85087111
85088111
85089111
85090111
85091111
85092111
85093111
85094111
85095111
85096111
85097111
85098111
85099111
35100111
65101111
85102111
85103111
85104111
85105111
85106111
85107111
85108113
85109113
85110113
85111113
85112113
85113113
85114113
85115113
85116113
85117113
85118113 85119113
85120113
85121113
85122113
85123113
85124121
85125121
85126121
85127121
85128121
85129121
85130121
85131121
85132121
85133121
85134121
85135121
85136121
85137121
85138121
85139131
85140131
85141131
85142131
85143131
85144131
85145131
85146131
85147131
85148131
85149131
85150131
85151131
85152131
85153131
85154131
85155133
85156133
85157133
85158133
85159133
85160133
85161133
85162133
85163133
85164133
85165133
85166133
85167133
85168133
85169133 85170241 85171241 85172241 85173241 85174241 85175241 85176241 85177241 85178241 85179241 85180241

Claims

We Claim:
1. A computer program product comprising a computer useable medium having computer program logic recorded thereon for enabling a processor in a computer system to control the processing of cotton through a gin to produce lint, said computer program logic comprising: measuring means for enabling the processor to measure sensor data that correspond to color, moisture content, and trash content of the cotton as it enters the gin; gin decision matrix generating means for enabling the processor to generate a gin decision matrix that includes optimum process control decisions that maximize net return from the lint as a function of input state of the cotton entering the gin; gin process control decision means for enabling the processor to select an optimum process control decision from said gin decision matrix for an input state corresponding to said sensor data, wherein said optimum process control decision corresponds to an optimum gin machine sequence for cotton having said input state corresponding to said sensor data, said optimum gin machine sequence having a first portion and a second portion; predicting means for enabling the processor to compute and store predicted values for color, moisture content, and trash content for the cotton after processing through said first portion of said optimum gin machine sequence; and gin process control implementation means for enabling the processor to implement said optimum process control decision by routing cotton through said optimum gin machine sequence .
2. The computer program product of claim 1, further comprising: second measuring means for enabling the processor to measure second sensor data that correspond to color, moisture content , and trash content of the cotton after it has been processed through said first portion of said optimum gin machine sequence .
3. The computer program product of claim 2, further comprising: error feedback means for enabling the processor to compare said second sensor data to said predicted values to generate an error; and error adjusting means for enabling the processor to adjust said optimum gin machine sequence and to adjust said predicted values to compensate for said error.
4. The computer program product of claim 3 , further comprising: third measuring means for enabling the processor to measure lint sensor data that correspond to color, moisture content, and trash content of the cotton after it has been processed through said second portion of said optimum gin machine sequence .
5. The computer program product of claim 4 , further comprising: second predicting means for enabling the processor to compute and store second predicted values for color, moisture content, and trash content for the cotton after processing through said second portion of said optimum gin machine sequence.
6. The computer program product of claim 5, further comprising: second error feedback means for enabling the processor to compare said lint sensor data to said second predicted values to generate a second error; and second error adjusting means for enabling the processor to adjust said second portion of said optimum gin machine sequence and to adjust said second predicted values to compensate for said second error.
7. The computer program product of claim 3 , wherein said error adjusting means comprises weighting means for enabling the processor to weight said error.
8. The computer program product of claim 6 , wherein said second error adjusting means comprises second weighting means for enabling the processor to weight said second error.
9. The computer program product of claim 1, wherein said gin decision matrix generating means comprises a plurality of tabular transition functions.
10. The computer program product of claim 1, wherein said gin decision matrix generating means comprises an algorithm for each gin machine in said optimum gin machine sequence, wherein said algorithm quantifies the effect of that gin machine on leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) .
11. The computer program product of claim 10, wherein said gin decision matrix generating means comprises a cylinder cleaner algorithm as follows :
SLFL = -0.1305 - 0.0619 * SM + 1.0599 * SLF SML = SM SRDL = 3.4151 - 0.0008 * SM + 0.9606 * SRD
STOL = -0.6071 - 0.0057 * SM + 1.0127 * STO
SLNL = 0.2557 - 0.0012 * SM + 0.7764 * SLN
SPBL = 2.8104 - 0.0137 * SM + 0.6457 * SPB wherein SLFL, SML, SRDL, STOL, SLNL, SPBL represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, after processing by a cylinder cleaner, and SLF, SM, SRD, STO, SLN, SPB represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, input to the cylinder cleaner.
12. The computer program product of claim 10, wherein said gin decision matrix generating means comprises a ginstand algorithm as follows :
SLFL = SLF
SML = SM
SRDL = 19.52 - 0.12 * SM + 0.75 * SRD
STOL = 9.22 + 0.14 * SM + 0.72 * STO
SLNL = 0.31 + 0.002 * SM + 0.72 * SLN
SPBL = 1.50 + 0.02 * SM + 0.81 * SPB wherein SLFL, SML, SRDL, STOL, SLNL, SPBL represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, after processing by a ginstand, and SLF, SM, SRD, STO, SLN, SPB represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, input to the ginstand.
13. The computer program product of claim 10, wherein said gin decision matrix generating means comprises an impact cleaner algorithm as follows : SLFL = -0.1305 - 0.0619 * SM + 1.0599 * SLF
SML = SM
SRDL = 3.4151 - 0.0008 * SM + 0.9606 * SRD
STOL = -0.6071 - 0.0057 * SM + 1.0127 * STO
SLNL = 0.2557 - 0.0012 * SM + 0.7764 * SLN
SPBL = 2.8104 - 0.0137 * SM + 0.6457 * SPB wherein SLFL, SML, SRDL, STOL, SLNL, SPBL represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, after processing by an impact cleaner, and SLF, SM, SRD, STO, SLN, SPB represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, input to the impact cleaner.
14. The computer program product of claim 10, wherein said gin decision matrix generating means comprises a one lint cleaner algorithm as follows:
SLFL = -0.6665 + 0.0937 * SM + 0.8296 * SLF
SML = SM
SRDL = 25.9279 - 0.0834 * SM + 0.6757 * SRD
STOL = -8.0604 - 0.1694 * SM + 1.2043 * STO
SLNL = 0.1742 + 0.0003 * SM + 0.8288 * SLN
SPBL = 3.3751 - 0.0222 * SM + 0.5970 * SPB wherein SLFL, SML, SRDL, STOL, SLNL, SPBL represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, after processing by one lint cleaner, and SLF, SM, SRD, STO, SLN, SPB represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, input to the one lint cleaner.
15. The computer program product of claim 10, wherein said gin decision matrix generating means comprises a two lint cleaner algorithm as follows:
SLFL = -1.0150 + 0.1483 * SM + 0.7278 * SLF SML = SM
SRDL = 38.1983 - 0.2905 * SM + 0.5302 * SRD STOL = -12.6405 - 0.1969 * SM + 1.3191 * STO SLNL = -0.0520 + 0.0003 * SM + 1.0266 * SLN SPBL = 2.3649 - 0.0183 * SM + 0.7439 * SPB wherein SLFL, SML, SRDL, STOL, SLNL, SPBL represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, after processing by two lint cleaners, and SLF, SM, SRD, STO, SLN, SPB represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, input to the two lint cleaners.
16. The computer program product of claim 10, wherein said gin decision matrix generating means comprises a stick machine algorithm as follows :
SLFL = 0.1625 - 0.0710 * SM + 1.0326 * SLF
SML = SM
SRDL = 2.3777 - 0.0299 * SM + 0.9736 * SRD
STOL = 1.8168 - 0.0011 * SM + 0.9419 * STO
SLNL = 0.1996 - 0.0003 * SM + 0.8226 * SLN
SPBL = 1.8629 - 0.0025 * SM + 0.7587 * SPB wherein SLFL, SML, SRDL, STOL, SLNL, SPBL represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, after processing by a stick machine, and SLF, SM, SRD, STO, SLN, SPB represent the values of leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and +b (PB) , respectively, input to the stick machine.
17. The computer program product of claim 1, wherein said gin decision matrix generating means comprises a drier algorithm as follows :
SLFL = SLF
SRDL = SRD
STOL = STO* (1.0- (SM-SMD/100.0)
SLNL = SLN
SPBL = SPB
SML = 4.2767+0.6397*SM-0.01713*TEMP wherein SLFL, SRDL, STOL, SLNL, SPBL, SML represent the values of leaf trash (LF) , reflectance (RD) , turnout (TO) , length (LN) , +b (PB) , and moisture content (M) , respectively, after processing by the drier, and SLF, SRD, STO, SLN, SPB, SM represent the values of leaf trash (LF) , reflectance (RD) , turnout (TO) , length (LN) , +b (PB) , and moisture content (M) , respectively, input to the drier, and TEMP represents the temperature of the drier.
18. The computer program product of claim 1, wherein said gin process control implementation means comprises: valve control means for enabling the processor to change a position of valves that divert the flow of cotton through said optimum gin machine sequence; and valve position determining means for enabling the processor to determine the position of the valves.
19. The computer program product of claim 1, further comprising: display means for enabling the processor to display said sensor data and said optimum gin machine sequence .
20. A control system for controlling the processing of cotton through a gin to produce lint, the gin having a plurality of auxiliary treatment units and a duct through which entrained cotton flows, said control system comprising: measuring means for measuring sensor data that correspond to color, moisture content, and trash content of the cotton; processing means coupled to said measuring means , said processing means processing said sensor data and selecting a set of said plurality of auxiliary treatment units through which the cotton is processed to produce lint, said set corresponding to an optimum gin machine sequence that maximizes net return from the lint ,- and cotton diversion means coupled to each of said plurality of auxiliary treatment units and coupled to said processing means, wherein said processing means activates said cotton diversion means to divert cotton to flow through each of said plurality of auxiliary treatment units in said set and wherein said processing means deactivates said cotton diversion means to bypass each of said plurality of auxiliary treatment units not in said set.
21. The control system of claim 20, further comprising: second measuring means coupled to said processing means, said second measuring means measuring lint cleaner sensor data that correspond to color, moisture content, and trash content of the cotton as it enters a lint cleaning stage that contains a plurality of lint cleaners, wherein said processing means processes said lint cleaner sensor data and selects a set of lint cleaners through which the cotton is processed to produce lint, said set of lint cleaners corresponding to an optimum lint cleaning sequence that maximizes revenue from the lint, wherein said processing means activates said cotton diversion means to divert cotton to flow through each of said plurality of lint cleaners in said set and wherein said processing means deactivates said cotton diversion means to bypass each of said plurality of lint cleaners not in said set.
22. The control system of claim 21, wherein said cotton diversion means for each of said plurality of lint cleaners comprises : a supply valve for controlling flow of cotton through a supply conduit connecting said lint cleaner to the duct at a supply connection location; a return valve for controlling flow of cotton through a return conduit connecting said lint cleaner to the duct at a return connection location downstream from said supply connection location; and a duct valve for controlling flow of cotton through the duct, said duct valve disposed between said supply connection location and said return connection location.
23. The control system of claim 22, wherein said processing means activates said cotton diversion means by closing said duct valve while substantially simultaneously opening said supply valve and said return valve .
24. The control system of claim 23, wherein said processing means deactivates said cotton diversion means by opening said duct valve while substantially simultaneously closing said supply valve, and then closing said return valve after a pre-determined time delay.
25. The control system of claim 21, further comprising: third measuring means coupled to said processing means for measuring color, moisture content, and trash content of the lint after processing by said set of auxiliary treatment units.
26. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for processing input material through a processing plant to produce processed material, said method steps comprising:
(a) measuring sensor data at a measurement station that correspond to a physical state of the input material at said measurement station;
(b) determining an optimum processing machine sequence for input material entering the processing plant based on the physical state of the input material at said measurement station that corresponds to said sensor data, wherein said optimum processing machine sequence maximizes net return from the processed material; and
(c) routing the input material through said optimum processing machine sequence.
27. The program storage device of claim 26, wherein step (a) is performed as the input material enters the processing plant at said measurement station.
28. The program storage device of claim 26, wherein step (a) is performed after the input material at said measurement station has been processed through a first portion of said optimum processing machine sequence .
29. The program storage device of claim 26, wherein step (a) is performed after the input material at said measurement station has been completely processed through said optimum processing machine sequence .
30. The program storage device of claim 27, further comprising:
(d) measuring second sensor data at a second measurement station that correspond to the physical state of the input material after it has been processed through a first portion of said optimum processing machine sequence; and
(e) computing and storing a predicted value for the physical state of the input material after processing through said first portion of said optimum processing machine sequence.
31. The program storage device of claim 30, further comprising:
(f) comparing said second sensor data to said predicted value to generate an error; and
(g) adjusting said optimum processing machine sequence and said predicted value to compensate for said error.
32. The program storage device of claim 31, further comprising:
(h) measuring third sensor data that correspond to physical state of the input material after it has been completely processed through said optimum processing machine sequence; and
(i) computing and storing a second predicted value for the physical state of the input material after processing completely through said optimum processing machine sequence.
33. The program storage device of claim 32, further comprising:
(j) comparing said third sensor data to said second predicted value to generate a second error; and
(k) adjusting a second portion of said optimum processing machine sequence and said second predicted value to compensate for said second error.
34. The program storage device of claim 31, wherein step (g) comprises : weighting said error with a weighting factor.
35. The program storage device of claim 33, wherein step (k) comprises : weighting said second error with a weighting factor.
36. The program storage device of claim 29, further comprising:
(d) measuring second sensor data at a second measurement station that correspond to the physical state of the input material after it has been processed through a first portion of said optimum processing machine sequence; and
(e) computing and storing a predicted value for the physical state of the input material after processing through said first portion of said optimum processing machine sequence.
37. The program storage device of claim 36, further comprising :
(f) comparing said second sensor data to said predicted value to generate an error; and
(g) adjusting said optimum processing machine sequence and said predicted value to compensate for said error.
38. The program storage device of claim 37, further comprising:
(h) measuring third sensor data that correspond to the physical state of the input material after it has been completely processed though said optimum processing machine sequence;
(i) computing and storing a second predicted value for the physical state of the input material after processing completely through said optimum processing machine sequence;
(j) comparing said third sensor data to said second predicted value to generate a second error; and
(k) adjusting a second portion of said optimum processing machine sequence and said second predicted value to compensate for said second error.
39. The program storage device of claim 26, wherein step (b) comprises :
(1) evaluating an algorithm for each machine in said optimum processing machine sequence, wherein said algorithm quantifies the effect of that machine on the physical state of the input material .
40. The program storage device of claim 39, wherein step (1) comprises :
(i) determining coefficients for said algorithm based on cotton variety.
41. The program storage device of claim 33, wherein step (b) comprises :
(1) evaluating an algorithm for each machine in said optimum processing machine sequence, wherein said algorithm quantifies the effect of that machine on the physical state of the input material .
42. The program storage device of claim 41, wherein step (1) comprises :
(i) determining coefficients for said algorithm based on cotton variety.
43. The program storage device of claim 41, wherein step (1) comprises :
(i) determining coefficients for said algorithm as a function of said error and said second error.
44. The computer program product of claim 6 , wherein said gin decision matrix generating means comprises an algorithm for each gin machine in said optimum gin machine sequence, wherein said algorithm quantifies the effect of that gin machine on leaf trash (LF) , moisture content (M) , reflectance (RD) , turnout (TO) , length (LN) , and -i-b (PB) , wherein coefficients for said algorithm are determined as a function of said error and said second error.
45. A control system for controlling the processing of lint through a mill, the mill having a plurality of auxiliary treatment units and a duct through which lint flows, said control system comprising: measuring means for measuring sensor data that correspond to color, moisture content, and trash content of the lint; processing means coupled to said measuring means, said processing means processing said sensor data and selecting a set of said plurality of auxiliary treatment units through which the lint is processed to produce lint of a predetermined quality, said set corresponding to an optimum mill machine sequence; and lint diversion means coupled to each of said plurality of auxiliary treatment units and coupled to said processing means, wherein said processing means activates said lint diversion means to divert lint to flow through each of said plurality of auxiliary treatment units in said set and wherein said processing means deactivates said lint diversion means to bypass each of said plurality of auxiliary treatment units not in said set.
46. The control system of claim 45, further comprising: second measuring means coupled to said processing means , said second measuring means measuring sensor data that correspond to color, moisture content, and trash content of the lint as it enters a second cleaning stage, wherein said processing means processes said sensor data and selects a set of cleaners in said second cleaning stage through which the lint is processed, said set of cleaners corresponding to an optimum cleaning sequence that maximizes quality of the lint, wherein said processing means activates said lint diversion means to divert lint to flow through each of said set of cleaners and wherein said processing means deactivates said lint diversion means to bypass cleaners not in said set .
47. The control system of claim 45, wherein said lint diversion means for each of said plurality of auxiliary treatment units comprises: a supply valve for controlling flow of lint through a supply conduit connecting said auxilliary treatment unit to the duct at a supply connection location; a return valve for controlling flow of lint through a return conduit connecting said auxilliary treatment unit to the duct at a return connection location downstream from said supply connection location; and a duct valve for controlling flow of lint through the duct, said duct valve disposed between said supply connection location and said return connection location.
48. The control system of claim 47, wherein said processing means activates said lint diversion means by closing said duct valve while substantially simultaneously opening said supply valve and said return valve .
49. The control system of claim 48, wherein said processing means deactivates said lint diversion means by opening said duct valve while substantially simultaneously closing said supply valve, and then closing said return valve after a pre-determined time delay.
PCT/US1997/013553 1996-08-01 1997-07-31 System and method for materials process control WO1998006053A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US08/691,069 1996-08-01
US08/691,069 US5805452A (en) 1996-08-01 1996-08-01 System and method for materials process control

Publications (1)

Publication Number Publication Date
WO1998006053A1 true WO1998006053A1 (en) 1998-02-12

Family

ID=24775037

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US1997/013553 WO1998006053A1 (en) 1996-08-01 1997-07-31 System and method for materials process control

Country Status (7)

Country Link
US (1) US5805452A (en)
AR (1) AR006065A1 (en)
AU (1) AU715988B2 (en)
BR (1) BR9704249A (en)
GR (1) GR1003301B (en)
TR (1) TR199700739A3 (en)
WO (1) WO1998006053A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU754322B2 (en) * 1998-02-06 2002-11-14 Uster Technologies Ag Gin process control

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19651891B4 (en) * 1996-12-13 2006-10-05 TRüTZSCHLER GMBH & CO. KG Method and device on a card, carding o. The like. For processing textile fibers, eg. As cotton, chemical fibers o. The like.
US6108585A (en) * 1997-12-12 2000-08-22 Advanced Micro Devices, Inc. Probabilistic dispatching method and arrangement
US6567538B1 (en) 1999-08-02 2003-05-20 The United States Of America As Represented By The Secretary Of Agriculture Real time measurement system for seed cotton or lint
US6928333B1 (en) * 1999-08-31 2005-08-09 Advance Micro Devices, Inc. Scheduling method for automated work-cell transfer system
WO2001067354A1 (en) * 2000-03-06 2001-09-13 Wellogix, Inc. Method and process for providing relevant data, comparing proposal alternatives, and reconciling proposals, invoices, and purchase orders with actual costs in a workflow process
US7257543B2 (en) * 2000-07-27 2007-08-14 Shofner Engineering Associates, Inc. System and method for marketing cotton
DE10055025B4 (en) * 2000-11-07 2017-08-17 Trützschler GmbH & Co Kommanditgesellschaft Spinning preparation plant with a higher-level operating and display device
US7896941B2 (en) * 2001-02-12 2011-03-01 Aaf-Mcquay Inc. Product and method of forming a gradient density fibrous filter
US7124057B2 (en) * 2003-08-19 2006-10-17 Festo Corporation Method and apparatus for diagnosing a cyclic system
US20050217076A1 (en) * 2004-04-02 2005-10-06 Gvili Michael E Apparatus and method for controlling the amount of trash in lint
US7677169B2 (en) 2007-09-06 2010-03-16 Cnh America Llc Apparatus and method using imaging in building a cotton module
US7684892B2 (en) * 2007-10-30 2010-03-23 Gm Global Technology Operations, Inc. Process for generating control sequence of operations
US8108074B2 (en) * 2008-02-12 2012-01-31 Honeywell International Inc. Apparatus and method for optimizing operation of sugar dryers
CA2758744A1 (en) * 2009-04-17 2010-10-21 The University Of Sydney Drill hole planning
US8199319B2 (en) * 2009-06-29 2012-06-12 Uster Technologies Ag Fiber property measurement
EP3175025B1 (en) * 2014-07-31 2018-12-19 Camozzi Digital S.r.l. Method for monitoring physical parameters of textile machinery
BR112018006948B1 (en) * 2015-10-09 2022-07-19 Ww Systems Ltda METHOD TO FORM A HOMOGENIZED MIXTURE OF COTTON BALES FOR A SPINNING PROCESS
ITUB20155168A1 (en) * 2015-10-30 2017-04-30 Mesdan Spa METHOD AND MEASUREMENT DEVICE FOR MEASURING THE HUMIDITY CONTENT, LENGTH AND / OR AT LEAST A DYNAMOMETRIC CHARACTERISTIC OF TEXTILE FIBERS, IN PARTICULAR COTTON FIBERS.
CN105177727B (en) * 2015-11-04 2016-09-14 奎屯银力棉油机械有限公司 A kind of automatization's unginned cotton process equipment drying clear miscellaneous one
JP2018061533A (en) * 2016-10-11 2018-04-19 日立アプライアンス株式会社 Vacuum cleaner
CN111386364B (en) * 2017-10-13 2023-02-21 罗伯特·钦纳 Controller and method for a skinning process
DE102017126753A1 (en) * 2017-11-14 2019-05-29 Autefa Solutions Germany Gmbh Surveillance technology for fleece fabrication plants
WO2020154820A1 (en) * 2019-01-31 2020-08-06 Uster Technologies Ag Optimizing a spinning process with respect to foreign materials
FR3097565B1 (en) * 2019-06-19 2022-08-12 Staubli Sa Ets Textile machine, weaving loom comprising such a textile machine and associated methods
CH716607A1 (en) * 2019-09-17 2021-03-31 Uster Technologies Ag Method and device for monitoring foreign materials in a textile fiber structure.
CN113053469B (en) * 2021-04-12 2022-06-21 江苏丰尚智能科技有限公司 Method and device for predicting moisture of drying material, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3922642A (en) * 1970-05-26 1975-11-25 Toyoda Automatic Loom Works Automatic spinning system
US4698766A (en) * 1984-05-19 1987-10-06 British Aerospace Plc Industrial processing and manufacturing systems
US4807108A (en) * 1987-08-10 1989-02-21 American Telephone And Telegraph Company, At&T Bell Laboratories Product realization method
US5282141A (en) * 1989-06-16 1994-01-25 Rieter Machine Works, Ltd. Method of blending textile fibers

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0513339B1 (en) * 1991-01-23 2001-05-09 Maschinenfabrik Rieter Ag Plant with a process control computer
US5361450A (en) * 1992-12-31 1994-11-08 Zellweger Uster, Inc. Direct control of fiber testing or processing performance parameters by application of controlled, conditioned gas flows

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3922642A (en) * 1970-05-26 1975-11-25 Toyoda Automatic Loom Works Automatic spinning system
US4698766A (en) * 1984-05-19 1987-10-06 British Aerospace Plc Industrial processing and manufacturing systems
US4807108A (en) * 1987-08-10 1989-02-21 American Telephone And Telegraph Company, At&T Bell Laboratories Product realization method
US4807108B1 (en) * 1987-08-10 1995-03-28 Bell Telephone Labor Inc Product realization method
US5282141A (en) * 1989-06-16 1994-01-25 Rieter Machine Works, Ltd. Method of blending textile fibers

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU754322B2 (en) * 1998-02-06 2002-11-14 Uster Technologies Ag Gin process control

Also Published As

Publication number Publication date
AR006065A1 (en) 1999-08-11
AU715988B2 (en) 2000-02-17
TR199700739A2 (en) 1998-02-21
GR1003301B (en) 2000-01-19
AU3243697A (en) 1998-02-05
TR199700739A3 (en) 1998-02-21
US5805452A (en) 1998-09-08
BR9704249A (en) 1999-01-12
GR970100307A (en) 1998-04-30

Similar Documents

Publication Publication Date Title
WO1998006053A1 (en) System and method for materials process control
DE69723622T2 (en) Infrared temperature detection for drum dryer control
CN112034095B (en) System and method for analyzing structure of cut tobacco after online drying
EP2052106B1 (en) Method and household appliance for drying wet laundry
WO2020098261A1 (en) Method and system for controlling moisture content at tobacco drying inlet
US5899005A (en) System and method for predicting the dryness of clothing articles
DE3237864C2 (en) Method and device for controlling and regulating a spinning preparation plant
CN102722201B (en) Automatic baking monitoring system and method
EP1053468A1 (en) Fiber strength testing system
AU1886499A (en) Fiber micronaire testing system
CN103110175B (en) Tobacco leaf curing method based on electronic nose smell monitoring technology
CN110244664A (en) The method of tobacco preparation system and running equipment for tobacco industry
CN100425988C (en) High volume fiber testing system
CN112317010B (en) Intelligent wheat flour milling-electronic flour mill system
CN105795497A (en) Data collecting method for improving fault analysis of cut-tobacco dryer
CN110530144A (en) A kind of intelligent drying means based on online measuring technique
GB2102593A (en) Control system for a carding machine
CN105973840B (en) A kind of method of quick detection Maotai-flavor wine brewing fermented grain physical and chemical index
CN1777803B (en) Hydrogen sulfide monitoring system
DE69824616T2 (en) METHOD AND DEVICE FOR REGULATING A MAINLY CONTINUOUS PROCESS
EP3244150B1 (en) Dryer for web of textile fabric with a device for operation using minimal energy and method for same
EP0180629A1 (en) Method for regulating the residual humidity of linen in a drying machine.
US4038723A (en) Method of and an arrangement for standardizing comber slivers
CN103439914B (en) Shield twice aeration intelligent controlling device
CN207380487U (en) One kind is used to detect tobacco leaf multiple spot moisture content detection device

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): CN JP KR

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): AT BE CH DE DK ES FI FR GB GR IE IT LU MC NL PT SE

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
NENP Non-entry into the national phase

Ref country code: JP

Ref document number: 1998508084

Format of ref document f/p: F

122 Ep: pct application non-entry in european phase