Hello TI,
I tried to use the torque mode in lab11e, I changed these two variables:
bool gHall_Flag_CurrentCtrl = true;
gIdq_ref_pu.value[1]= Iq_Ref_pu;
But when I increased gIdq_ref_pu.value[1] nothing happened.
I recognized that gHall_PwmDuty was always at zero.
I found this in the code:
if(gHall_Flag_CurrentCtrl == true) // Torque Control Mode
{
gHall_BLDC_Is_fdb_pu = gAdcData.I.value[gHall_BLDC_Flag_Is_fdb];
gHall_BLDC_Is_ref_pu = speed_pid_out;
// BLDC current loop
PID_run(pidHandle[3],gHall_BLDC_Is_ref_pu,gHall_BLDC_Is_fdb_pu,&gHall_PwmDuty);
HALLBLDC_Ctrl_PwmSet(gHall_PwmState, gHall_PwmDuty);
}
else // Speed Control Mode
{
gHall_PwmDuty = speed_pid_out;
HALLBLDC_Ctrl_PwmSet(gHall_PwmState, gHall_PwmDuty);
}
Then I put the gHall_PwmDuty in the torque control like this:
if(gHall_Flag_CurrentCtrl == true) // Torque Control Mode
{
gHall_BLDC_Is_fdb_pu = gAdcData.I.value[gHall_BLDC_Flag_Is_fdb];
gHall_BLDC_Is_ref_pu = speed_pid_out;
// BLDC current loop
PID_run(pidHandle[3],gHall_BLDC_Is_ref_pu,gHall_BLDC_Is_fdb_pu,&gHall_PwmDuty);
gHall_PwmDuty = Iq_Ref_pu;
HALLBLDC_Ctrl_PwmSet(gHall_PwmState, gHall_PwmDuty);
}
else // Speed Control Mode
{
gHall_PwmDuty = speed_pid_out;
HALLBLDC_Ctrl_PwmSet(gHall_PwmState, gHall_PwmDuty);
}
After this change the motor started moving, but it only runs smoothly at very low speeds, at higher speeds it begins to oscillate and sound badly and I’m thinking it’s not changing to FAST.
I think I did something wrong in the code, because the current control works in the other labs and speed mode of lab11e works as well.
I’m not sure what I have to change to use the torque mode. Please Help.
And only out of curiosity if I want to add the hall start-up in lab5a or 10a would this be easy?
Because I saw some differences in the mainISR and I don’t know how to handle that.
thanks in advance