10.07.2015 Views

Application Note 03 – Absolute angle computation - Netzer

Application Note 03 – Absolute angle computation - Netzer

Application Note 03 – Absolute angle computation - Netzer

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If this operation is not supported by the processor a sine/cosine pair can be converted to itscorresponding electric <strong>angle</strong> using the following steps:1. Compare the polarities of the Sine and Cosine to identify the quadrant of the Electric Cycle(table 1).Table 1‐ Quadrant of the Electric CycleSine polarity Cosine polarity QuadrantPositive Positive 1 (0º‐90º)Positive Negative 2 (90º‐180º)Negative Negative 3 (180º‐270º)Negative Positive 4 (270º‐360º)2. Compare the absolute values of the Sine and Cosine to identify the octant of the ElectricCycle (table 2).Table 2 ‐ Octant of the Electric CycleOctant|Sine|>|Cosine| |Sine|


A manual method for offset voltage measurement is described in AN‐02 however, offset voltagescompensation should preferably based on the digitized signals; this would take into accountpotential contributions of the differential amplifier and the A/D converter.The average value of the Sine, or Cosine, over one period of an electric cycle (regardless of the start<strong>angle</strong> and provided the sample points are differ by an equal angular position) equals the DC level(offset) on which the Sine or Cosine signals rides, but averaging over more than one period is morerobust (notice that the number of the sampled ECs must be an integer). To determine the offsetvoltage the following steps are recommended.1. Close a position loop on the Fine mode.2. Lock to position and open the position loop.3. Read the Fine Sine and Cosine outputs (relative to Vref).4. Switch the Coarse mode.5. Read the Coarse Sine and Cosine outputs (relative to Vref).6. Switch the Fine mode.7. Rotate the rotor to a new <strong>angle</strong> (maximum 36º/N).8. Repeat steps 1 to 7 till one full mechanical revolution is obtained.9. The average of the Fine Sine readings is the Fine Sine offset.10. The average of the Fine Cosine readings is the Fine Cosine offset.11. The average of the Coarse Sine readings is the Coarse Sine offset.12. The average of the Coarse Cosine readings is the Coarse Cosine offset.In case that closing a position loop is impossible take the following actions:1. Read the Fine Sine and Cosine outputs (relative to Vref).2. Rotate the rotor to a new <strong>angle</strong> (around 36º/N).3. Repeat steps 1 and 2 till one full mechanical revolution is obtained.4. Run the "Offset_Itterations" C function to obtain the offsets.5. Repeat steps 1 to 4 for the other mode as well.<strong>Note</strong>: The offset calculation should be performed only once – at the time of the installation.4. Mechanical offset <strong>angle</strong> compensationIn an “ideal” encoder there is a position where the Fine and Coarse electric <strong>angle</strong>s are both zero. Dueto production tolerances the nearest zeroes are separated by a mechanical offset <strong>angle</strong>. Themechanical offset <strong>angle</strong> can be interpreted as the Fine shift versus the Coarse or vice versa. The firstcalled Fine Shift Angle (FSA) and the second called Coarse Adjustment Angle (CAA). To obtain FSAfollow the following steps:1. Obtain the Fine Sine and Cosine raw data in one of the methods described at section 3.2. Run the "Calc_Angular_Offset" C function to obtain the FSA value.<strong>Note</strong>: The Offset Angle calculation should be preformed only once; after mechanical installation.5. <strong>Absolute</strong> rotation <strong>angle</strong> calculationwww.netzerprecision.com AN‐<strong>03</strong>, <strong>Absolute</strong> <strong>angle</strong> <strong>computation</strong> 4 / 12


