Non-adjustable pointer-tracker gimbal used for directed infrared countermeasures systems

09778028 · 2017-10-03

Assignee

Inventors

Cpc classification

International classification

Abstract

In a directed infrared countermeasure system, to assure parallelism between the line-of-sight to a target and the output beam, the input and output mirrors are fixedly attached to a uni-construction arm mounted to a rotatable azimuth platter to which internal mirrors are also fixedly attached. A system is provided for zeroing out alignment errors by developing an aim-point map for the gimbal that records initial alignment errors induced by manufacturing tolerances and uses the aim-point map error values to correct the output mirror orientation. The system also corrects for alignment errors induced by thermal gradients.

Claims

1. A method for minimizing the angular displacement of a laser beam from a gimbal with respect to a line-of-sight from the gimbal to a target, comprising: for a given gimbal, during a calibration, measuring the angular error between the output laser beam and the line-of-sight to a fiducial target for a number of different line-of-sight angles with respect to the gimbal; and, repositioning an output mirror to make the output beam parallel with the line-of-sight to a real target utilizing an offset generated from an aim-point map into which is recorded the angular displacement error associated with each of a number of different lines of sight corresponding to different line-of-sight angles to the fiducial target, whereby parallelism is achieved through repositioning of the output mirror after real target acquisition, as opposed to individually adjusting any of the mirrors in the gimbal to achieve alignment.

2. The method of claim 1, wherein the gimbal includes an input mirror, the output mirror and internal mirrors, and further including the step of locking down all of the mirrors to the gimbal in a non-adjustable fashion, whereby complicated mirror adjustments to provide alignment are avoided.

3. The method of claim 2, and furthering including the step of fixedly mounting the input and output mirror at opposite ends of a uni-construction elevation arm mounted for rotation about the elevation axis of the gimbal, whereby the output and input mirrors are repositioned in part by driving the elevation arm in accordance with the offset from the aim-point map.

4. The method of claim 3, wherein the repositioning of the output mirror includes driving the azimuth platter in accordance with the offset from the aim-point map.

5. The method of claim 1, wherein the output mirror is repositioned in accordance with the combined movement of the elevation arm and the azimuth platter in accordance with the offset from the aim-point map.

6. The method of claim 1, wherein the initialization procedure includes mounting a fixed reflective target distance from the gimbal and rotating the gimbal so as to establish a number of line-of-sight angles to the fixed reflective target and the gimbal; and recording the error between the return from the fixed reflective target image on the focal plane array and the image of the fixed reflective target on the focal plane array such that the errors are recorded in the aim-point map referenced to the line-of-sight angle, whereby the errors are accessible by line-of-sight angles from the aim-point map.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) These and other features of the subject invention will be better understood in connection with the Detailed Description, in conjunction with the Drawings, of which:

(2) FIG. 1 is a diagrammatic illustration of a directed infrared countermeasures pointer-tracker gimbal illustrating the line-of-sight to a threat such as an incoming missile and a laser beam which misses the missile due to parallax inaccuracy; in which the parallax must be adjusted out by adjusting the mirrors or by using other mechanisms;

(3) FIG. 2 is a diagrammatic illustration of a pointer-tracker gimbal in which all mirrors, the input mirror, internal mirrors and the output mirror are independently adjustable to compensate for errors between the image path or line-of-sight to the target, and the laser path of the outgoing laser beam to establish parallelism between the two paths, noting the number of potential items needing adjustment;

(4) FIG. 3 is a diagrammatic illustration of the subject system using unadjusted mirrors in which all mirrors are affixed to a rigid assembly comprising the elevation and azimuth stages of the gimbal, and in which an aim-point error map lookup table provides an offset through an offset generator for driving the elevation and azimuth stages of the gimbal which offsets the laser beam by the amount specified by the aim-point map to establish laser energy on target.

(5) FIG. 4a is a diagrammatic illustration of the elements in the gimbal of FIG. 3 showing an elevation arm to which input mirror and output mirrors are fixedly attached, with the elevation arm carried on an azimuth platter to which the internal mirrors are fixedly attached, showing a target image displaced from the center of the focal plane array, also showing the parallax between the laser output beam and the line-of-sight to the target;

(6) FIG. 4b is a diagrammatic illustration of the system of FIG. 4a, showing applying aim-point map corrections which are then converted to drive coordinates that are in turn used to generate azimuth and elevation drive signals to move the output mirror to correct for parallax errors and place laser energy on target;

