Part Number: TMS320F28069M
Other Parts Discussed in Thread: TINA-TI,
Tool/software: TINA-TI or Spice Models
I selected TMS320F28069M as the Micro controller to complete the development of motor control project, based on the “Proj_lab13d.c Motion Sequence Example – Vending Machine”。I want to make the motor stop at the position A and position B, .
There may be some accident to deal by MCU when motor running, so the motor will stop at any position marked as D between position A and B. After the MCU finish the occasional task, we want to the motor continue to run and stop at position A or B.
I have tried two methods to make it come true , but it didn’t work.
method a: make the motor stop at positon D , restart the motor next.
1. this step is to stop the motor, code like following described:
gMotorVars.SpinTAC.PosPlanRun = ST_PLAN_PAUSE;
STPOSPLAN_setEnable(stObj->posPlanHandle, false);
STPOSMOVE_setEnable(stObj->posMoveHandle, false);
2. this step is to restart the motor, code like following described:
gMotorVars.SpinTAC.PosPlanRun = ST_PLAN_START;
STPOSPLAN_setEnable(stObj->posPlanHandle, true);
STPOSMOVE_setEnable(stObj->posMoveHandle, true);
method b: we changed the parameter online using the interface of STPOSPLAN_setCfgState, but an error of SPpinTAC Plan is running will be reported. I get the solution from the document. As described in the document, the SPpinTAC Plan have to enter an IDLE state before new configuration effect. And as the following table, the ENB=false can be set to make the state BUSY->IDLE transition, only after three requirements have been met. Now, it can’t enter the IDLE state even though the three requirements have been met, and it will enter the HALT state abnormally. Even if I get the IDLE state occasionally, the state will change from IDLE to INIT after online parameter configuration, not my expected.
looking forward to your help and reply. thank you!