Any calculated Coarse electric <strong>angle</strong> C‐EA may correspond to M mechanical positions while eachcalculated Fine electric <strong>angle</strong> F‐EA may correspond to N mechanical positions, however, only onemechanical rotation <strong>angle</strong> corresponds to both Coarse and Fine electrical <strong>angle</strong>s. This <strong>angle</strong> iscalculated knowing N and M, finding the Fine index, and using the measured Fine electric <strong>angle</strong> (F‐EA) and the coarse electric <strong>angle</strong> (C‐EA) as follows:1. Run the MN algorithm ("Index_Calc" C function) to get the Fine_Index2. The <strong>Absolute</strong> <strong>angle</strong> will be the result of:<strong>Absolute</strong>Angle = (F‐Index + F‐EA/360)*360/F‐EC<strong>Note</strong>: The Fine_Index (and Coarse_Index) can be also obtained by using a LUT that can be foundon Appendix A.6. Updating the <strong>Absolute</strong> Position IncrementallyTo continuously track the absolute <strong>angle</strong> by the Fine signals alone (without getting the Fine Indexagain) the system must be able to compare the current Fine reading should be compared to theprevious Fine reading using the auxiliary variable Δ φ .Δ φ = (current Fine reading) ‐ (previous Fine reading)Use the following table to decide if and how the Fine index will be changed:Table 3 ‐ Fine indexMovementF Re s Movement Fine IndexΔφ > 0 Δφ >change2 direction changeCommand1 No No Negative None Abs=+ Δ φ2 Yes No Positive None Abs=+ Δ φ3 No Yes Negative Fine_Index++ Abs=+FineRes+ Δ φ4 Yes Yes Positive Fine_Index‐‐ Abs=‐FineRes+ Δ φFor the algorithms to work correctly when incrementally updating the absolute position, the shaftspeed should not exceed one half of a fine cycle per <strong>computation</strong> cycle, which imposes a maximumspeed on the encoder as follows:360 * SR [ Hz]Vel[ RPM ]


50.625 61.875 561.875 73.125 673.125 84.375 784.375 95.625 895.625 106.875 9106.875 118.125 10118.125 129.375 11129.375 140.625 12140.625 151.875 13151.875 163.125 14163.125 174.375 15174.375 185.625 16185.625 196.875 17196.875 208.125 18208.125 219.375 19219.375 230.625 20230.625 241.875 21241.875 253.125 22253.125 264.375 23264.375 275.625 24275.625 286.875 25286.875 298.125 26298.125 309.375 27309.375 320.625 28320.625 331.875 29331.875 343.125 3<strong>03</strong>43.125 354.375 31F‐EC=8, C‐EC=3:Diff lower limit Diff upper limit Fine index‐37.5 ‐22.5 2‐22.5 ‐7.5 5‐7.5 7.5 07.5 22.5 322.5 37.5 637.5 52.5 152.5 67.5 467.5 82.5 782.5 97.5 297.5 112.5 5F‐EC=16, C‐EC=3:Diff lower limit Diff upper limit Fine index‐18.75 ‐11.25 10‐11.25 ‐3.75 5‐3.75 3.75 0www.netzerprecision.com AN‐<strong>03</strong>, <strong>Absolute</strong> <strong>angle</strong> <strong>computation</strong> 7 / 12


3.75 11.25 1111.25 18.75 618.75 26.25 126.25 33.75 1233.75 41.25 741.25 48.75 248.75 56.25 1356.25 63.75 863.75 71.25 371.25 78.75 1478.75 86.25 986.25 93.75 493.75 101.25 15101.25 108.75 10108.75 116.25 5F‐EC=64, C‐EC=3:Diff lower limit Diff upper limit Fine index‐4.6875 ‐2.8125 42‐2.8125 ‐0.9375 21‐0.9375 0.9375 00.9375 2.8125 432.8125 4.6875 224.6875 6.5625 16.5625 8.4375 448.4375 10.3125 2310.3125 12.1875 212.1875 14.0625 4514.0625 15.9375 2415.9375 17.8125 317.8125 19.6875 4619.6875 21.5625 2521.5625 23.4375 423.4375 25.3125 4725.3125 27.1875 2627.1875 29.0625 529.0625 30.9375 4830.9375 32.8125 2732.8125 34.6875 634.6875 36.5625 4936.5625 38.4375 2838.4375 40.3125 740.3125 42.1875 5042.1875 44.0625 2944.0625 45.9375 845.9375 47.8125 51www.netzerprecision.com AN‐<strong>03</strong>, <strong>Absolute</strong> <strong>angle</strong> <strong>computation</strong> 8 / 12


