Using DC tachometers as a velocity feedback sensor in PMAC The TCS3 can use the motor shaft's DC Tachometer as a velocity sensor in the PMAC control loop. These notes describe the setup for using the TAC output. 0. TAC description. The TCS has 2 DC tachometer per axis. The T3 safety board electronics takes 2 tach DC output, then combines/scale time so the PMAC recieves 1 Analog voltage representing velocity. The tachs output 12 volt/per radians. Gearing beteen motor shaft & telescope shaft is 144:1. The saftey board electronic divides the voltage input by 5. The 2 tach voltage are sum & divided by 2 before being output to the pmac D/A board. The voltage obtained by the PC can be converted to velocity: V2AS = 5 / 12 / 144 * R2AS is appox 596.8310658. 15 as/s ~ 0.0251 v 2000 as/s ~ 3.3510 v The PMAC is fitted with ACC28B, a 4-channel 16-bit analog to digital converter board. The HA velocity voltage is sent to ADC#1. The DEC velocity voltage is sent to ADC#3. (ADC#2 and #4 are unused) The PMAC firmware provide an Encoder Conversion Table (ECT). The following describes how the ECT is configure to used the HA, DEC voltage input as a velocity signal. 1. Definition of ECT. Entries 1-4 are default values. Entries 1 is provides HA position input using the main shaft encoder. Entries 2 is provides DEC position input using the main shaft encoder. Entry Address Y-Word Conversion Method ---------------------------------------------------- 1 Y:$ 3501 $078000 1/T extension of location $78000 2 Y:$ 3502 $078004 1/T extension of location $78004 3 Y:$ 3503 $078008 1/T extension of location $78008 4 Y:$ 3504 $07800C 1/T extension of location $7800C 2. Using "Integrated A/D converstion" method ($5) Method $5 works by: 1. ADC / 256 2. * 32 3. - bais store in X:reg The ADC maps -/+ 10 volts to 0-65536. Therefore the bias term is 32768*32 = 1048576 ($100000) Y:$ 3505 $5F8006 Integrated A/D conversion of location $F8006 Y:$ 3506 $100000 bias term (-32768*32) The above should work for the PMAC, however, their is a bug in the firmware that prevents values below the bias term to be used. After consulting with PMAC technical support, it was suggested we using the Add/Subtract feature to work around this bug. 3. Using "Add/Subtract" method ($E) Use 'add/subtract' method as a work-around. First we using 2 unused I-variables to hold the bias values. We used I-variable from an unused motor (31,32) so they will be automatically saved. Below is the I-variable setup for the TAC. For details see c.wilson email: ~tcs3/public_html/systems/tcs3/vendor_info/DeltaTau/ref/040206_cwilson_PMAC_Tach.txt I3160=256*32768 ; y:000f8f hold fake ADC (bias value) for ECT for TAC#1 I3260=256*32768 ; y:00100f hold fake ADC (bias value) for ECT for TAC#2 ; ECT Entries for TAC#1 I8004=$1F8006 ; Unintegrated unsigned ADC from Y:$F8006 (ADC1) I8005=$180F8F ; Unintegrated unsigned ADC from Y:$000F8F(fake ADC = bias value ) I8006=$E90405 ; Integrated results from: (-I8005) + I8004 ; ECT Entries for TAC#2 I8007=$1F800E ; Unintegrated unsigned ADC from Y:$F800E (ADC3) I8008=$18100F ; Unintegrated unsigned ADC from Y:$00100F(fake ADC = bias value ) I8009=$E90708 ; Integrated results from: (-I8008) + I8007 I8010=$0 ; end of table Finally, configure the axes to use the tac data, by setting Ix04 - Velocity Loop Feedback Address: I104=$3507 ; set velocity loop feedback to Tach#1 for motor1 - HA (I8006 results) I204=$350A ; set velocity loop feedback to Tach#2 for motor2 - DEC (I8009 results) 4. Note on scaling tach_scaling.xls is a scratch patch to determine scaling and compair count resolution for the encoder vs tachometer. 4.2. The velocity resolution in the PMAC in terms of counts/as is very high 12401 counts/AS. The is extremely high compared to cnt/as of encoder (~20). This is a 620:1 ratio. See ~/public_html/systems/tcs3/computers/pmac/tach_scaling.xls. 4.3. Althought the pmac manual suggests we scale Ixx09/Ixx08 some the resolutions are equal, our high ratio make this difficult. Ixx09 is just a pre-scaling factor before the Ixx31 derivative gain. cwilson@deltatau.com suggest we keep Ixx08 at 96, and reduce Ix09 to 1 to increase the efficed resolution on Ixx31. Howver keeping Ixx08/Ixx09 equal would allow easily switching between single and dual feedback. 5. I/M-Variables to help look at values for debugging. Defaults are: I8000 = $078000 ; 1/T Extension of Encoder 1 I8001 = $078004 ; 1/T Extension of Encoder 2 I8002 = $078008 ; 1/T Extension of Encoder 3 I8003 = $07800c ; 1/T Extension of Encoder 4 I8004 = $0 ; end of table M-variables to look at ADC and ETC: m500->x:$3501,0,24 ; 'result' field for I8000 - 1/T encoder 2 m501->x:$3502,0,24 ; 'result' field for I8001 - 1/T encoder 2 m502->x:$3503,0,24 ; 'result' field for I8002 - 1/T encoder 2 m503->x:$3504,0,24 ; 'result' field for I8003 - 1/T encoder 2 m504->x:$3505,0,24 ; 'result' field for I8004 m505->x:$3506,0,24 ; 'result' field for I8005 m506->x:$3507,0,24 ; 'result' field for I8006 - ADC#1 integrated value m507->x:$3508,0,24 ; 'result' field for I8007 m508->x:$3509,0,24 ; 'result' field for I8008 m509->x:$3510,0,24 ; 'result' field for I8009 - ADC#3 integrated value m510->y:$78006,0,24 ; points to ADC value 6. Switching back & forth: To switch to using tac input in velocity loop: I104=$3507 ; set velocity loop feedback to Tach#1 for motor1 - HA (I8006 results) I204=$350A ; set velocity loop feedback to Tach#2 for motor2 - DEC (I8009 results) To return to defaults Ixx04 values (using Inc encoder for vel loop input): I104=$3501 ; restore default velocity loop feedback value I204=$3502 ; restore default velocity loop feedback value Notes about D-term values. When using default, D term is positive and in the range of 6000. When using tac inputs, note the analog values are scale and inverted so the resolution is 120x less. So 50 would be equivalant to about 6000 (in the default mode).