Power PMAC Clipper User Manual
Connections and Software Setup
35
The global parameter
ADCnVoltsIn
reports the ADC data in “user” volts.
Where
n
is the ADC channel number (1 - 4).
GLOBAL
ADC1VoltsIn =
0
;
// Voltage input, ADCIN_1
GLOBAL
ADC2VoltsIn =
0
;
// Voltage input, ADCIN_2
GLOBAL
ADC3VoltsIn =
0
;
// Voltage input, ADCIN_3
GLOBAL
ADC4VoltsIn =
0
;
// Voltage input, ADCIN_4
GLOBAL
ADC1ZeroOffset =
0.038
;
// Zero Volt Offset1, [volt] --USER ADJUSTABLE
GLOBAL
ADC2ZeroOffset =
0.038
;
// Zero Volt Offset2, [volt] --USER ADJUSTABLE
GLOBAL
ADC3ZeroOffset =
0.038
;
// Zero Volt Offset3, [volt] --USER ADJUSTABLE
GLOBAL
ADC4ZeroOffset =
0.038
;
// Zero Volt Offset4, [volt] --USER ADJUSTABLE
OPEN
PLC
PtrExamplePLC
ADC1VoltsIn = (ADCIN_1 * 10 / 2048) - ADC1ZeroOffset ;
ADC2VoltsIn = (ADCIN_2 * 10 / 2048) – ADC2ZeroOffset ;
ADC3VoltsIn = (ADCIN_3 * 10 / 2048) – ADC3ZeroOffset ;
ADC4VoltsIn = (ADCIN_4 * 10 / 2048) – ADC4ZeroOffset ;
CLOSE
OPEN
PLC
ShiftExamplePLC
// More efficient less resources
ADC1VoltsIn = ((Clipper[0].Chan[0].AdcEnc[0] >> 20) * 10 / 2048) - ADC1ZeroOffset ;
ADC2VoltsIn = ((Clipper[0].Chan[0].AdcEnc[1] >> 20) * 10 / 2048) – ADC2ZeroOffset ;
ADC3VoltsIn = ((Clipper[0].Chan[0].AdcEnc[2] >> 20) * 10 / 2048) – ADC3ZeroOffset ;
ADC4VoltsIn = ((Clipper[0].Chan[0].AdcEnc[3] >> 20) * 10 / 2048) – ADC4ZeroOffset ;
CLOSE
Using the ADC for Servo Feedback
Using the ADC data for servo feedback requires bringing it into the Encoder Conversion Table (ECT)
into which the motor’s position and velocity elements are assigned to.
Example
:
EncTable[
5
].pEnc = Clipper[
0
].Chan[
0
].AdcEnc[
0
].a;
EncTable[
5
].pEnc1 = Sys.pushm;
EncTable[
5
].index1 =
20
;
EncTable[
5
].index2 =
20
;
EncTable[
5
].index3 =
0
;
EncTable[
5
].index4 =
0
;
EncTable[
5
].index5 =
0
;
EncTable[
5
].ScaleFactor =
1
/ EXP2(
20
);
Motor[
5
].pEnc = EncTable[
5
].a;
Motor[
5
].pEnc2 = EncTable[
5
].a;
Содержание Power PMAC Clipper
Страница 5: ......
Страница 30: ...Power PMAC Clipper User Manual Connections and Software Setup 30...