Part Number: C2000WARE-MOTORCONTROL-SDK
Other Parts Discussed in Thread: BOOSTXL-DRV8323RH, LAUNCHXL-F280025C
Hello,
After a few weeks of being pulled to other projects I'm back working on implementing sensorless FOC with a small custom BLDC motor using a LAUNCHXL-F280025C and BOOSTXL-DRV8323RH with the universal motor control lab. I now have the system spinning the motor really nicely after running the parameter estimation sequence in build 4 of the lab. The drive current waveform is nicely sinusoidal and the motor always recovers nicely when I stop it with my finger. Current draw is low and I am satisfied with the performance so far. Part of the key ended up being to replace the 7mOhm current sense resistors with 50mOhm ones. I set the current gain to 20 for a full scale span of 3.3A and that seemed to make a big difference. Here are the values that the auto-tuning sequence spits out:
motorSetVars_M1.RoverL_rps = 20529
motorSetVars_M1.RsOnLine_Ohm = 3.09
motorSetVars_M1.Rs_Ohm = 3.09
motorSetVars_M1.Ls_d_H = 0.000189
motorSetVars_M1.Ls_q_H = 0.000189
motorSetVars_M1.flux_VpHz = 0.004 (constantly updates near this number)
Now I would like to be able to hard-code those parameters and spin the motor equally well without running the auto-estimation sequence at all. However, every time I try this it doesn't work. I write those values into the corresponding variables in user_mtr1.h:
#define USER_MOTOR1_Rr_Ohm (3.09)
#define USER_MOTOR1_Rs_Ohm (3.09)
#define USER_MOTOR1_Ls_d_H (0.000189)
#define USER_MOTOR1_Ls_q_H (0.000189)
#define USER_MOTOR1_RATED_FLUX_VpHz (0.004)
And I set userParams_M1.flag_bypassMotorId to false in sys_main.c. When I run the code after that I get a short jitter of the motor and an immediate overcurrent error every time. Before I reduced the full-scale current to 3.3A it would jump the motor around and draw a bunch of current - I guess reducing the limit triggers the overcurrent. I tried setting motorSetVars_M1.overCurrent_A to 100A to see if I could bypass the fault but it still throws it. When I have run the auto-tuning the motor spins perfectly and never throws an overcurrent fault even when I load it heavily or fully stop the rotor by hand. It just draws 600mA or so and then spins right back up to speed and low current when I let go.
What could be the difference between the auto-tuned behavior and the hard-coded behavior? I have searched through the code to find parts that rely on that userParams_M1.flag_bypassMotorId flag and have tried a few edits to make the two cases the same, but no luck so far. In previous posts I have speculated that the auto-estimated motorSetVars_M1.RoverL_rps not being equal to actual R divided by L looked suspicious, but I don't know what to do about that or if it is a problem at all.
Is the estimation sequence estimating any other hidden parameters that I don't know about and am not manually setting?
Any ideas? Thanks.