User's Manual
PMAC2 User Manual
Setting Up PMAC2 for Direct PWM Control 25
Testing PWM and Current Feedback Operation
Warning:
On many motor and drive systems, potentially deadly voltage and current levels
are present. Do not attempt to work directly with these high voltage and current
levels unless you are fully trained on all necessary safety procedures. Low-level
signals on PMAC2 and interface boards can be accessed much more safely.
Most of the time, while setting up a direct PWM interface, it is not necessary to execute all of the steps
listed in these sections (or the Executive program will do them automatically), but the first time this type
of interface is set up, or if there are problems, these steps will be of great assistance.
All of these tests should be done with the motor disconnected from any loads for safety reasons. All
settings made as a result of these tests are independent of load properties, so will still be valid when the
load is connected.
Before testing any of PMAC2’s software features for digital current loop and direct PWM interface, it is
important to know whether the hardware interface is working properly. We will use PMAC’s M-
variables to access the input and output registers directly. The examples shown here use the suggested M-
variable definitions for Motor 1; for other motors there are equivalent suggested definitions shown in the
Examples section of the manual.
Purpose
The purpose of this set of tests is to confirm the basic operation of the hardware circuits on PMAC, in the
drive, and in the motor, and to check the proper interrelationships. Specifically:
• Confirm operation of encoder inputs and decode
• Confirm operation of PWM outputs
• Confirm operation of ADC inputs
• Confirm correlation between PWM outputs and ADC inputs
• Determine proper current loop polarity
For synchronous motors, these tests also can:
• Confirm commutation cycle size
• Determine proper commutation polarity
Preparation
First define the M-variables for the encoder counter, the 3 PWM output registers, the amplifier-enable
output bit, and the two ADC input registers. Using the suggested definitions for Motor 1, we have:
M101->X:$C001,0,24,S ; Channel 1 Encoder position register
M102->Y:$C002,8,16,S ; Channel 1 PWM Phase A command value
M104->Y:$C003,8,16,S ; Channel 1 PWM Phase B command value
M107->Y:$C004,8,16,S ; Channel 1 PWM Phase C command value
M105->X:$0710,8,16,S ; Channel 1 Phase A ADC image value*
M106->Y:$0710,8,16,S ; Channel 1 Phase B ADC image value*
M114->X:$C005,14 ; Channel 1 Amplifier Enable command bit
Note:
The M-variables for the ADC current values are not those of the actual ADC input
registers. The input registers can only be read reliably inside the phase interrupt.
Since M-variable program access is at a lower priority than the phase interrupt, M-variable reads of the
actual ADC input registers may result in unstable data.