47.8125 49.6875 3049.6875 51.5625 951.5625 53.4375 5253.4375 55.3125 3155.3125 57.1875 1057.1875 59.0625 5359.0625 60.9375 3260.9375 62.8125 1162.8125 64.6875 5464.6875 66.5625 3366.5625 68.4375 1268.4375 70.3125 5570.3125 72.1875 3472.1875 74.0625 1374.0625 75.9375 5675.9375 77.8125 3577.8125 79.6875 1479.6875 81.5625 5781.5625 83.4375 3683.4375 85.3125 1585.3125 87.1875 5887.1875 89.0625 3789.0625 90.9375 1690.9375 92.8125 5992.8125 94.6875 3894.6875 96.5625 1796.5625 98.4375 6098.4375 100.3125 39100.3125 102.1875 18102.1875 104.0625 61104.0625 105.9375 40105.9375 107.8125 19107.8125 109.6875 62109.6875 111.5625 41111.5625 113.4375 20113.4375 115.3125 63115.3125 117.1875 42117.1875 119.0625 21F‐EC=128, C‐EC=7:Diff lower limit Diff upper limit Fine index‐2.612 ‐2.210 54‐2.210 ‐1.808 109‐1.808 ‐1.406 36‐1.406 ‐1.004 91‐1.004 ‐0.6<strong>03</strong> 18www.netzerprecision.com AN‐<strong>03</strong>, <strong>Absolute</strong> <strong>angle</strong> <strong>computation</strong> 9 / 12


‐0.6<strong>03</strong> ‐0.201 73‐0.201 0.201 00.201 0.6<strong>03</strong> 550.6<strong>03</strong> 1.004 1101.004 1.406 371.406 1.808 921.808 2.210 192.210 2.612 742.612 3.013 13.013 3.415 563.415 3.817 1113.817 4.219 384.219 4.621 934.621 5.022 205.022 5.424 755.424 5.826 25.826 6.228 576.228 6.629 1126.629 7.<strong>03</strong>1 397.<strong>03</strong>1 7.433 947.433 7.835 217.835 8.237 768.237 8.638 38.638 9.040 589.040 9.442 1139.442 9.844 409.844 10.246 9510.246 10.647 2210.647 11.049 7711.049 11.451 411.451 11.853 5911.853 12.254 11412.254 12.656 4112.656 13.058 9613.058 13.460 2313.460 13.862 7813.862 14.263 514.263 14.665 6014.665 15.067 11515.067 15.469 4215.469 15.871 9715.871 16.272 2416.272 16.674 7916.674 17.076 617.076 17.478 6117.478 17.879 116www.netzerprecision.com AN‐<strong>03</strong>, <strong>Absolute</strong> <strong>angle</strong> <strong>computation</strong> 10 / 12


17.879 18.281 4318.281 18.683 9818.683 19.085 2519.085 19.487 8019.487 19.888 719.888 20.290 6220.290 20.692 11720.692 21.094 4421.094 21.496 9921.496 21.897 2621.897 22.299 8122.299 22.701 822.701 23.1<strong>03</strong> 6323.1<strong>03</strong> 23.504 11823.504 23.906 4523.906 24.308 10024.308 24.710 2724.710 25.112 8225.112 25.513 925.513 25.915 6425.915 26.317 11926.317 26.719 4626.719 27.121 10127.121 27.522 2827.522 27.924 8327.924 28.326 1028.326 28.728 6528.728 29.129 12029.129 29.531 4729.531 29.933 10229.933 30.335 2930.335 30.737 8430.737 31.138 1131.138 31.540 6631.540 31.942 12131.942 32.344 4832.344 32.746 1<strong>03</strong>32.746 33.147 3<strong>03</strong>3.147 33.549 8533.549 33.951 1233.951 34.353 6734.353 34.754 12234.754 35.156 4935.156 35.558 10435.558 35.960 3135.960 36.362 86www.netzerprecision.com AN‐<strong>03</strong>, <strong>Absolute</strong> <strong>angle</strong> <strong>computation</strong> 11 / 12


36.362 36.763 1336.763 37.165 6837.165 37.567 12337.567 37.969 5<strong>03</strong>7.969 38.371 10538.371 38.772 3238.772 39.174 8739.174 39.576 1439.576 39.978 6939.978 40.379 12440.379 40.781 5140.781 41.183 10641.183 41.585 3341.585 41.987 8841.987 42.388 1542.388 42.790 7042.790 43.192 12543.192 43.594 5243.594 43.996 10743.996 44.397 3444.397 44.799 8944.799 45.201 1645.201 45.6<strong>03</strong> 7145.6<strong>03</strong> 46.004 12646.004 46.406 5346.406 46.808 10846.808 47.210 3547.210 47.612 9047.612 48.013 1748.013 48.415 7248.415 48.817 12748.817 49.219 5449.219 49.621 10949.621 50.022 3650.022 50.424 9150.424 50.826 1850.826 51.228 73www.netzerprecision.com AN‐<strong>03</strong>, <strong>Absolute</strong> <strong>angle</strong> <strong>computation</strong> 12 / 12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!