User's Manual
PMAC2 User Manual
26 Setting Up PMAC2 for Direct PWM Control
To allow reliable user access to these values, PMAC2 copies the input values into image registers in RAM
automatically, where they can safely be read at any time. PMAC2 copies one pair per phase interrupt,
updating all eight channels every eight phase cycles. The mapping of the image registers is as follows:
Chan # 1 2 3 4 5 6 7 8
A Input
Y:$C005 Y:$C00D Y:$C015 Y:$C01D Y:$C025 Y:$C02D Y:$C035 Y:$C03D
A Image
X:$0710 X:$0711 X:$0712 X:$0713 X:$0714 X:$0715 X:$0716 X:$0717
B Input
Y:$C006 Y:$C00E Y:$C016 Y:$C01E Y:$C026 Y:$C02E Y:$C036 Y:$C03E
B Image
Y:$0710 Y:$0711 Y:$0712 Y:$0713 Y:$0714 Y:$0715 Y:$0716 Y:$0717
These are declared as 16-bit variables even though typically 12-bit ADCs are used; this puts the scaling of
the variable in the same units as Ix69, Ix57, Ix29, and Ix79.
It will be useful to monitor these values in the Watch window of the Executive program, so add the
variable names to the Watch window, causing the program to repeatedly query PMAC2 for the values,
which it will display. The hardware can then be exercised with on-line commands issued through the
Terminal window.
To prepare PMAC2 for these tests:
• Set I100 to 0 to deactivate the motor
• Set I101 to 0 to disable commutation (This allows for manual use of these registers.)
• Make sure that I900, I904, I916, and I917 are set up properly to provide the PWM signals desired.
• If the Amplifier Enable bit is 1, set it to zero with the command: M114=0
• Set Ix00 and Ix01 for all other motors to zero
Position Feedback and Polarity Test
If the PWM command values observed in the Watch window are not zero, set them to zero with the
command: M102=0 M104=0 M107=0
The motor should move freely by hand now. As it is turned, monitor the M101 value in the Watch
window. Look for the following:
• It should change as it is moved.
• It should count up in one direction and count down in the other direction.
• It should provide the expected number of counts in one revolution or linear distance increment.
• As the motor is returned to a reference position repeatedly, it should report (approximately) the same
position value each time.
If these things do not happen, check the encoder/resolver operation, its connection to PMAC2, and the
PMAC2 decode variable I9n0. Double-check that the sensor is powered. Also, look at the encoder
waveforms with an oscilloscope.
If the direction of motion for the positive direction is known, check this here. If the direction is incorrect,
invert it by changing I9n0, usually from 7 to 3, or from 3 to 7. If it is not known yet which direction
sense is wanted, it can be changed later, but another change must be made at that time to maintain the
proper commutation polarity match; usually by exchanging two of the motor phase leads at the drive.
Note:
Because I100 has been set to 0, and I103 may not yet have been set properly, any
change of position will not be reflected in the motor position window.