(7) FIG. 5 is a diagrammatic illustration of the fixing of the input mirror and the output mirror to a uni-construction elevation arm;

(8) FIG. 6 is a diagrammatic illustration of the elevation arm of FIG. 5, illustrating the angular displacement between the line-of-sight to the target and the outgoing laser beam due to manufacturing tolerances in fabrication;

(9) FIG. 7 is a diagrammatic illustration of the mounting of the uni-construction elevation arm of FIG. 6 on an azimuth platter, in which the elevation and azimuth stages are utilized first to center the target image on the focal plane array in a gimbal camera and then to aim the output of a laser to be parallel with the line-of-sight to the target;

(10) FIG. 8 is a diagrammatic illustration of the movement of the elevation arm subsequent to the imaging of a target on the focal plane array of FIG. 1 in which the output mirror is moved by the elevation arm and the azimuth platter by the offset established by the aim-point map, such that the laser beam is made to exit parallel to the line-of-sight to the target; and,

(11) FIG. 9 is a diagrammatic schematic of the boresight alignment system including a retro-return prism.

DETAILED DESCRIPTION

(12) Referring now to FIG. 1, a pointer-tracker gimbal 10 is utilized to detect the line-of-sight 12 to a target 14 and aim a laser beam 16 towards the head of the missile.

(13) Pointing accuracies required for such pointer-trackers are substantial. The pointing accuracies required to assure a hit on the target must be less than the total errors within the system, namely in one embodiment a 200 microradian divergence between the line-of-sight to the target and the projected laser beam. As illustrated, the laser beam path 16 and the line-of-sight to the true target 14 must be brought into alignment as would be the case with a coincidence of the back projection of the laser 16 beam with target image 19 on focal plane array 17. This is done by adjustments that must be maintained during the harsh environment of military aircraft.

(14) This stringent requirement in and of itself is extremely difficult to achieve and as shown in FIG. 2, gimbals require individually adjustable mirrors, namely an input mirror 18, a series of internal mirrors 20 and 24, and an output mirror 26 and their affiliated mounting mechanisms. Included in the potential adjustments are laser 32, telescope 28 and focal plane array 17.

(15) The DIRCM head of FIG. 2 utilizes a camera 27 including telescope 28 and focal plane array 17, along with laser 32.

(16) The input path 34, or line-of-sight to the target, is such that the image is redirected at the surface of input mirror 18 towards adjustable internal mirror 24 where it is redirected through telescope 28 onto focal plane array 17. The gimbaling system moves the various mirrors to center the target image at the center of the focal plane array. When this has been achieved a laser beam 36 is redirected by a series of mirrors 38 and 39 so that the output of laser 32 is directed along the centerline 40 of the gimbal or the azimuth axis.

(17) Thereafter, the laser beam is projected along axis 40 and is redirected by adjustable internal mirror 20 towards output mirror 26 where it is redirected along laser path 28.

(18) Note the parallelism of the input path and the laser path are determined by the precise positions of all of the mirrors and mechanical supports involved. Some pointer-tracker gimbals independently adjust some or all of the mirrors to establish this parallelism. As mentioned previously, the adjustment required also includes adjustment of the laser, the camera and any other support mechanisms that influence beam parallelism.

(19) It will be appreciated that the adjustment of mirrors to establish parallelism is a daunting task. The result is that it is only with difficulty that one can adjust the mirrors to make sure that the laser path is parallel with the image path line-of-sight to the target.

(20) More often than not there is an excessive angular error between the line-of-sight input path and the actual direction of the output laser beam as illustrated by dotted lines 44 and 45. As mentioned hereinabove, there is a requirement to provide a much more simple system in order to assure that the laser beam projected out from dome 46 of the gimbal be properly aligned with the line-of-sight to the target, especially to a less than 200 microradian error.

(21) It is also noted that cross coupling errors between the various moving mirrors in the system shown in FIG. 2 are cumulative, which in part explains the difficulty in establishing the parallelism required.

(22) As illustrated in FIG. 3 and as will be described, gimbal 10 is provided with mirrors that are fixed with no adjustments possible. Rather than trying to adjust each of the individual mirrors to eliminate aiming errors, in the subject system the azimuth and elevation stages are moved to reposition the output mirror by an offset determined by a calibration procedure that results in the generation of an aim-point map 50. Using this map, an offset generator 52 repositions the azimuth and elevation stages of the gimbal to offset the position of the output mirror to place laser energy on target.

