Hello
We are trying to run a PMSM motor with a resolver. We first using the TMDSRSLVR Resolver to Digital converter and using its SPI interface, we send the Raw Theta to the TMDSHVMTRPFCKIT hardware kit. For the Resolver we run the firmware that came with the kit (from ControlSuit), and the for motor controller we run PMSM Sensored (from Control Suit) program.
Our motor has 5 pole pairs. Meaning when the motor turns 1 turn, the Resolver shows 5 sets of saw tooth values. In other words the Raw Theta from the Resolver send values from 1 to -1 in IQ20 format, 5 times per revolution. In the resolver we scaled each 1 to -1 value set such that it converts it from 0 to FFFF and we send those values through SPI to the motor controller.
In the motor controller code, we added the resolver block from the Math Blocks library. We are using Build Level-4 with LSW-1. For the resolver block we initialize it as
resolver1.PolePairs = 5;
resolver1.InitTheta = 18386; //Motor Specification shows 101 electrical degrees 18386 = ((101/5) * h'FFFF) / (360/5)
resolver1.MechScaler = _IQ30(1/(5 * 65535));
In the main ISR we tie the Theta as
clarke1.As = _IQmpy2(_IQ12toIQ(AdcResult.ADCRESULT1)-offsetA); // Phase A curr.
clarke1.Bs = _IQmpy2(_IQ12toIQ(AdcResult.ADCRESULT2)-offsetB); // Phase B curr.
CLARKE_MACRO(clarke1)
// ------------------------------------------------------------------------------
// Connect inputs of the PARK module and call the park trans. macro
// ------------------------------------------------------------------------------
park1.Alpha = clarke1.Alpha;
park1.Beta = clarke1.Beta;
// ------------------------------------------------------------------------------
// Connect inputs to resolver module
// ------------------------------------------------------------------------------
RawThetaSPI = SpiaRegs.SPIDAT;
resolver1.RawTheta = RawThetaSPI;
RESOLVER_MACRO (resolver1);
if(lsw==0) park1.Angle = 0;
else if(lsw==1) park1.Angle = resolver1.ElecTheta;
else park1.Angle = resolver1.ElecTheta;
park1.Sine = _IQsinPU(park1.Angle);
park1.Cosine = _IQcosPU(park1.Angle);
PARK_MACRO(park1)
We are trying to change IQRef and run the motor in torque control.
With this setup, when we enable and try to run the motor, we hear a hum and the motor seems like its about to start with a small jerk. But it never wants to turn. A large current (7A in our setup) is drawn as well. The hardware works fine when we run MotorWare Sensorless Lab 5A.
Any help is much appreciated.