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.
SDK v2.01 LAB-is07
Conditions:
1. PI_setGains() via (pi.h) will not act on inline calls to dynamically update integral or proportion, <5Hz motor speed.
2. Slow speed estimator startup time becomes very long (60secs), with or without inline RS online re-calibration enabled.
3. Kp_spd, Ki_spd defaults (0.1, 0.01) respectively set significantly smaller values, (labs.h) or by (user.c) inertia calculations.
4. Default values BWc_rps, BWdelta (100, 8.0) respectively when set much larger values do not effect slow speed estimator.
5. PI speed controller causes motor to stall >80Hz maintaining default Kp_spd, Ki_spd (labs.h).
Q1: Why does PI_setGains() not pass or accept new input values during motor startup sequence, even <1Hz motor speed?
Q2: Was there fixes made to PI speed control values passed to InvPark or SVM module in SDK v3.01?
The simple work around is to set Kp_spd, Ki_spd very high to Rapidly get motor rolling, defaults in (labs.h). Then widen PI aperture to reduce motor current when force angle flag disables >1Hz speed. Otherwise PI speed controller rapidly over runs SVM duty cycle drives NAN into CMPA >80Hz when rotor inertia >0.1kgm2. Or kp/ki_spd set very low to arrest SVM overrun via PI gains set (user.c) kgm2 inertia calculations enabled.
Finding PI speed control block (Id) { Vdq_Out_V[0] } remains saturated (Negative) yet below -5 Vdq. Vdq appears to be constrained via (user_motor_max_current) Min/Max input values to InvPark, not to saturate as only negative values. Perhaps from estimator reference { Idq_ref_A.value[0] = EST_getIdRated_A(estHandle); }????
Seemingly PI saturates adds counter torque to phase angle and nasty oscillations occur near magnetic flux saturation point. This seems to be why greatly reducing ki_spd, kp_spd via inertia functions help to reduce negative counter torque angles near saturation. Seemingly PI should be working much better to control current angle than it seems to be able to in this SDK code.
The question remains why PI speed control block is not working so great near the current saturation point? Suspect PI speed control loop, any ideas what part of code is causing current oscillations? The integral (Iq) { Vdq_OutV[1] } has +30V and never has negative signs, always positive.
Reducing (user_motor_max_current) does not have much impact to reduce current oscillations near PI saturation.
Some oddness in the speed PI call code area setting Min/Max allows hard saturation to occur.
obj->outMin = outMin;
obj->outMax = outMax;
//
// Maximum voltage output
//
userParams.maxVsMag_V = userParams.maxVsMag_pu * adcData.dcBus_V;
PI_setMinMax(piHandle_Id,
(-userParams.maxVsMag_V), userParams.maxVsMag_V);
It also seems to omit mixing Speed controller Min/Max for an Iq output, needed for inputs of Id/Iq blocks. PI speed control mixed Id/Iq on the fly for Iq output shown Fig.5-1?
Then estimator stores highest Iq value as Idq_ref_A[1]=0.0 + Idq_offset_A[n]=0.0 and never gets Idq_ref_A[1] from estimator. The typedef MATH_vec2 has [2]array storage for estimator update of Id/Iq and generating PI speed control Iq Min/Max values for Id/Iq block use. But only the last Iq calculation is sent to estimator for storage?
If the block diagrams Fig.5-1 Fig.64 are not drawn as to depict SDK C+ code structure, most anyone is at complete loss how to fix it.
Then estimator stores highest Iq value as Idq_ref_A[1]=0.0 + Idq_offset_A[n]=0.0
And there is little minimum current for RsOnlineRrecalibration <3Hz slow speed hot/cold wire Rs impedance update after reducing (user_motor_current_a < 6.5A). Hence there was no audible frequency during the update, recalibration was less than accurate.
Yet the IDmag_A scale factor was set for lower Rs calibration frequency current, roughly 1.5A via patches.
/* set RsOnline current 30% <Est_Current_A */
motorVars.RsOnLineCurrent_A = (USER_MOTOR_RES_EST_CURRENT_A * 0.2);
/* Inline to SVM_run: sets level of current to be generated in Id reference */
EST_setRsOnLineId_mag_A(estHandle, motorVars.RsOnLineCurrent_A);
The idq_refA[1] seems to produce audible and accurate startup current with RsOnlineRecalibration after adding patch below. Oddly the 3Hz audible wire sound was not heard with lower max motor current = 5.5A. Sound is back mag_A injecting 1.5A and RsOnLineRecalibration is more accurate ohms values into estimator update cycles.
Recall Vdq_out_V[0] was maximum -5v and Vdq_out_V[1] >30v upon saturated max current level 5.5A.
Existing snip:
/* Upper PI block Vdq_out[1] makes >30Vdq */
PI_run_series(piHandle_Iq,
Idq_ref_A.value[1] + Idq_offset_A.value[1],
Idq_in_A.value[1],
0.0,
&(Vdq_out_V.value[1]));
Added magic snip fixes RsOnlineRecalibration ~_mag_A injection current:
/* Set minimum saturation Idq_ref_A current value */
Idq_ref_A.value[1] = Idq_ref_A.value[1] - Idq_ref_A.value[0];
However inline SVM_run update Kp_spd or Ki_spd values does not work. So startup time drags out >30 seconds. Ideally use imaginary defaults Ki/Kp (labs.h) to rapidly saturate P/I then back off rotor inertia with the real Kp_spd, Ki_spd values >3Hz or so. VESC project code also checks Rs impedance before starting motor. https://github.com/vedderb/bldc/blob/22dc2ce33c64593beb1e01a3b062d8c1df73beec/mcpwm_foc.c#L1837
Watching a few Axium project partner videos, the same Rs calibration sound is heard prior to motor startup, then faster speed integrator follows. There is no stall delay time between RS impedance check and rotor 360° full circle times.
Axium: https://hackaday.io/project/164932-axiom-100kw-motor-controller
Axium: https://hackaday.io/project/164932-axiom-100kw-motor-controller
Hey guys since E=mc^2 why waste magnetic potential energy as kinetic heat losses? The idea is to reduce the Co2 foot print - not increase it by expending energy as wasted heat loss on to AC power grid. Several auto companies have electric motors produce extreme losses heat rather than being 98% efficient. The former is a false narrative driven by huge $$ invested in the wrong technology people!
A 10,000 RPM rotors are NASCAR race car speeds not US or any other motor car highway speed. And avionics prop thrust reduces as air speed increase and generally gear box down engine speeds. In this case less is more - not more is more given Co2 is the reason to produce greater efficient magnet motors, not see how much energy can be expent as even more Earth trapped heat.
Engineers have lost perspective so much $$ pored into bad technology. Perhaps C2000 FAST estimator may aid to recover lost battery energy when software tuned to do so. It only requires will to find better more efficient energy solutions
Thanks for your feedback. As you know, the low speed is always a challenge for sensorless-FOC, and also the motor runs at a high speed over the rated value that may need field weakening control.
A classic PI regulator is implemented in all of the instaspin labs, you might update the gains in ISR or main loop, to use your own regulator for speed or current control. The instaspin-foc labs with FAST estimator is a reference with C2000 controller for motor control, you should tune or add some engineering codes for the end-product.
Still questing as to why PI control block can not update kp_spd/ki_spd values once FAST angle generation is online?
The PI speed control is seemingly dynamic (PID) in other control systems to control current saturation point. Agree It really shouldn't be necessary to change kp_spd or ki_spd so there is obviously a bug in the SDK v2.01 PI speed control code.
Not being able to update kp_spd/ki_sp after SVGEN_run() is enabled makes no sense, since PI values appear to directly influence slow speed estimator.
The slow speed estimator hunts many time for magnetic Nth pole rocking rotor ± few degrees, when kgm^2 is not default labs.h values. That is by no means correct startup current controller behavior, holding low speed estimator (Idq_ref_A[0]=0v) does help but not by much.