(23) As can be seen the position of the laser beam back projected on focal plane array is initially set up to be at the center of the focal plane array. Once acquired, the target image is displaced from the center of the focal plane array by an X and Y offset. To get the laser beam to hit the target, the X and Y offsets are used to move the azimuth and elevation drives. However, due to the tolerance problems mentioned above the X and Y offsets are modified by the calibration values from the aim-point map.

(24) The calibration procedure requires taking the gimbal and mounting it to a rotating table. In one embodiment, the table is rotated every 5° and tracks a fixed target. The laser is fired against a reflective background and the laser image is recorded on the focal plane array. This produces two images on the focal plane array, one the target and the other the laser energy. The X/Y offset is recorded in the aim-point map 50 relative to a specific gimbal angle, and the calibration process is repeated every 5° or to whatever resolution needed.

(25) Thus, the gimbal is rotated in increments to establish the corresponding errors for all of the lines of sight within the field of view of the gimbal.

(26) Therefore, what is established are measured angle-dependant aiming errors. The corresponding offsets for the output mirror are then generated by offset generator 52 for a detected line-of-sight to the target.

(27) In operation, first a target is acquired utilizing an on-board missile acquisition warning system in which fixed cameras located around the periphery of the aircraft look out over a certain field of regard. When a target appears within the field of regard, the coordinates of the target are calculated from the missile acquisition warning system and Euler's equation is used to transpose the coordinates of the target into platform coordinates. Once this has been accomplished, gimbal 10 is slewed over so as to position the target image in the field of view of camera 69 which is used as the “fine track sensor” within gimbal 10.

(28) Having located the target image on the focal plane array of camera 69, the subject system measures the distance from the center of the focal plane array to the target image point. This is done by measuring the displacement of the image from the center of the focal plane array 72 in the X and Y directions. Note that when one measures the X and Y coordinates of the image displacement, one is no longer dealing with the world coordinates or platform coordinates, but rather simply coordinates related to the focal plane array.

(29) Once the displacement from the center of the focal plane array is ascertained, the aim-point map look up table (LUT) 50 is accessed to correct or modify the X and Y coordinates of the image based on the previously established aim-point map errors. These modified X and Y coordinates are then used to stimulate the gimbal motors to move the azimuth and elevation stages, and this is done taking into account the offsets recorded in the aim-point map. This places laser energy on the target by reducing as close to zero the parallax error between the image and laser paths.

(30) Note that the modified X and Y displacements used in this process do not directly relate to motor drive coordinates. Rather, they are rotated with an end point rotation algorithm that is applied when one drives the two motors in the azimuth and elevation directions to the end point established by the measured displacement and aim-point map error correction. Thus for any particular target one looks to the aim-point map to readjust the true aim-point.

(31) In short, the system measures the X and Y displacements from the center of the aim-point map to where the actual image is located on the focal plane array, with these measurements being corrected for the errors from the aim-point map. Noting that both the elevation arm and the azimuth plate have their own drive motors, it is the purpose of the subject invention to stimulate azimuth and elevation drives to reduce the parallax errors.

(32) In one embodiment, there is constant updating commensurate with the frame rate of the camera. Thus, if the aircraft has moved, with the elevation and azimuth drive motors being hefty enough, one can track the rapid target or aircraft movement.

(33) It is well to remember that just positioning the target image at the center of the focal plane array does not necessarily point the laser beam to the appropriate point in space due to the tolerances involved in the laser pointing process. Thus to compensate for the errors for a particular angle of arrival one looks up the aim-point map and readjusts. In short, one can measure the X and Y displacements on the focal plane array between the image and the laser beam and use the values of the aim-point map look-up table to correct these measured displacements.

(34) FIG. 4a depicts the hardware set illustrating the two paths: line-of-sight 62 or the image path to the target and laser path 92. The error in parallelism present between the two paths is labeled “parallax error”. Here it can be seen that a non-adjustable input or image mirror 60 redirects the image coming in along line-of-sight 62 to non-adjustable mirrors 64 and 65, one of which redirects the image through an aperture 66 in an azimuth platter 68 and into a telescope 70 and onto a focal plane array 72. The telescope and focal plane array are part of camera 69.

