LowCost Servo Design
As a raster output device the PaintJet printer differs from its plotter predecessors In a number of ways One unusual feature is the optical encoder on the carnage axis. This linear, singlechannel encoder provides carriage position data that is used both to control the Firing of drops from the Inkjet print cartridges and as feedback for the servo controlling the carriage motion. Its design meets objectives o! high accuracy and low cost, but introduced problems for servo design and development The encoder and Its impact on the PaintJet servo are described here.
The PaintJet encoder is designed to deliver high measurement accuracy and low hardware cost. It consists of an encoder unit, a linear scale, and a special circuit called the extrapolator. The encoder unit is a pair of injection-molded plastic parts which hold an Infrared detector, an aperture piate. and an emitter. The scale, shown In Fig 1, is made of clear polyester film with a photographically produced pattern of opaque bands. The scale mouots to the PaintJet chassis parallel to the carriage axis and passes between the emitter and detector in the encoder unit, which rides on the carriage. Carriage motion is encoded by the detector as a logic signal representing the presence or absence of an opaque band between it and the emitter. Only the falling edges, or light-to-dark transitions, are decoded The extrapolator is a circuit that operates on the detector output in a way that muiiiplies the effective scale resolutioo It keeps track of time between the last two encoder transitions and uses this value to insert up to three additional transitions following the most recent one. If the carriage speed is held constant the extrapolated data is very close to that of a scale with four times the resolution This allows the use of a low-resolution scale, which in turn allows the use ot lower-performance, less expensive optoelectronic parts. Accurate photographic production of ihe scale and direct measurement of the carriage position also contribute to low cost and high accuracy.
In servo architecture, the PaintJet printer shows some simifarity with its plotter cousins. The carriage Is driven by a dc motor via a pulley and a timing belt. The PaintJet printer's custom IC (see accompanying article) extrapolates the encoder data as described above and decodes it into a position word. This is read by the printer's processor, in which the loop is closed and a control word is generated. The processor writes this back to the custom IC where a pulse width modulator converts it to a signal controlling a motor driver IC. which forces the dc mdior with a voltage. The mam difference from plotters is the PaintJet encoder Its single-channel outpul limils decoding to simply counting transitions, with no measurement of the direction of motion as in a quadrature encoder. As a result, the position of a velocity sign change is uncertain and a position measurement error results. Potentially, this creates a problem each time the carnage reverses -t.s direction at the end of a sweep To overcome this, opaque bands wider than the normal scale pattern are added to the encoder scale [see Fig. 1) to serve as absolute position references. These reference bands mark the limits of the printing area and the carnage sweep area, and can be detected m the encoder signal with firmware. The print Unfit band isalso detected by a circuit in the Custom IC. which in turn signals the drop firing hardware to begin printing on the next valid encoder transition.
These encoder limitations complicate the servo that controls carriage motion. The primary control objectives are regulation of carriage speed while printing and adequate transient response while reversing after a sweep. While printing, speed is regulated by a position controller with velocity feedback. The control law can be expressed in the form;
where Un = motor vol!age at time tn Rn = reference position Xn = measured position (Xn - Xn. ,)/T = estimated velocity Kp = position gain Kv = velocitygain.
A reference speed Is se1 by ramping the reference position at a constani rate. The position loop guarantees a steady-state speed error of zero. This control iaw is also used in part to reverse carriage velocity Oy profiling the position reference. The print and sweep limit bands complicate this by introducing errors into the feedback signal. To compensate for this, algorithms in the servo firmware detect the limit bands and open the loop Additional algorithms ad|tisi control parameters depending en which gap is involved and whether it is the beginning or end of a sweep The loop is reclosed upon exiting a limit band.
Design of the carriage servo containing these algorithms required explicit solution of the velocity response Root locus design was used 10 determine gam values in the above control law that would provide desired response characieristics away from the effects of the limit bands. In and immediately following the limit bands the response is best characterized through explicit solution because of interaction of the open-loop compensations wiih ihe control law. A simulator was written to compute the servo's response numerically under these conditions to aid in algorithm design. Implemented in BASIC on an HP 9000 Model 216 Computer, the simulator Is built around a dynamic model of the carnage axis. This model is a matrix difference equation forced with voltage and Coulomb friction and having motor current and carriage velocity and position as states. Models ot the PaintJet encoder, extrapolator. and pulse width modulator are
Line-per-lnch Scale
Line-per-lnch Scale
-Open Loop
Fig. 1. PaintJet printer low-cost encoder scale
-Open Loop
Fig. 1. PaintJet printer low-cost encoder scale added to tn<s The resui: is a biocfc thai accepts a digital control word and returns a position word as ;n the hardware architecture described above A second block contains a software state machine in which the control law reference generation and — : band compensations are mp^emenTed This block reads the position word from the first block and writes a control word back, which is also analogous to the hardware architecture Confidence in simulated responses is ga.ned by verification of the carriage axis model against measured responses in protdtype hardware and by numerical equivalence between servo software in the simulator and firmware in the product. As a design too! the simulator allows tracking of a arge number of variables over a wide range ol model parameters This was very helpful in the development and worst-case verification of the carriage servo, in particular the limit band algorithms
Testing of the carnage servo was also affected by the limitations of the PaintJet encoder Compensation for the limit bands increased firmware complexity both in the number of algorithms and in ihe potential for interaction. Some servo failures occurred only after effects had rippled ihrough several algorithms. In these cases, lools providing traceability back to Ihe initial cause were needed. This was obtained with two tools One is called the servo snapshot At each servo interrupt It writes values of the servo firmware state pointer, ihe position error, and the last position change into a circular buffer in the printer's RAM If a failure occurs, the servo interrupts stop and the data is frozen It can be read out through the I'O or printed out by the PaintJet printer rf the failure was soft, and provides a picture of tne servos behavior leading up to the fa lure The second tool >s the encode' monitor which is an external ooard that times the period of successive failing edges in the encoder s.gna The storage of these values into a circular buffer is driven by encoder transitions which stop in a failure In this case the data can be read and reduced to a plot of carriage speed versus position Because these two tools sample at different pcunts in the hardware and one is internal while the other is external, they complemented one another very wen They were very useful in determining if a failure was hardware or firmware driven and where the problem stanec
In summary, servo Hardware cost in the PaintJet printer was lowered at the expense of addilional complexity in the servo firmware and the custom IC The simulator and debug tools were essential ingredients in developing a servo around the Pa ntJet encoder. The servo has very been reliable in production.
Acknowledgments
We would like td acknowledge the contributions of Bill Walsh, who wrote the servo firmware and servo snapshot and of Phil Schultz who built the encoder monitor
Mark Majette David Element
Development Engineers San Diego Division decided to reserve those pins as long as we could.
Eighteen months before introduction, an RS-232-D option was requested. The Spider's design had been frozen long before. Fortunately, we still had the UART pins available, so no change to the Spider was necessary. The design of the RS-232-D main board was straightforward, We were able to keep the three main boards the same, except for one corner dedicated to the I/O connector and support chips. This also allows the use of a single board tester.
The main problem was performance. Reception of data at 19,2 kilobaud while firing the heads would result in the loss of either bytes or dots. Since the processor just didn't have any spare cycles. 19.2 kilobaud was impossible.
Even al 9600 baud, interrupts couldn't he locked out for more than a millisecond or bytes could be lost. This had been one of our main speed boosters. Therefore, a substantial amnunt of code had to be reworked, in addition to adding the RS-232-D code.
There is only one version of firmware, even though there are multiple main boards. The code checks to see which board il has been plugged into, and acts appropriately. This aids in assembly, purchasing, and version control. Of course, it made pin allocation during the design phase a little more difficult.
Post a comment