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.

TINA/Spice/TMS320F28069M: TMS320F28069M Position control

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!

 

  • I didn't fully get what you are trying to do. Do you mean you have a scheduled plan from A to B and a interrupt will happen during the movement and you want to modify the plan to stop at a certain location and resume moving to the original destination?

    If you wish to have a smooth stop and D and restart from D to B, that means you will need to modify the existing plan during it running and then plan a brand new movement from D to B. Is that what you are trying to achieve? Thanks.
  • If you wish to have a smooth stop and D and restart from D to B, that means you will need to modify the existing plan during it running and then plan a brand new movement from D to B. Is that what you are trying to achieve?

    yes!

    However, an error occurred when I called the "STPOSPLAN_setCfgState" function to reprogram D to sequence B: ERR_code 1: put SpinTAC Plan into idle state before running the configuration.But when the RES ==false and ENB ==True and DON ==True, I can't get the idle state by doing ENB ==false,why? thank you!

  • Hi Zhanghan,

    To make it clearly, after discuss with user5876589. The application is gate machine.

    1. Usually, it open and close gate by do movement between position A and B.

    2. It should goes to stop immediately when somebody burst into gate unexpectedly during the movement from A to B. Such as stop at the position D.

    3. After a few time break off, then it should keep moving to position B, but actually it will move to the position C because it thought it still start at position A.

    So, customer question is how to keep moving to position B rather than C if it has been broken off at position D?

    Device is TMS320F28069M, debug based on Proj_lab13d.c project. Thanks in advance.

  • Daniel, Thanks for the clarification.

    Based on Table 3-21 of InstaSPIN-FOC and InstaSPIN-MOTION UG (spruhj1g), you can only jump from BUSY to HALT if the motion is not done. The state machine only jump from BUSY to IDLE when DON is true. You can set the RES high and the state machine will go to HALT and jump to IDLE after timer times up. There is no way to resume from HALT back to BUSY and resume the motion. You will have to reconfig the motion after stopping. Thanks.

    Han
  •     Hi ZhangHan

        The question we asked you before has been realized. Now we have a new problem:In the case of load, the motor's motion curve is not particularly smooth in the process of moving from A to B, which is improved by modifying the bandwidth. What other parameters will affect the smooth motion?
        In addition, can we obtain the real-time speed during the movement? If so, which interface function should we call?

        Thank you!

  • For the InstaSPIN Motion controller, the bandwidth and inertia are the two key parameters, which may affect the smoothness of the tracking movement. The friction can also be tuned.

    The InstaSPIN Motion position controller does not use speed as a intermediate parameter, hence will not have a speed value to be obtained. You could obtain the position feedback instead and calculate the speed yourself.

    Thanks.
    Han
  • Hi Zhanghan,

    Device is TMS320F28069M, debug based on Proj_lab13d.c project.

    When the movement from position A to position B is stopped suddenly by ST_PLAN_PAUSE,
    Is the above stopping method to stop immediately, or to stop by ST curve?

    If the pattern above is to stop immediately, how do I stop with an ST curve if I need to stop suddenly ?

    Thanks.
  • Hi,

    The purpose of user5876589 is hope it stop smoothly rather than immediately.
    Because the application is gate control, suddenly stop would lead to door vibration.
  • As discussed in the follow-up thread, e2e.ti.com/.../758323, this feature is not supported by InstaSPIN-Motion at this time. Thanks.

    Han