(35) Laser 74 has its beam redirected by mirrors 76 and 78 up through aperture 66 where it is redirected by internal mirror 65 onto the reflective surface of output mirror 80.

(36) In the subject invention input mirror 60 and the output mirror 80 are fixedly attached to a rigid elevation arm 82 which rotates about the elevation axis. It is also noted that the elevation arm is mounted on azimuth platter 68, whereas internal mirrors 64 and 65 are fixedly attached to the azimuth platter as well, but not attached to the elevation arm.

(37) It will thus be appreciated that mirrors 60, 64, 65 and 80 are non-adjustable and fixedly attached to their supports. Here, input mirror 60 and output mirror 80 are moved with the rotation of the elevation arm. Note that all the mirrors are moved with the rotation of the azimuth platter. Thus, the elevation arm as well as internal mirrors 64 and 65 attached to azimuth platter 68 are rotated with the azimuth platter coupled.

(38) As shown in FIG. 4b, target 14 is acquired from data supplied from the missile warning system. The gimbal 10 slews to the target location and an image of the target is acquired by camera 69 and focal plane array 72. At this point camera 69 starts to position the gimbal from data collected from the focal plane array. The uncorrected x, y target image coordinates of point 120 result in a displacement measured from the center of the focal plane array. This measurement as illustrated at 124 is added at 126 to the values from aim-point map 50 such that the uncorrected X and Y displacement is corrected and converted to drive coordinates at 128. These drive coordinates are coupled to an azimuth and elevation drive 130 that are then coupled to an azimuth drive 86 and an elevation drive 84 to reposition the output mirror 80 to provide correction 90 to beam 92. This establishes adjusted beam 92′ to be parallel to line-of-sight 62. Since the repositioning of the output mirror also repositions the input mirror, a corrected line-of-sight 62′ is established. This in turn moves the target image on the focal plane array to the final target image location 120′. With the repositioning of the output mirror, the laser is now firing at the target with great accuracy.

(39) As shown in FIG. 4b, in order to rectify this situation, offset generator 52 is used to adjust both the elevation arm and the azimuth platter in accordance with measured X and Y displacements of the target image modified by the aim-point map values associated with the particular line-of-sight involved.

(40) This causes the output and input mirrors to be repositioned as shown by dotted lines 80′ and 60′, such that rather than directing the laser beam 92 in the direction shown which is not where the target is, laser beam 92 is reflected by the moved output mirror 80′ to now lie along beam path 92′ parallel to line-of-sight 62. This places the laser energy on the target. In moving output mirror into position 80′ the input or image mirror is also moved displacing the image from the center of the focal plane array to its final position as shown at 120′.

(41) As will be appreciated, when a target image comes in on a detected line-of-sight, the aim-point map lookup table is accessed by angle and outputs the appropriate error values to offset generator 52 that stimulates the elevation arm drive and the azimuth platter drive to adjust the position of the mirrors. Thus, the measured errors from the initial alignment are used to reposition the output and input mirrors.

(42) This eliminates the necessity of trying to adjust mirrors, or in fact trying to compensate on the fly for positional errors for all of the mirrors. In the subject invention, after manufacture, the positions of the mirrors are non-adjustable and compensation for pointing errors is under the control of the aim-point map generated in the calibration process.

(43) As to the construction of the uni-construction elevation arm, referring to FIG. 5, elevation arm 82 is shown with input mirror 60 and output mirror 80 fixedly attached. The arm is carried on trunnions 94 and 96 for rotation about an elevation axis 98, in which the trunnions are fixedly attached to azimuth platter 68 which rotates about an azimuth axis 100.

(44) Note that platter 68 is provided with a central aperture 102 through which the incoming path from the target passes and out of which the laser beam projects. As noted hereinafter, the camera including the telescope and focal plane array, as well as the laser are housed in gimbal housing 104.

(45) Referring now to FIG. 6, elevation arm 82 is shown in detail with input mirror 60 and output mirror 80 shown reflecting the target image that comes in over line-of-sight 62. If the mirrors are perfectly orthogonal to each other the angular displacement would be zero for the elevation arm only. However, creating a perfect elevation arm does not compensate for the remaining tolerances within the system. Here, the outgoing laser beam is reflected by output mirror 80 and is directed along a path 92. However, due to alignment errors and tolerances, there is an angular displacement 110 between the line-of-sight direction 62 and the direction 92 of the outgoing beam as shown by error 113.

