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

real-time capacity of the 8031. The tables were calculated by software running on
                   a PC, and the resulting tables were incorporated into the 8031 code.
                     The spacing errors occurred on every machine produced; it was not limited only
                   to  certain  machines. There were  several possibilities for why  spacing errors still
                   occurred after the original spacing/throughput  problem was solved:
                     The original fix had a bug (software problem).
                     The  8031  was  making  an  incorrect  prediction  about  the  size  of  the  post-
                     acceleration  spacing, and therefore not correcting some documents  (software
                     problem).
                     The 8031 was making an incorrect calculation about the amount of correction
                     needed to fix the spacing (software problem).
                     The sensor hardware delivered an incorrect signal to the 8031, resulting in an
                     incorrect gap measurement (electrical hardware problem).
                     The motor  or  motor  driver was  not  responding  correctly to  the  rampdown/
                     rampup commands (electrical or mechanical hardware problem).
                     The first acceleration wheel was not always accelerating the documents correctly
                     (mechanical hardware problem).
                     The problem only occurred on documents that were physically damaged in some
                     way and could not be controlled/sensed  properly (media problem; possible spec-
                     ification problem if these were not taken into account in the design).
                     The first items checked were the media and the acceleration wheels. We  found
                   that most of the documents with incorrect spacing were not damaged so it was not
                   a media problem. The acceleration wheel was more difficult to measure, but it was
                   based on an earlier design and appeared to be working correctly. Had the problem
                   not turned out to be elsewhere, we would have returned to this and examined it
                   in more detail.
                     We  measured a number of rampup and rampdown cycles and determined that
                   the feed motor was working correctly, at least as far as the shaft encoder was con-
                   cerned. Spacing measurements were made on a number of documents and it was
                   determined that the variation in the output was minimal and insufficient to cause
                   the problem.
                     With all the possible errors other than code eliminated, a means was needed to
                   determine what was  happening.  Unfortunately, errors were not detected  (at the
                   second sensor) until  150ms after the spacing corrections had been made at the
                   feeder. We  did not have an emulator with  a trace buffer  that deep. This type of
                   issue is worse with modern processors, in fact, because newer, faster processors will
                   execute more instructions in a given time period, requiring an even deeper trace
                   buffer for problems of this type.
                     Considerable work was done to verify that the original software fix was correct,
                   verifymg the thresholds that determined the feedback characteristics. Eventually,
                   as described in Chapter 6, action codes were added to the firmware to indicate mea-

                   200                                             Embedded Microprocasor Systems
   214   215   216   217   218   219   220   221   222   223   224