Page 217 - Embedded Microprocessor Systems Real World Design
P. 217

concentrates on the  trees and forgets about the forest. The process of verifjmg
                   the  design at this level varies with  the product,  the company, and the customer
                   and is beyond the scope of this book. It may include system testing that is several
                   levels removed from the embedded control system, and it may  involve testing in
                   the field.




                   A Real- World Example


                   This example illustrates some of the issues involved in debugging embedded appli-
                   cations. It is based on the document feeding example used in Chapters 4 and 6.
                   As  described earlier, this system had two requirements:  the documents had to be
                   fed at a certain  rate  (the throughput)  and the interdocument  spacing had to be
                   greater than a certain threshold  to meet the requirements of downstream sorting
                   mechanisms.
                     The original problem, described in Chapter 4, involved coupling between the
                   throughput and spacing correction code; a feedback loop was added to eliminate
                   the spacing errors. Once this code was implemented, the error rate was  reduced
                   significantly, but there were still too many errors.
                     Figure 7.1 shows the mechanical and electrical arrangement of the system. Each
                   document was fed into the transport by a feed wheel, driven by a DC motor, which
                   was  in  turn  controlled by  the  microcontroller. The motor  had  a shaft-mounted
                   encoder to provide speed feedback to the motor driver and the microcontroller.
                   The microcontroller commanded the motor driver to operate the motor at a par-
                   ticular speed and the motor driver hardware had a feedback loop to maintain that
                   speed. There were actually three motors in the feed mechanism, but only one was
                   involved in the problem.
                      Documents leaving the feeder were passed through an intermediate accelerator.
                   This accelerator consisted of a spring-loaded wheel, turning at a constant speed,
                   that would slip on the document as long as the document was  held by  the feed
                   wheel. As  soon as the trailing edge of the document left “pinch” of the feeder, it
                   would be accelerated. A sensor was located after the accelerator. This sensor could
                   detect the presence or absence of the document and was located so that a docu-
                   ment of any width could be detected.
                     After the first sensor, another accelerator brought the document up to the final
                   speed. After this accelerator, there was  another  sensor. This sensor was  the first
                   sensor after the document was at full transport speed and was used by the system
                   to detect spacing errors. There was  about 23 inches of track between  the feeder
                   and the second sensor. As mentioned in Chapter 6, a document (or a given point
                   on a document) took about 150ms to travel between the feeder and the second
                   sensor.


                   198                                             Embedded Microprocessor Systm
   212   213   214   215   216   217   218   219   220   221   222