Справочник Пользователя для Delta Tau GEO BRICK LV
Turbo PMAC User Manual
Setting Up Turbo PMAC-Based Commutation and/or Current Loop
133
User-Written Phase Algorithms
Turbo PMAC supports the installation and automatic execution of user-written phase algorithms. These
can be used if the standard commutation/current-loop algorithms are not suitable to get the required
performance; alternately, they can be used for non-servo purposes, with the algorithm guaranteed to
execute at the phase update rate. This can be very valuable for fast updates of I/O.
User-written phase algorithms must be written in assembly language for the Motorola DSP56300 family
and assembled using a cross-assembler from Motorola, available at no cost from their website.
Only a single user-written phase algorithm may be installed in a Turbo PMAC. This algorithm can be
executed by any motor on the Turbo PMAC. If different motors should execute different algorithms, this
must be accomplished by branching within a single user-written phase algorithm.
Highly efficient user-written servo algorithms may be written in the assembly language for the DSP56300
family of processors used in the Turbo PMAC. This requires the use of a cross-assembler from Motorola,
obtainable at no cost from their website. It also requires a linking program from Delta Tau, called
CODET.EXE and running under Microsoft Windows operating systems, available at no cost from the
Delta Tau website.
can be used if the standard commutation/current-loop algorithms are not suitable to get the required
performance; alternately, they can be used for non-servo purposes, with the algorithm guaranteed to
execute at the phase update rate. This can be very valuable for fast updates of I/O.
User-written phase algorithms must be written in assembly language for the Motorola DSP56300 family
and assembled using a cross-assembler from Motorola, available at no cost from their website.
Only a single user-written phase algorithm may be installed in a Turbo PMAC. This algorithm can be
executed by any motor on the Turbo PMAC. If different motors should execute different algorithms, this
must be accomplished by branching within a single user-written phase algorithm.
Highly efficient user-written servo algorithms may be written in the assembly language for the DSP56300
family of processors used in the Turbo PMAC. This requires the use of a cross-assembler from Motorola,
obtainable at no cost from their website. It also requires a linking program from Delta Tau, called
CODET.EXE and running under Microsoft Windows operating systems, available at no cost from the
Delta Tau website.
Writing the Algorithm
The algorithm is written in Motorola DSP56300 assembly language using any standard text editor. The
code written is subject to the following restrictions.
code written is subject to the following restrictions.
Program Memory Space
The program must start at memory location P:$040800, so the first line of code must be:
ORG P:$40800
For a DSP56303 processor (80 MHz CPU Option 5Cx), the resulting code must end by memory location
P:$040BFF, providing a 1-Kword buffer for the program. For a DSP56309 processor (100 MHz CPU
Option 5Dx) or a DSP56311 processor (160 MHz CPU Option 5Ex), the resulting code must end by
memory location P:$044BFF, providing a 17-Kword buffer for the program. In all cases, if a user-written
phase program is used, the user-written servo program is limited to a 2-Kword buffer (P:$040000 –
P:$0407FF).
Conditions on Entry
On entry into the user-written phase, the program can expect the following data for the executing motor in
internal DSP registers:
P:$040BFF, providing a 1-Kword buffer for the program. For a DSP56309 processor (100 MHz CPU
Option 5Dx) or a DSP56311 processor (160 MHz CPU Option 5Ex), the resulting code must end by
memory location P:$044BFF, providing a 17-Kword buffer for the program. In all cases, if a user-written
phase program is used, the user-written servo program is limited to a 2-Kword buffer (P:$040000 –
P:$0407FF).
Conditions on Entry
On entry into the user-written phase, the program can expect the following data for the executing motor in
internal DSP registers:
•
The R0 register contains the address of the first status word for the executing motor (e.g. $0000B0 for
Motor 1).
Motor 1).
•
The N4 register contains the block length of the motor servo registers ($80 presently), which may be
useful in incrementing from motor to motor. This must not be changed.
useful in incrementing from motor to motor. This must not be changed.
•
The R4 register contains the base address of the first status word for the next higher-numbered motor.
This must not be changed. If you subtract the contents of the N4 register from this value, you will get
the base address of the executing motor’s phasing data.
This must not be changed. If you subtract the contents of the N4 register from this value, you will get
the base address of the executing motor’s phasing data.
•
The N0 register contains a value of 2.
The torque (quadrature current) command from the motor’s servo algorithm may be found in the motor’s
quadrature command register. This is the register at an address 15 ($F) greater than the address in the R0
register.
Conditions on Exit
On exit from the user-written phase, the algorithm must already have written its outputs into the registers
that perform the action – the function that setup variable Ixx02 performs in the factory provided phase
algorithms. Turbo PMAC firmware will not perform this function after exiting from a user-written phase
routine. A user-written phase algorithm may use the Ixx02 register to tell it in which addresses to place
its output values.
quadrature command register. This is the register at an address 15 ($F) greater than the address in the R0
register.
Conditions on Exit
On exit from the user-written phase, the algorithm must already have written its outputs into the registers
that perform the action – the function that setup variable Ixx02 performs in the factory provided phase
algorithms. Turbo PMAC firmware will not perform this function after exiting from a user-written phase
routine. A user-written phase algorithm may use the Ixx02 register to tell it in which addresses to place
its output values.