(46) Here it can be seen that uni-construction elevation arm 82 has a U-shaped portion 112 having legs 114 and 116 to which mirrors 60 and 80 are respectively attached. The elevation arm drive includes a motor 119 which is located on a disk 121 fixedly attached to arm 116 of elevation arm 82.

(47) Referring now to FIG. 7 in which like elements have like reference characters, what can be seen is that the uni-construction elevation arm 82 fixedly carries input mirror 60 and output mirror 80 and is mounted for rotation about elevation axis 98. Here the internal mirrors 64 are shown mounted to an assembly 140 fixedly mounted to azimuth platter 68.

(48) As illustrated, camera 69 shown in dotted outline includes the aforementioned telescope and focal plane array, whereas the laser 74 is shown in dotted outline, all within gimbal housing 104.

(49) Referring now to FIG. 8, an original position of the elevation arm 82 is shown in which line-of-sight 62 and the resulting outgoing laser beam 92 are angularly displaced as illustrated by angular displacement 110. It is the purpose of the subject invention to be able to reposition output mirror 80 to cancel out any non-parallelity between these two beams to keep the angular alignment error within 200 microradians.

(50) In accordance with the offset 90 for the elevation stage, output mirror 80 is adjusted in the direction of arrow 130 utilizing elevation drive 84, driven in accordance with the offset from aim-point error map 50 so that the angular position of mirror 80 is changed to the indicated by dotted line 80′. Likewise, laser beam 92 is shifted by the repositioning of the output mirror 80 into its aligned position at 92′.

(51) As can be seen, the entire elevation arm is rotated either by the elevation drive or the azimuth platter drive, or both, such that it is altered in position as illustrated by the dotted outlines shown.

(52) The result is that with an angle of arrival established for the target image, the aim-point map is used to provide offsets to the elevation and azimuth drives to adjust the output mirror in accordance with the previously determined offset for the particular gimbal involved.

(53) As to the boresighting subsystem and referring to FIG. 9, at initial aim-point map calibration a reference boresight point is taken establishing the reference point with which to compare other periodic firings. At a pre-determined period the boresight is checked and the offset recorded. If there is a change to the boresight value this indicates a change to the aim-point and that value is added onto the aim-point map value as illustrated in FIG. 4b at βx and βy.

(54) FIG. 9 illustrates the mechanism that allows the laser to fire back into the gimbal and strike the focal plane array. The elevation arm 82 is positioned below the field of regard using a hard stop to maintain consistency. This points the input mirror 60 and the output mirror down toward a retro-return prism 134. The azimuth is driven to three determined spots and the laser is fired at each spot. As illustrated, the laser beam 16 strikes the output mirror 80 which is aimed at retro-return prism 134. The laser beam passes through the prism as illustrated by arrow 135 and exits pointing towards the input mirror 60 as illustrated by arrow 137. The reflective surface of input mirror directs the laser beam back into the gimbal via a fixed turning mirror as illustrated by arrows 141 and 142 down to focal plane array 72.

(55) In one embodiment, the original calibration boresight image 138 on the focal plane array 72 was taken at the same time the aim-point map was generated. If there were no thermal gradients, each time a subsequent boresight alignment is attempted the laser beam would come back to the same point on the focal plane array. However, in the face of thermal gradients the returned laser beam is offset on the focal plane array by an offset 136. This offset is recorded and as illustrated in FIG. 4b, the boresight corrections βx and βy are added to the aim-point values to compensate for temperature gradients. Note that the boresight alignment may be periodically commenced before an engagement.

(56) An appendix is provided which describes the source code used in the subject invention.

(57) It will be appreciated that the drive for the two axis gimbal described herein is available commercially off-the-shelf from a variety of different vendors.

(58) While the present invention has been described in connection with the preferred embodiments of the various figures, it is to be understood that other similar embodiments may be used or modifications or additions may be made to the described embodiment for performing the same function of the present invention without deviating therefrom. Therefore, the present invention should not be limited to any single embodiment, but rather construed in breadth and scope in accordance with the recitation of the appended claims.

