Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: BOOSTXL-DRV8301, MOTORWARE
Tool/software: Code Composer Studio
Hello,
First time taking advantage of E2E...so bear with me if I forget to add something or leave out details.
I'm currently using a LAUNCHXL-f28069M with 2 BOOSTXL-DRV8301's in order to drive 2 3-phase brushless motors. The system setup is as follows:
Control Input: Joystick
Master Control: Arduino Teensy
Communication Protocol between Teensy & LAUNCHXL: Serial
Below is a snippet of the code added to the main() loop of proj_lab10d. There's an eStop added almost as an enable/disable. That appears to be 100% functional.
if(SCI_rxDataReady(halHandle->sciBHandle)== true)
{
sciInput = SCI_getDataBlocking(halHandle->sciBHandle);
eStopStatus = sciInput & 0x80;
motorSelected = sciInput & 0x40;
if(eStopStatus == 0)
{
//gSystemVars.Flag_enableSystem = false;
gMotorVars[HAL_MTR1].Flag_enableSys = false;
gMotorVars[HAL_MTR2].Flag_enableSys = false;
gMotorVars[HAL_MTR1].Flag_Run_Identify = false;
gMotorVars[HAL_MTR2].Flag_Run_Identify = false;
}
else
{
gMotorVars[HAL_MTR1].Flag_enableSys = true;
gMotorVars[HAL_MTR2].Flag_enableSys = true;
gMotorVars[HAL_MTR1].Flag_Run_Identify = true;
gMotorVars[HAL_MTR2].Flag_Run_Identify = true;
}
if(motorSelected == motorLeft)
{
leftMotorSpeed = sciInput & 0x3F; //bitmask the last 6 bits
if(leftMotorSpeed == 0b1)
{
gMotorVars[HAL_MTR1].SpeedRef_krpm = speedP1;
}
else if (leftMotorSpeed == 0b10)
{
gMotorVars[HAL_MTR1].SpeedRef_krpm = speedP2;
}
else if (leftMotorSpeed == 0b11)
{
gMotorVars[HAL_MTR1].SpeedRef_krpm = speedP3;
}
else if (leftMotorSpeed == 0b101)
{
gMotorVars[HAL_MTR1].SpeedRef_krpm = speedN1;
}
else if (leftMotorSpeed == 0b110)
{
gMotorVars[HAL_MTR1].SpeedRef_krpm = speedN2;
}
else if (leftMotorSpeed == 0b111)
{
gMotorVars[HAL_MTR1].SpeedRef_krpm = speedN3;
}
When the motor starts turning initially after getting info from the Teensy (Happens roughly every 30ms), the motor almost has a "tug of war", where it constantly jitters back and forth, until it eventually levels out.
When the input speed for the motors should be 0, they take ~7sec to decelerate and the jitter happens again close to 0 rpm. The tuning is done using the sensorless tuning provided by InstaSPIN. The motor controller receives 2 separate packets from the teensy, first is data for the left motor, then data for the right motor is sent. Above only shows the left motor just to save from code-dumping.
Would incorporating the hall effect sensors of the motor resolve this issue? And if I use them, should I disable the sensorless tuning? Also, what might the jitter be coming from? it seems to happen in a small interval right in the beginning of the ramp up and the end of the deceleration.
Let me know if there might be any other helpful information!