Abstract:
A method and device for smoothly rotating a diffraction grating in a spectrophotometer by means of a galvanometer includes modifications in the software in the microprocessor which controls the galvanometer. The software modifications cause the galvanometer to rotate the grating in a series of discrete steps that stimulate a smooth minimum jerk rotation. The amount of rotation in each discrete step is calculated by the microprocessor.

Description:
BACKGROUND OF INVENTION 
     1. Field of the Invention 
     This invention relates from a smooth rotation of an object by an electric drive motor to a desired position. More specifically, the invention relates to control of a galvanometer used to rotate a diffraction grating in a spectrophotometer. 
     2. Description of the Prior Art 
     A typical prior art system for rotating an object, such as a diffraction grating in a spectrophotometer, is shown in FIG. 1. The purpose of the system 10 is to rotate the diffraction grating 11 to a precise angular position so that the grating 11 diffracts incident light which is coming from a source (not shown) to a destination (not shown). The grating 11 must be at a precise angle so that the light diffracted to the source is at a predetermined wavelength. The grating 11 is rotated to various positions by the system so as to diffract various wavelengths. It is important that the grating 11 be quickly rotated to each of its positions, so that the spectrophotometer can utilize in quick succession the various diffracted wavelengths. 
     The prior art system 10 is a standard analog feedback servo system. A position sensor 12 attached to galvanometer 13 provides a signal proportional to the angular position of output shaft 14 of galvanometer 13 to which grating 11 is attached. The conventional microprocessor 15 (typically an 8 bit microcontroller) provides commands by means of a digital to analog converter 16 to rotate the output shaft 14 of galvanometer 13 to a desired position. The position sensor 12 output is subtracted from the input commands and the resultant &#34;error&#34; signal 17 drives a conventional closed loop control circuit 18, including lead and lag networks, which in turn drive the galvanometer output shaft 14 to the desired position. 
     A major deficiency of this prior art system is that at high gain, the galvanometer 13 does not respond well to discontinuous input commands, e.g., step functions. Typical responses by the galvanometer 13 to a step include overshoot, which is detrimental to the galvanometer if the swing takes the galvanometer output shaft rotation past the specified limits, and exacerbation of resonances of modes outside of the angular rotation, such as a decaying resonance of the grating about the axis perpendicular to the axis of rotation and parallel to the grating surface. 
     The rotation of the grating 11 produced typically by the prior art system 10 of FIG. 1 is shown in FIGS. 2A, 2B and 2C. FIG. 2A shows the angular position (vertical axis) versus time (horizontal axis) of the grating 11 of FIG. 1. FIG. 2B shows the velocity (i.e., first derivative of position with respect to time) of the grating versus time. The abrupt &#34;step&#34; 22 is apparent. FIG. 2C shows the acceleration (i.e., second derivative of position with respect to time) of the grating versus time. The abrupt impulses 24 in acceleration are apparent, meaning that the grating 11 of FIG. 1 is &#34;jerked&#34; by a sudden acceleration and again by a sudden deceleration. This jerking is the cause of the aforementioned overshoot and resonances. 
     One prior art approach to the problem is to electronically filter the commands output by microprocessor 15 (see FIG. 1) so as to smooth out the commands to the galvanometer 13. However, this approach does not eliminate the jerking because typically the velocity of rotation still changes very abruptly, since the velocity achieves maximum value typically in much less than one time constant of the filter, so that resonance (i.e., ringing) still occurs. Also, a filter used for such purposes takes a long time period to settle to its final output level; this long time period slows the overall response of the system. 
     SUMMARY OF THE INVENTION 
     In accordance with the present invention, a method and device are provided to improve the performance of a conventional galvanometer (or other electric motor drive) which rotates an object such as a diffraction grating, where the object is smooth and accurate rotation of the object to a desired position. 
     The method of the present invention in the preferred embodiment includes modifications to the software in the conventional microprocessor that issues commands to the galvanometer. In accordance with the preferred embodiment, the microprocessor issues commands (i.e., signals) to the galvanometer to rotate the object in a series of discrete steps, so as to rotate the object to the desired position. The discrete steps simulate a smooth rotation in terms of the position of the object. The amount of movement in each discrete step is calculated by the microprocessor to be close to a smooth curve when the amount of rotation is plotted as a function of time. 
    
    
     BRIEF DESCRIPTION OF THE FIGURES 
     FIG. 1 depicts a prior art galvanometer servo system. 
     FIGS. 2A, 2B, and 2C depict graphically the prior art rotation of an object. 
     FIGS. 3A, 3B, 3C depict a servo system in accordance with the present invention. 
     FIGS. 4A, 4B and 4C depict the rotation of an object in accordance with the present invention. 
     FIG. 5 depicts in flow chart form a computer program in accordance with the preferred embodiment of the present invention. 
     FIGS. 6A, 6A&#34;, 6A&#39;&#34; and 6B show the computer program of FIG. 5 as used in the preferred embodiment of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     FIG. 3A depicts a servo system 30 in accordance with the preferred embodiment of the invention. 
     Conventional microprocessor 31 (preferably a commercially available 6803-type eight bit microcontroller) provides step commands to ultimately drive galvanometer 39A (preferably a commercially available galvanometer from General Scanning, part no. G325DT). The commands are issued from microprocessor 31 to conventional digital to analog converter 32 (preferably commercially available Analog Devices part no. AD667). The resulting analog step signals are provided to conventional two pole low pass active filter 33, which cuts off frequencies over 180 Hz. The preferred circuit of filter 33 is shown in FIG. 3C, with preferred component values as shown. 
     The output of the filter 33 is the command signal input 33A to a closed loop servo control circuit. The command signal is used to drive a conventional feed forward circuit 34, and is also summed with the inverse of the positional sensor output 35 to provide an error signal 36. This error signal 36 goes into a lag, or integrator amplifier 37 and a proportional amplifier 38. These two signals are summed along with the feed forward circuit 34 output and the inverse of the output of a lead, or derivative amplifier 35A connected to the positional sensor output 35, to provide a signal that is amplified by amplifier 39 and used to drive the galvanometer 39A. The purpose of the lead amplifier 35A is to provide system damping, or stability. The purpose of the feed forward circuit 34 is to quicken the response of the system. Feed forward circuit 34 does this by deriving a drive signal directly from the command input which is reasonably close to the actual signal required to drive the galvanometer 39A to the desired position. Without the feed forward circuit 34 the system 30 reacts to a command input only as the error signal becomes non-zero. Hence, the feed forward circuit 34 provides an anticipatory feature to the system 30. The feed forward circuit 34 consists of conventional proportional and derivative amplifiers with their outputs summed together. 
     Details of the integrator 37 including an integrator cutout feature are shown in FIG. 3B, together with preferred component values. When the grating 39B is stationary, the integrator cutout FET (field effect transistor) switch 3A1 is kept open, allowing the capacitor 3A2 to acquire charge, which has the effect of reducing the error signal 36 to zero, in accordance with conventional servo control theory. During grating 39B movement, however, if the switch 3A1 is left open, the capacitor 3A2 accumulates a charge that bears no relation to that charge required to maintain a zero error at the new position, and is typically far larger. The wait for the circuit to dissipate this charge slows down the response of the system 30. The integration cutout switch 3A1 is closed by the microprocessor 31 during the period of the smooth rotation and opened only when the command signal is a stationary signal. 
     The system 30 as shown in FIG. 3A includes, preferably installed in microprocessor 31, software (not shown) that generates the commands provided ultimately to the galvanometer 39A. The software computes a series of discrete commands to move a step that simulate the minimum jerk curve (i.e., smooth) rotation of grating 39B. 
     The microprocessor 31 computes by means of this software the value for each step by the equation: 
     
         Y=Y.sub.p +(Y.sub.n -Y.sub.p) * J.sub.n 
    
     where: 
     Y p  =previous grating command position; 
     Y n  =desired grating command position; 
     J n  =minimum jerk curve value, derived from a lookup table for each step. 
     J n  is calculated for the lookup table as 
     
         J.sub.n =(n/T)-(1/(2*π) * sin (2*π* n/T)) 
    
     where: 
     n=step number; 
     T=total number of steps. 
     &#34;Grating command position&#34; is a number that linearly corresponds to a given grating position. 
     FIG. 4A shows the angular position (vertical axis) versus time (horizontal axis) of the grating 39B of FIG. 3A as rotated in accordance with the present invention. The smoothness of the movement is apparent compared to that shown in corresponding prior art FIG. 2A. FIG. 4B shows the velocity of the grating 39B versus time; again, the velocity curve is smooth compared to that of corresponding prior art FIG. 2B. FIG. 4C shows the acceleration of the grating 39B versus time; the acceleration is also smooth compared to that of corresponding prior art FIG. 2C as seen in FIG. 4C the angular acceleration is proportional to a sine function of time, as are angular position and angular velocity in FIGS 4A and 4B respectively. 
     Thus FIGS. 4A, 4B and 4C show how the grating 39B (or any other object) is rotated smoothly in accordance with the present invention, so eliminating the problems caused by jerking in the prior art. 
     FIG. 5 depicts in flowchart form the preferred embodiment of the computer software as used in microprocessor 31 of FIG. 3A. The assembly language software as used in the preferred embodiment of the invention is shown in FIGS. 6A and 6B. 
     In a second embodiment of the invention, filter 33 (see FIG. 3A) is dispensed with. The feed forward 34 of FIG. 3A is also dispensed with in yet another embodiment. Similarly, the integrator 37 cutout switch 3A1 (see FIG. 3B) of the preferred embodiment is omitted in another embodiment. 
     The above description of the invention is illustrative and not limiting; other embodiments will be apparent to those skilled in the art in light of the teachings of the invention.