This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am running the HV kit PMSM code for the 28335 on an EZDSP 28335 board. I am now up to build level 5. When I run it is current loop mode, it works fine. When I switch to speed loop mode, It seems to wor OK also. The problem is if I change to a negative speed ref, the instantly stalls and oscillates with a very high pitch (very loudly). I would appreciate any suggestions on probably cause.
Thanks,
Brad Mularcik
Clipping? Over aggressive P term?
What power stage and motor are you running?
Chris,
I am running the TI 88312 inverter with a 48VDC bus. I am running a small bldc motor with it. Clippng of what signal??? Which P term???
When I changed the code to execute the block diagram of Level 5B from the documentation, I can make it run both directions, but in this case, I am starting the moter with the lsw set to 1, a positive value for Iq ref and a pos or neg value of speed ref. Once the motor is spinning the desired direction, then I change lsw to 2 and the motor runs in a current loop in the desired direction. If I change Iq ref to negative, then the motor stalls and screams at me as it did in the Build LEvel 5A with a negative speed ref.
Please advise.
Thanks,
Brad
Brad,
So you are using the DRV8312 EVM and rust routing signals over to the eZdsp?
Did you already take care of the differnt current scaling from the DRV board back to the 28x? How did you handle that SW change?
I would start here first. The PI controller in the HVKit is tuned for light loads on a MUCH larger motor, with a MUCH larger power stage.
What did you do to change the PI Current controllers? It sounds like you just ran them as is, is that correct?
BTW - don't know if you noticed the new DRV8412-C2-KIT, but we are releasing a DRV8312-C2-KIT shortly, just have to ramp up manufacturing, the code is done.
Chris,
I questioned the scaling of the current and voltage feedback signals a while ago, and was told by another engineer at TI that I did not have to worry about that. It did not make sense to me that the scaling would not matter, but I accepted the answer and moved on. Please advise what I need to do. I think I need to look at amps to volts of the HV kit and change that to the amps to volts scaling of the 88312 board.
Is this the code that I need to change for the current scaling?
#ifdef
DSP2833x_DEVICE_H
clarke1.As=((AdcMirror.ADCRESULT0)*0.00024414-0.5524)*2*0.909;
// Phase A curr.
clarke1.Bs=((AdcMirror.ADCRESULT1)*0.00024414-0.5539)*2*0.909;
// Phase B curr.
#endif
// ((ADCmeas(q12)/2^12)-0.55)*2*(3.0/3.3)
I assume that this is the code for the voltage feedback scaling also?
#ifdef
// DC Bus voltage meas.
#endif
Please give me some explanation of these lines of code, so that I know what I am doing with changing them.
Thanks,
// (ADCmeas(q12)/2^12)*(3.0V/3.3V) DSP2833x_DEVICE_H
volt1.DcBusVolt = ((AdcMirror.ADCRESULT2)*0.00024414)*0.909;
Brad
Brad,
I've asked one of the system engineers to respond to your post so that you get accurate information for scaling the inputs.
Can you confirm which power stage you are using, and which board revision?
I am using the EZ DSP board for the 28335, and the DRV8312EVM Rev B as the power stage.
Brad
Chris,
At the risk of being a pain, can I expect to hear from somebody soon? I really need to get this resolved this week. Perhaps someone could call me???
Thanks,
Brad
Brad,
I'm sure you went through this section of the User's Guide
Level 2C – Calibrating the Phase Current Offset
Note that especially the low power motors draw low amplitude current after closing the speed loop under no-load. The performance of the sensorless control algorithm becomes prone to phase current offset which might stop the motors or cause unstable operation. Therefore, the phase current offset values need to be minimized at this step.
Set VqTesting, VdTesting and SpeedRef to zero in the code, recompile and run the system and watch the clarke1.As & clarke1.Bs from watch window. Ideally the measured phase currents should be zero in this case. Make sure that the clarke1.As & clarke1.Bs values are less than 0.001 or minimum possible. If not, adjust the offset value in the code by going to:
clarke1.As= ((AdcMirror.ADCRESULT0)*0.00024414-0.5524)*2*(3.0/3.3);
and changing IQ15(0.55) offset value (e.g. IQ15(0.5587) or IQ15(0.5488) depending on the sign and amount of the offset).
Rebuild the project and then repeat the calibration procedure again until the clarke1.As and clarke1.Bs offset values are minimum.
Note: 2833x devices have 12-bit ADC and the result is can be read from the 16-bit ADC registers, AdcMirror.ADCRESULTn. The current sense result is therefore divided by 212 to normalize it in per unit format, and offset subtracted to get an ac quantity. The offset added to the current signal on the HVDMC kit is 1.65V for 3.3 V ADCs. Since the 2833x devices have 3.0V ADCs, 0.55 pu offset (=1.65V / 3.0V) is subtracted from the current measurement in the code. Finally, it is multiplied by two to normalize the measured phase current to ± 1.0 pu. Note that the components on the HVDMC kit scales down 20A peak current to 3.3V, therefore the measurement is rescaled for 3.0V ADCs. Make sure that the ADC input does not exceed 3.0V when 2833x is used.
We haven't used the DRV8332 power stage yet. I assume you have the proper scaling implemented?
Chris,
Thanks for this input. I did do the offset adjustment in 2C, but I did not catch the note regarding the scaling. I think I understand it now. I also am looking at the scaling difference between the voltage divider on the HV kit and the voltage divider on the 88312EVM for the DC bus voltage measurement. They are different by a factor of 6.18. I do not see where the voltage measured is related to actual DC bus voltage. Please advise.
Brad
Chris,
Do you have any information on the scaling of the DC bus voltage measurement? Also, I would like to know if you have any information on how the PID3 macro and the sliding mode observer work? I am still trying to debug why I am getting the instability if I put in a negative Iq ref.
Thanks,
Brad
Brad,
I've asked the DRV team to respond on your bus voltage question. I don't have the schematic or board in front of me right now.
What would you like to know on the PI or SMO? About all the info I have is in the documentation that is provided in the motor_lib or project specific PDF.
Chris,
Where in the code is the scaling done for the DC bus voltage reading?
As for info on the PID and SMO macros, I just discovered the documentation in control suite that describe them. I am looking at it now. One question I have specifically on the PI, from a controls background, I understand how to adjust the P and I terms. What about the anti windup gain Kc? How should that be adjusted?
Please let me know what you can about the bus voltage measurement scaling.
Thanks,
Brad
Brad,
The ADC measurements are taken using the f2833xxileg_vdc macro.
If you look at this file in the project or C:\ti\controlSUITE\libs\app_libs\motor_control\drivers\f2833x_v1.1
you'll see that the bus voltage is on A1
AdcRegs.ADCCHSELSEQ1.bit.CONV02 = 1; /* ChSelect: ADC A1-> DC Bus Voltage */
and then the scaling is done here
#ifdef DSP2833x_DEVICE_H
volt1.DcBusVolt = ((AdcMirror.ADCRESULT2)*0.00024414)*0.909; // DC Bus voltage meas.
#endif // (ADCmeas(q12)/2^12)*(3.0V/3.3V)
For the correction gain you can do some simulations (tough) or you can start near 0 and work your way towards 1.
Brad,
Checked the schematic and the scale is 0.049756. Resistor values are 95.3k and 4.99k on the divider network.
Bus voltage = 50V gives you ~2.5V on the ADC.
Brad, did you ever find a solution to your problem? I'm having the same issues. When the speed loop is closed positive speed ref works but negitive does not.
Henry,
It has been nearly 3 years since I dealt with this problem. I went back and looked at the old code. I am pretty sure that this was caused by the fact that the sliding mode observer produces an offset in the reported angle between forward and reverse. I used an encoder to determine that there was an an angle shift when changing directions. I enabled the smo angle estimator at the same time that I used the encoder angle
QEP_MACRO(qep1);
and connected both angle values to seperate PWM DAC's.
PwmDacCh1 = _IQtoQ15(speed1.ElecTheta);
This allowed me to look at the encoder based angle and the estimated angle at the same time. To solve it, I used one offset for forward, and a different offset for reverse.
This is code that I changed from the smoposd.h file:
/* Rotor angle calculator -> Theta = atan(-Ealpha,Ebeta) */ \
v.Theta = _IQatan2PU(-v.Ealpha,v.Ebeta); \
if (v.SpeedIn >= _IQ(0.0)) \
v.ThetaOffset = v.ThetaOffsetFwd; \
else \
v.ThetaOffset = v.ThetaOffsetRev; \
v.Theta = v.Theta + v.ThetaOffset; \
if (v.Theta > E1) v.Theta = v.Theta-E1;
I also had to add the 2 offset values to the definition:
Your offsets will probably be different since your using a different motor etc, but these are the values that i used for the offsets.
_iq ThetaOffsetFwd = _IQ(0.18);
_iq ThetaOffsetRev = _IQ(0.14);
Hope this helps.
Brad
The original SMO projects only supported uni-directional speed.
The latest eSMO based project (example with TMDSHVMTRPFCKIT) supports positive OR negative speed, but not speed reversals.
For speed reversals you have two options
1. FAST software sensor (replacing SMO/eSMO) used in InstaSPIN-FOC and InstaSPIN-MOTION
2. Attempt to use the HFI-IPD library with the eSMO (again, documented in TMDSHVMTRPFCKIT but you will have to request the HFI-IPD library under license). Note that HFI-IPD does not work for all motors. You will have to test with your motor and there is tuning required for the sensor technique as well as attention to be paid to the transition points between eSMO and HFI-IPD feedback into the system. I would consider this for expert level control engineers only.
Thanks Brad the offset was the key to resolving this issue. By the way which speed did you use as an input to the SMO? I'm guessing the estimated speed coming out of the SE Macro?