(59) TABLE-US-00001 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / /    FUNCTION:  Aim-Point_Map_correction / / / /     PURPOSE:  The purpose of this function is to perform boresight correction / /           on the polar coordinate inputs using the aim-point map data. / / / / embedded image / / / /    NOTES:   Boresight values will be set to zero until the target is / /           centered within a 32x32 window. Then first time, values will / /           be limited, after that boresight table values will be used. / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / struct cmd_az_el Boresight_correction(float TgtTnterceptAz, float TgtInterceptE1) {      float azoffset, eloffset, Sumaz_el;      float finalValueaz, finalValueel, TargetAz, TargetE1;      struct cmd_az_el ATMPT, APOINT;      / * Convert from radians to degrees * /      TargetAz = TgtInterceptAz * RAD2DEG;      TargetE1 = TgtInterceptE1 * RAD2DEG;      / * Detemine the 2 closest index points in the boresight table, one      greater and one smaller than the point. Do for az and el */      / * Point 0 * /      POINTS [0] .az = (int) ((TargetAz/5) + 36);  / * 180/5 = 36  * /      POINTS [0] .el = (int) ((TargetE1/5) + 6);   / * 30/5 = 6   * /      / * Point 1 * /      POINTS [1] .az = POINTS [0] .az +1;      POINTS [1] .el = POINTS [0] .e1;      / * Point 2 * /      POINTS [2] .az = POINTS [0] .az;      POINTS [2] .el = POINTS [0] .el +1;      / * Correct for those points on the table edge * /      if (POINTS [0] .az == 72) {        POINTS [1] .az = 72;      }      else if (POINTS [0] .az == 0) {        POINTS [1] .az = 0;      }      if (POINTS [0] .e1 == 0) {        POINTS [2] .el = 0;      }      else if (POINTS [0]. el == 24) {        POINTS [2] .el = 24;      }      / * Point 3 * /      POINTS [3] .az = POINTS [1] .az;      POINTS [3] .el = POINTS [2] .el;      / * Determine the intercept percentage az and el offset from point one.    First convert POINT [x] .az index to degrees, az table index 2 is - 170    degrees * /      azoffset = (TargetAz - (POINTS [0] .az * 5 - 180)) /5;      eloffset = (TargetEl - (POINTS [0] .el * 5 - 30)) /5;      finalValueaz = ((1-azoffset) * (1-eloffset) *        BORESIGHT_TBL.tbl [POINTS [0] .el] [POINTS [0] .az] .az) +        (azoffset * (1-elloffset) *        BORESIGHT_TBL.tbl [POINTS [1] .el] [POINTS [1] .az] .az) +        (azoffset * eloffset *        BORESIGHT_TBL.tbl [POINTS [3] .el] [POINTS [3] .az] .az) +        ((1-azoffset) * eloffset *        BORESIGHT_TBL.tbl [POINTS [2] .e1] [POINTS [2] .az] .az) ;      finalValuee1 = ((1-azoffset) * (1-eloffset) *        BORESIGHT_TBL.tbl [POINTS [0] .e1] [POINTS [0] .az] .el) *        (azoffset * (1-eloffset) *        BORESIGHT_TBL.tbl [POINTS [1] .e1] [POINTS [1] .az] .el) *        (azoffset * eloffset *        BORESIGHT_TBL.tbl [POINTS [3] .e1] [POINTS [3] .az] .el) +        ((1-azoffset) * eloffset *        BORESIGHT_TBL.tbl [POINTS [2] .e1] [POINTS [2] .az] .el) ;      / * Sum the angles in radians * /      Sumaz_el = TgtInterceptAz + TgtInterceptEl;      / * Calculate offset aimpoint * /      AIMPT.az = finalValueez + AUTO_DIFS.gimbaltube.X +       (AUTO_DIFS.mirror.X * cos (Sumaz_el)) +        (AUTO_DIFS.mirror.Y * sin (Sumaz_el)) ;      ATMPT.el = finalValueel + AUTO_DIFS.gimbaltube.Y +       (AUTO_DIFS.mirror.Y * cos (Sumaz_el)) −        (AUTO_DIFS.mirror.X * sin (Sumaz_el));      / * Zero boresight values until target is centered in 32x32 window * /      if (!LaserOffsetMode) {        APOINT.az = 0.0;        APOINT.e1 = 0.0;      }      / * when switching to laser offset. limit max offset on first usage    * /      else {        if (LimitFlag) {          if (fabs (AIMPT.az) > PIXELOFFSETLIMIT) {            AIMPT.az *= divider;          }          if (fabs (ATMPT.el) > PIXELOFFSETLIMIT) {            AIMPT.el *= divider;          }          divider += 0.1;          if (divider > 1.0) {            LimitFlag = FALSE;          }      }      / * Convert pixedl aimpoint to radians * /      APOINT.az = PIXEL2RAD * AIMPT.az;      APOINT.el = PIXEL2RAD * AIMPT.el/      }      return (APOINT); } * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / /    FUNCTION:   Autoboresight_processing / / / /    PURPOSE:      The purpose of this function is to handle autoboresight / /         processing for four angles. This is done after each boresight / /         position commanded by the IPC and at pbit and cbit. / / / /    NOTES: / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / void Autoboresight_processing (void) {      int sindex, Bad_value_flag= FALSE;      float autoAzvalue, autoElvalue, rota;      double eltotal=0, aztotal = 0, totAZpts=0, totELpts=0, aveAZpts=0,    aveELpts=0;      double totSQazpts=0, totSQelpts=0;      double newaz, newel;      unsigned char err;      / * It has taken too long to collect autoboresight data, timeout is 3secs* /      if (End_autoboresight_timeout ==0)      {        Bad value flag = TRUE;        printf (“aE ”);      }      else      {        / * if (target is centered in 100x100 pixels) {* /        if (fabs(TRACK_PROCESSOR_RPT.targetl_boresight_X) <= 128.0 &&         fabs(TRACK_PROCESSOR_RPT.targetl_boresight_Y) <= 128.0)        {          / * Target is centered in both az and el, save the values * /          tgt_pos[auto_sample_index] .az =            TRACK_PROCESSOR_RPT.targetl_boresight_X;          tgt_pos[auto_sample_index] .el =            TRACK_PROCESSOR_RPT.targetl_boresight_Y;          auto_sample_index++;          / * Are NUMOFTPSAMPLES collected * /          if (auto_sample_index > (NUMOFTPSAMPLES))          {            / * else get autoboresight values for current angle * /            autoAzvalue = AUTO_ANGLES.angle [current_angle] .az;            autoElvalue = AUTO_ANGLES.angle [current_angles] .el;            / * Determine how much each sample varies from              autoboresight values * /            for (sindex=1; sindex < NUMOFTSAMPLES+1; sindex++)            {              aztotal += tgt_pos [sindex] .az = autoAzvalue;              eltotal += tgt_pos [sindex] .el = autoElvalue;            }            / * Store average variation over the NUMOFTPSAMPLES         samples * /            averageAz [current_angle] = aztotal / NUMOFTPSAMPLES;            averageEl [current_angle] = eltotal / NUMOFTPSAMPLES;            / * Calculate standard deviation - UPDATE -            get average * /            for (sindex=1; sindex < NUMOFTSAMPLES+1; sindex++)            {              totAZpts += tgt_pos [sindex] .az;              totELpts += tgt_pos [sindex] .el;            }            aveAZpts = totAZpts / NUMOFTPSAMPLES;            aveELpts = totELpts / NUMOFTPSAMPLES;            eltotal = 0;            aztotal = 0;            for (sindex=1; sindex < NUMOFTPSAMPLES+1; sindex++)            {              aztotal += pow ((tgt_pos [sindex] .az - aveAZpts), 2);              eltotal += pow ((tgt_pos [sindex] .el - aveELpts), 2);            }            if (sqrt (aztotal/(NUMOFTPTSAMPLES -1)} > 0.250 | |             sqrt (eltotal/ (NUMOFTPSAMPLES -1)) > 0.250)            {              err = 88;   / * exceeded standard deviation * /              send_Health_IPC (err);            }            totAZpts = 0.0;            totELpts = 0.0;            totSQazpts = 0.0;            totSQelpts = 0.0;            / * Calculate standard deviation - UPDATE -            get average * /            for (sindex=1; sindex < NUMOFTSAMPLES+1; sindex++)            {              totAZpts += tgt_pos [sindex] .az;              totELpts += tgt_pos [sindex] .el;              totSQazpta += pow [tgt_pos [sindex] .az , 2);              totSQelpts += pow (tgt_pos [sindex] .e1 , 2);            }            newaz = pow (totAZpts, 2) / NUMOFTSAMPLES;            newel = pow (totELpts, 2) / NUMOFTSAMPLES;            if (((sqrt (totSQazts - newaz) /             sqrt (NUMOFTPSAMPLES -1)) > 0.250) | |             ((sqrt (totSQelpts - newel) /             sqrt (NUMOFTPSAMPLES -1)) > 0.250))            {              err = 88;   / * exceeded standard deviation * /              send_Health_IPC (err);            }          }  / * if auto_sample_index <= (NUMOFTSAMPLES -1) * /          / * Haven't collected all samples yet * /          else          {            return;          }        } / * if centered * /        else / * Can't collect samples until centered * /        {         return;        }      } / * End_autoboresight timer = 0 * /      / * Stop collecting because finished or wait until ready for next angle * /      process_outgoing_LI_messages (STOP_BORE);      Autoboresight_collect = FALSE;      TPstate = STNDBY;      processs_outgoing_TP_messages (AUTOTRACK, DISARM);      / * Finished processing for current angle, increment to next angle * /      current_angle++;      / * Are there more angles to process * /      if (current_angle < 4)      {        if (Autoboresight_in_progress)        {         AutoWaittimer = 44; / * 11 seconds delay * /         End_autoboresight_timeout = 0; / * reset to zero * /         auto_sample_index =0;        }      }      / * All 4 angles been processed * /      else      {        / *threat_processing (HOME. 0); * /        Autoboresight_timeout = 0;        End_autoboresight_timeout =   0; / * reset to zero * /        / * auto frame position and integ * /        process_outgoing_TP_messages (9, 5);        Autoboresight_in_progress = FALSE;        if (Bad_value_flag)        {         send_Alert_IPC (BAD_AUTOBORESIGHT_DATA);        }        else        {         eltotal = 0;         aztotal = 0;         / * Calculate autoboresight correction attributable to tube * /         AUTO_UPDATE.tube_value.az = (averageAz [angle1] +             averageAz [angle2] +          averageAz [angle3] + averageAz [angle4])/4;         AUTO_UPDATE.tube_values.el = (averageE1 [angle1] +             averageEl [angle2] +          averageEl [angle3] + averageEl [angle4])/4; ;         / * Calculate standard deviation for Azimuth * /         if (sqrt ( (         pow ( (averageAz [angle1] − AUTO_UPDATE.tube_values.az), 2) +         pow ( (averageAz [angle2] − AUTO_UPDATE.tube_values.az), 2) +         pow ( (averageAz [angle3] − AUTO_UPDATE.tube_values.az), 2) +         pow ( (averageAz [angle4] − AUTO_UPDATE.tube_values.az), 2) ) /4)         > 0.250)        {             err = 88; / * exceeded standard deviation * /             send_Health_IPC (err);        }        / * Calculate standard deviation for Evalution * /        else if (sqrt ( (         pow ( (averageEl [angle1] − AUTO_UPDATE.tube_values.el), 2) +         pow ( (averageEl [angle2] − AUTO_UPDATE.tube_values.el), 2) +         pow ( (averageEl [angle3] − AUTO_UPDATE.tube_values.el), 2) +         pow ( (averageEl [angle4] − AUTO_UPDATE.tube_values.el), 2) ) /4)         > 0.250)        {             err = 88; / * exceeded standard deviation * /             send_Health_IPC (err);        }        / * Calculate autoboresight correction attributable to mirrors * /        aztotal = ( (averageAz [angle1] - AUTO_UPDATE.tube_values.az) −         (averageAz [angle3] - AUTO_UPDATE.tube_values.az) −         (averageEl [angle2] - AUTO_UPDATE.tube_values.el) +         (averageEl [angle4] - AUTO_UPDATE.tube_values.el) ) / 4;        eltotal = ( (averageEl [angle1] − AUTO_UPDATE.tube_values.el) −         (averageEl [angle3] - AUTO_UPDATE.tube_values.el) −         (averageAz [angle2] - AUTO_UPDATE.tube_values.az) +         (averageAz [angle4] - AUTO_UPDATE.tube_values.az) ) / 4;        rota = (Auto_Starting_Az + Auto_Starting_El) * DEG2RAD;        AUTO_UPDATE.mirror_values.az =         (aztotal * cos (− rotal) ) + (eltotal * sin (− rotal) ) ;        AUTO_UPDATE.mirror_values.el =         (eltotal * cos (− rotal) ) − (aztotal * sin (− rotal) ) ;        threat_processing(AUTO_UP, 0);        send_Autoboresight_Update_IPC ( ) ;       }      }     }