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.

Intraspin internal variables reset

Genius 5910 points
Other Parts Discussed in Thread: LAUNCHXL-F28069M, BOOSTXL-DRV8301, LVSERVOMTR, MOTORWARE, TMS320F28069M, TMS320F28054M

Hi,

I have a problem with CCS debugger when I exit the program the via a breakpoint. Or if I restart the program  via CCS button.

 When I restart the program it start at the correct address but I and up here: No source available for "0x400a2" / No source available for "0x3ff4fa"  Are the interrupt table/peripherals reset?

 If I leave the program via a breakpoint and reprogram the controller again . Then when I start the controller the controller moved uncontrolled and quite violent. I think the motor tried to go back  to is old position. That is quite dangerous. I can solve this by power cycle the controller before programming.

So I think the internal  variables aren't properly reset.

 So how do I manually reset ALL of the internal variables of the intraspin controller.

Thanks.

 

 

 

  • not sure I'm completely following, but in the proj_lab## we use the gMotorVars.Flag_enableSys as the "reset button". if you toggle this from 1 to 0, the code disables the PWMs and passes the gUserParams structure to the CTRL handle. This is everything required by the control system itself. To do more of a reset than that you would need to actually reset and restart the processor.

    for(;;)
    {
    // Waiting for enable system flag to be set
    while(!(gMotorVars.Flag_enableSys));

    // disable the PWM
    HAL_disablePwm(halHandle);

    // set the default controller parameters (Reset the control to re-identify the motor)
    CTRL_setParams(ctrlHandle,&gUserParams);
    gMotorVars.Flag_Run_Identify = false;

    } // end of for(;;) loop
  • Thanks! for you restart,reboot, reinstall answer.

    I don't think the debugger tool reset the microcontroller memory the same as a hard reset. So when I reprogram the controller old control values stays in memory. So how do I it manually?

    Please do the following test:
    run the motor in FOC
    stop the program via an breakpoint.
    exit the emulator
    reprogram the controller with the same program
    start the program
    start the controller
    do a position move.

    When I do that the controller moves uncontrolled and then the controller stops with a 2002 err_ID. When I exit the program while it is running and reprogram it every think works fine. I checked my program's for oddities but can't fined any. I can only reproduce the problem as described.


    This problem is pretty dangerous and i'm out of debug options.
  • you are leaving the MCU at a breakpoint and then trying to program a new binary over JTAG?
    Is this project binary built for FLASH or just for RAM (RELEASE)?
  • this is not advised. you should remove the breakpoint and turn off any real-time mode before reprogramming. I would also do a reset and restart of the CPU.
  • Thanks, That is great advice! Stop using CCS that would be create. Please answer my question?

    Adam? Can you please, please look at my problem?

    Edit: I'm at the point that I considering throwing a way a half  year of work. because of this.  I needs to be sure that the motors starts safely.

  • I'm having trouble reproducing the issue.  This is the procedure I went through on CCSv6:

    1. Debug lab 13b

    2. Run the motor a little bit

    3. Create a breakpoint in the background loop

    4. Terminate the debug session

    5. Debug lab 13b

    6. Run the motor a little bit

    It never ran away on me during that procedure.

    Can you discuss where this procedure is different from what you worked through?

  • Adam thanks for the reply!

    I think the problem is when your run the motor in FOC continues rotation. breakpoint, restart then do a position move. I think you can't do that with lab 13b. And somehow the position index is out of sync,( after that, I got an err 2002). I can reproduce it.
    Don't understand way, it is really strange. At this point I think it is something with the debug tool.
    I was thinking, Is it possible to align the internal controller with the encoder so that even when the rotor is moved and the controller is restarted it stays put.
  • Gotcha, I didn't understand at first. I tired break pointing while in the middle of position moves and after restarting I was able to continue the position move. I even physically moved the motor while in a breakpoint and it was able to than do a new position move after that.

    Is you encoder calibrated before you start doing continuous rotation in FOC? Is the SpinTAC Position Converter running in that case? That component would be required to run so that it can track the motor position.
  • I don't understand what you mean by encoder calibrated, I have the correct value in user.h. The FOC continues move works fine.

    for the transition between move and FOC. I have this in my interrupt routine:

    if (stCnt++ >= ISR_TICKS_PER_SPINTAC_TICK) {
    ST_runPosConv(intr);
    // position control
    if (intr->Flag_enableFOC == false) {
    ST_runPosPlanTick(intr->stHandle);
    //ST_runPosPlan(intr);
    }
    // stop when the end speed is 0
    else if ((intr->SpinTAC.PosMoveDone == 1)
    && (intr->SpinTAC.PosMoveStatus == ST_MOVE_IDLE)
    && (STPOSMOVE_getVelocityEnd(stObj->posMoveHandle) == 0))
    intr->Flag_enableFOC = false;
    //ST_runPosMove(intr);
    STPOSMOVE_run(stObj->posMoveHandle);
    ST_runPosCtl(intr);
    stCnt = 1;
    }

    //STPOSCONV_run(stObj->posConvHandle); is in runPosConv


    What I forgot to tell. When I do a FOC continuous move breakpoint reprogram FOC continuous move everything works fine.
  • When you start the motor, are you doing Rs Recalibration?

    Is this code still in your ISR?

    // if we are forcing alignment, using the Rs Recalculation, align the eQEP angle with the rotor angle
      if((EST_getState(obj->estHandle) == EST_State_Rs) && (USER_MOTOR_TYPE == MOTOR_Type_Pm))
      {
    	  ENC_setZeroOffset(encHandle, (uint32_t)(HAL_getQepPosnMaximum(halHandle) - HAL_getQepPosnCounts(halHandle)));
      }

    My guess is that when you in FOC, MOTION doesn't know where the motor is and is having trouble with starting from where the motor is.  Is there a reason why you don't use the encoder all of the time?

  • I'm working at canopen homing procedures. Normally the continues motion runs very,very smooth. So that seems to works correctly

    I also use the encoder for continues motion:
    See this code:
    if ((EST_getState(obj->estHandle) == EST_State_Rs)
    && (USER_MOTOR_TYPE == MOTOR_Type_Pm)) {
    ENC_setZeroOffset(intr->encHandle,
    (uint32_t) (ENC_getPositionMax(intr->encHandle)
    - ENC_getRawEncoderCounts(intr->encHandle)));

    Yes I start the motor with Rs recalibration
  • It looks like the code you have isn't running the position control when move is running a profile. It seems like there might be a problem with the else if ((intr->SpinTAC.PosMoveDone == 1)
    && (intr->SpinTAC.PosMoveStatus == ST_MOVE_IDLE)
    && (STPOSMOVE_getVelocityEnd(stObj->posMoveHandle) == 0))
  • Adam,

    I tried to debug it, to verify if that part is running correctly. Unfortunately I can't reproduce the problem anymore. I didn't change any code in that part. So that is a bit worrying. thanks for your help anyway.
  • Adam,

    I did some(allot) of testing to investigate into this problem.  The problem is location based.

    I work with a low res encoder => USER_MOTOR_ENCODER_LINES        (75.0)   So maybe that enlarge the problem.

      The problem is at location:

    GRP( eQEP1 ).REG( QPOSCNT )        0x00000000    
    GRP( eQEP1 ).REG( QPOSILAT )         0x00000000   

    When you start the controller. In the init process the motor moves(wiggle) a little.  Only not at this location. The motor stays put. But st_obj.pos.conv.Pos_mrev      changes from 0 to -0.003334283829  without moving the motor.

     The steps to reproduce it. My luck rate is one in 3-5 times.

     - find the Qpos  0 location.  stop the controller. Start the controller. Check that at init the motor did not move. Some times the controller runs of by itself. Else do a move of a FOC (continues move).  It is less than 1 motor rotation.

    I did thoroughly checked that non of my code is causing this problem.  

    So Do you have any suggestion to which part of the code I have to debug any further. (init process??)

    Thanks!!!

    I don 't know if it is of any use. But this are all the variables right before the controller runs away

    intr_obj.Flag_enableSys    unsigned char    1 (Decimal)    0x0000903B@Data    
    intr_obj.Flag_Run_Identify    unsigned char    1 (Decimal)    0x0000903C@Data    
    intr_obj.MotorVars    struct _MOTOR_Vars_t_    {...}    0x00009078@Data    
        Flag_enableSys    unsigned char    0x0001 (Hex)    0x00009078@Data    
        Flag_Run_Identify    unsigned char    0x0001 (Hex)    0x00009079@Data    
        Flag_MotorIdentified    unsigned char    0x0001 (Hex)    0x0000907A@Data    
        Flag_enableForceAngle    unsigned char    0x0001 (Hex)    0x0000907B@Data    
        Flag_enableFieldWeakening    unsigned char    0x0000 (Hex)    0x0000907C@Data    
        Flag_enableRsRecalc    unsigned char    0x0001 (Hex)    0x0000907D@Data    
        Flag_enableUserParams    unsigned char    0x0001 (Hex)    0x0000907E@Data    
        Flag_enableOffsetcalc    unsigned char    0x0001 (Hex)    0x0000907F@Data    
        Flag_enablePowerWarp    unsigned char    0x0000 (Hex)    0x00009080@Data    
        CtrlState    enum unknown    CTRL_State_OnLine    0x00009081@Data    
        EstState    enum unknown    EST_State_OnLine    0x00009082@Data    
        UserErrorCode    enum unknown    USER_ErrorCode_NoError    0x00009083@Data    
        CtrlVersion    struct _CTRL_Version_    {...}    0x00009084@Data    
        IdRef_A    long    0    0x00009088@Data    
        IqRef_A    long    0    0x0000908A@Data    
        MaxVel_krpm    long    33554432    0x0000908C@Data    
        MaxAccel_krpmps    long    3355443    0x0000908E@Data    
        MaxDecel_krpmps    long    3355443    0x00009090@Data    
        MaxJrk_krpmps2    long    5242880    0x00009092@Data    
        PositionError_MRev    long    0    0x00009094@Data    
        Speed_krpm    long    -23    0x00009096@Data    
        OverModulation    long    16777216    0x00009098@Data    
        RsOnLineCurrent_A    long    5033165    0x0000909A@Data    
        Flux_Wb    long    420882    0x0000909C@Data    
        Torque_Nm    long    -3842    0x0000909E@Data    
        MagnCurr_A    float    0.0    0x000090A0@Data    
        Rr_Ohm    float    0.0    0x000090A2@Data    
        Rs_Ohm    float    0.0    0x000090A4@Data    
        RsOnLine_Ohm    float    0.0    0x000090A6@Data    
        Lsd_H    float    0.0    0x000090A8@Data    
        Lsq_H    float    0.0    0x000090AA@Data    
        Flux_VpHz    float    0.0    0x000090AC@Data    
        Kp_spd    long    0    0x000090AE@Data    
        Ki_spd    long    0    0x000090B0@Data    
        Kp_Idq    long    1427246    0x000090B2@Data    
        Ki_Idq    long    3648999    0x000090B4@Data    
        Vd    long    0    0x000090B6@Data    
        Vq    long    0    0x000090B8@Data    
        Vs    long    0    0x000090BA@Data    
        VsRef    long    15099494    0x000090BC@Data    
        VdcBus_kV    long    418607    0x000090BE@Data    
        Id_A    long    0    0x000090C0@Data    
        Iq_A    long    0    0x000090C2@Data    
        Is_A    long    0    0x000090C4@Data    
        I_bias    struct _MATH_vec3_    {...}    0x000090C6@Data    
            value    long[3]    0x000090C6@Data    0x000090C6@Data    
                [0]    long    14628704    0x000090C6@Data    
                [1]    long    14692207    0x000090C8@Data    
                [2]    long    14603734    0x000090CA@Data    
        V_bias    struct _MATH_vec3_    {...}    0x000090CC@Data    
            value    long[3]    0x000090CC@Data    0x000090CC@Data    
                [0]    long    4322513    0x000090CC@Data    
                [1]    long    4327482    0x000090CE@Data    
                [2]    long    4286368    0x000090D0@Data    
    intr_obj.MotorVars.UserErrorCode    enum unknown    USER_ErrorCode_NoError    0x00009083@Data    
    intr_obj.MotorVars.CtrlVersion    struct _CTRL_Version_    {...}    0x00009084@Data    
        rsvd    unsigned short    0    0x00009084@Data    
        targetProc    enum unknown    CTRL_TargetProc_Unknown    0x00009085@Data    
        major    unsigned short    0    0x00009086@Data    
        minor    unsigned short    0    0x00009087@Data    
    intr_obj.MotorVars.Flag_enableSys    unsigned char    1 (Decimal)    0x00009078@Data    
    intr_obj.MotorVars.Flag_Run_Identify    unsigned char    1 (Decimal)    0x00009079@Data    
    intr_obj.MotorVars.Flag_enableOffsetcalc    unsigned char    1 (Decimal)    0x0000907F@Data    
    intr_obj.MotorVars.Flag_enablePowerWarp    unsigned char    0 (Decimal)    0x00009080@Data    
    intr_obj.MotorVars.CtrlState    enum unknown    CTRL_State_OnLine    0x00009081@Data    
    intr_obj.MotorVars.EstState    enum unknown    EST_State_OnLine    0x00009082@Data    
    intr_obj.MotorVars.Flag_MotorIdentified    unsigned char    1 (Decimal)    0x0000907A@Data    
    intr_obj.MotorVars.Torque_Nm    long    -0.0002267956734 (Q-Value(24))    0x0000909E@Data    
    intr_obj.MotorVars.MaxVel_krpm    long    2.0 (Q-Value(24))    0x0000908C@Data    
    intr_obj.MotorVars.MaxAccel_krpmps    long    0.1999999881 (Q-Value(24))    0x0000908E@Data    
    intr_obj.MotorVars.MaxDecel_krpmps    long    0.1999999881 (Q-Value(24))    0x00009090@Data    
    intr_obj.MotorVars.MaxJrk_krpmps2    long    5.0 (Q-Value(20))    0x00009092@Data    
    intr_obj.SpinTAC.PosCtlStatus    enum unknown    ST_CTL_BUSY    0x00009058@Data    
    intr_obj.SpinTAC.InertiaEstimate_Aperkrpm    long    0.173930943 (Q-Value(24))    0x0000905A@Data    
    intr_obj.SpinTAC.FrictionEstimate_Aperkrpm    long    0.2174943089 (Q-Value(24))    0x0000905C@Data    
    intr_obj.SpinTAC.PosCtlBwScale    long    1.0 (Q-Value(24))    0x0000905E@Data    
    intr_obj.SpinTAC.PosCtlBw_radps    long    20.0 (Q-Value(20))    0x00009060@Data    
    intr_obj.SpinTAC.PosCtlErrorID    unsigned short    0    0x00009066@Data    
    intr_obj.SpinTAC.PosMoveStatus    enum unknown    ST_MOVE_IDLE    0x00009067@Data    
    intr_obj.SpinTAC.PosMoveCurveType    enum unknown    ST_MOVE_CUR_STCRV    0x00009068@Data    
    intr_obj.SpinTAC.PosMoveTime_ticks    long    0    0x0000906A@Data    
    intr_obj.SpinTAC.PosMoveTime_mticks    long    0    0x0000906C@Data    
    intr_obj.SpinTAC.PosMoveDone    unsigned char    1 (Decimal)    0x0000906E@Data    
    intr_obj.SpinTAC.PosMoveErrorID    unsigned short    0    0x0000906F@Data    
    intr_obj.SpinTAC.PosPlanRun    enum unknown    ST_PLAN_STOP    0x00009070@Data    
    intr_obj.SpinTAC.PosPlanStatus    enum unknown    ST_PLAN_IDLE    0x00009071@Data    
    intr_obj.SpinTAC.PosPlanDone    unsigned char    .    0x00009072@Data    
    intr_obj.SpinTAC.PosPlanErrorID    unsigned short    0    0x00009073@Data    
    intr_obj.SpinTAC.PosPlanCfgErrorIdx    unsigned short    0    0x00009074@Data    
    intr_obj.SpinTAC.PosPlanCfgErrorCode    unsigned short    0    0x00009075@Data    
    intr_obj.MotorVars.Kp_Idq    long    0.08507049084 (Q-Value(24))    0x000090B2@Data    
    intr_obj.MotorVars.Ki_Idq    long    0.2174972892 (Q-Value(24))    0x000090B4@Data    
    cpu_usage.CpuUsagePercentageAvg    float    67.98512    0x00008C0E@Data    
    intr_obj.MotorVars.VdcBus_kV    long    0.02493470907 (Q-Value(24))    0x000090BE@Data    
    intr_handle->st_obj.pos.conv.Pos_mrev    long    -0.003334283829 (Q-Value(24))    0x008E60@Data    
    GRP( eQEP1 ).REG( QPOSCNT )    Unsigned / Readable,Writeable    0x00000000    
    GRP( eQEP1 ).REG( QPOSILAT )    Unsigned / Readable,Writeable    0x00000000    

  • I can reproduce it in LAB13B. I have marking on my sliding table so I can move it to the correct spot. Restart the controller set 1 .PosStepInt_MRev and .RunPositionProfile. And the motor spins off and I got a PosCtlErrorID = 2002. Other locations works fine.
    I really don't know why that location is special, no index pulse. So I gone replace the encoder. It is really odd.
  • I'm really not sure how you are triggering the issue.

    Since your encoder has 75 PPR, this means that 1/300.0 = 0.0033333 so when it doesn't move but st_obj.pos.conv.Pos_mrev reads -0.003334283829 it moved exactly 1 encoder count.

    What variables are your manipulating in order to reset the controller?

    Typically we only see a run-away case under a single circumstance:
    - The motor and encoder are not longer aligned. This means that when enc.enc_elec_angle reads 0, the motor's actual electrical angle is not 0.

    I'm thinking that when you reset the controller the encoder is now no longer aligned to the motor and when you try to run in position control it isn't applying stator current correctly given the rotor position of the motor.
  • Adam,

    I can reproduce it in LAB13B: I tried it a dozen times with most time succes:

     Can you please do the following:

     Start LAB13B:

     Add encHandle->enc_magnetic_angle to the watch window

     - gMotorVars.Flag_enableSys =1

    - gMotorVars.Flag_Run_Identify    =1

    - Wait for gMotorVars.CtrlState and gMotorVars.EstState become online

     - gMotorVars.PosStepFrac_MRev = 0.48

    - gMotorVars.RunPositionProfile = 1

     - encHandle->enc_magnetic_angle is just below 0.5

     - gMotorVars.Flag_enableSys =0

     - gMotorVars.Flag_enableSys =1

    - gMotorVars.Flag_Run_Identify    =1

    - Wait for gMotorVars.CtrlState and gMotorVars.EstState become online

    Check if motor stays put at EST_State_Rs. If not, it is not gone happen. 

     - gMotorVars.PosStepFrac_MRev = 0.5 (any value app.  > 0.2 will do)

    - gMotorVars.RunPositionProfile = 1

    The motor runs off and I get a gMotorVars.SpinTAC.PosCtlErrorID = 2002

    By now I can really easy reproduce the problem. 

  • I went through these steps and was not able to reproduce the problem with the LAUNCHXL-F28069M + BOOSTXL-DRV8301 with the LVSERVOMTR.

    Are you running an ACIM or PMSM?

    Which version of MotorWare are you using?

    Is there a large inertia or friction connected to your motor?  It is possible that if you have a large inertia connected to your motor than it might not get a good alignment between the motor and the encoder.  If this is the case, I would recommend that you increase the value in USER_MOTOR_RES_EST_CURRENT.  I've had to use up to USER_MOTOR_MAX_CURRENT in order to get a good alignment in some cases.

  • Adam, Thank you for taking the time for testing it.

    I'm using a older version of motorware because It tool a lot of effort to untangle the demo and the library and I added an interface layer. I'm reserved to go though it all again with a newer version.

    My test rig is a DRV8312EVM with a faulhaber 4490 h 48V  BLDC motor  running at 25- 30V. With 4.8:1 reduction, a  360 encoder connected via a gear wheel. The Gear wheel is driving a tooth belt. Where a small cube is connected. So Not a real heavy load. I can really easy move it by hand. 

     I tried to reproduce your result. I removed my gear belt and did the same test. I can't do it either. What I noted was that intr_obj.encHandle->enc_magnetic_angle  is changing between 0 and 1. So Without load, it is impossible to set it  fixed at 0.48

    So I set USER_MOTOR_RES_EST_CURRENT = USER_MOTOR_MAX_CURRENT

     That reduced the problem but it didn't go away. I reduced the tension of the belt so it really loosely grip the gear. That Makes it really hard to reproduce it. After one hour  testing. I only managed to get  it ones. 

     But! If I start the controller with:

     normal start:

      move 0.48

    stop

    Start with  Flag_enableRsRecalc=false and Flag_enableOffsetcalc=false.

    move 1

     Then Motor runs away. Multi rotations bounced at the gear wheel and reverse direction.  That is very easy to reproduce.

    I tried other values in stead of 0.48: 0.3 - 0.7 give the same effect.

     


     

  • No worries about not wanting to rebase to the latest MotorWare. I've got the installers for the older versions and I was going to try this procedure on the same one you are using.

    enc_magnetic_angle might not be the right angle to look at. In the encoder module that is used to compensate for the slip in induction motors. You would probably be better off looking at intr_obj.encHandle->enc_electrical_angle or st_obj.pos.conv.Pos_mrev.

    It sounds like when you stop, that your system is getting out of alignment. It is probably worth making sure that when gMotorVars.Flag_enableSys is false that your encoder value is still updating. If it isn't this could cause this issue.
  • Adam,

    I found the following oddity:

     #define USER_MOTOR_Rs (0.35525)
    #define USER_MOTOR_Ls_d  (0.0001088917)
    #define USER_MOTOR_Ls_q  (0.0001088917)

    In CTRL_setMotorParams

     Ls_d_H    float    0.0001088917  
    Ls_q_H    float    0.0001088917 
    Rr_Ohm    float    0.0   
    Rs_Ohm    float    0.35525   

    But: When I read it back with:


        CTRL_Obj *obj = (CTRL_Obj *) intr->ctrlHandle;
        intr->MotorVars.Rr_Ohm = IQ24toF( EST_getRr_Ohm(obj->estHandle));
        intr->MotorVars.Rs_Ohm =IQ24toF ( EST_getRs_Ohm(obj->estHandle));
        intr->MotorVars.Lsd_H =IQ24toF ( EST_getLs_d_H(obj->estHandle));
        intr->MotorVars.Lsq_H =IQ24toF (EST_getLs_q_H(obj->estHandle));

     I got the following results:

     ((intr_obj).MotorVars).Rs_Ohm    float    62.7087  
    ((intr_obj).MotorVars).Lsd_H    float    0.0    
    ((intr_obj).MotorVars).Lsq_H    float    0.0    

    So that is really wrong.

    In the code after CTRL_setMotorParams I lost track of it. It is  all extern. So any hint where to look or which function call is missing.

    Thanks!

     



     

  • I'm not sure why those functions aren't returning values.  It seems like your function calls are correct.  The only thing I would double check is that your ctrlHandle is pointing to the right memory location.

  • Adam,

     I debugged the disassembled code of the call:


    Lab13B Code

    598       gMotorVars.Rs_Ohm = EST_getRs_Ohm(obj->estHandle);
    3e1ab0:   8A92        MOVL         XAR4, *+XAR2[AR0]
    3e1ab1:   767F9513    LCR          0x3f9513
    3e1ab3:   761F0231    MOVW         DP, #0x231
    601       gMotorVars.Lsd_H = EST_getLs_d_H(obj->estHandle);
    3e1ab5:   D018        MOVB         XAR0, #0x18
    598       gMotorVars.Rs_Ohm = EST_getRs_Ohm(obj->estHandle);
    3e1ab6:   1E32        MOVL         @0x32, ACC


    My Code:
    339         intr->MotorVars.Rs_Ohm = IQ24toF (EST_getRs_Ohm(obj->estHandle));
    3e1a4e:   8A93        MOVL         XAR4, *+XAR3[AR0]  //  Input XAR Est_Handle pointer , Dubbed checked if it is correct
    3e1a4f:   767F9513    LCR          0x3f9513
    3e1a51:   BDA90F12    MOV32        R0H, @ACC    // return ACC = 0x3EB6A011  That is 62 Ohm.
    3e1a53:   7700        NOP          
    3e1a54:   7700        NOP          
    3e1a55:   7700        NOP          
    3e1a56:   7700        NOP          
    3e1a57:   E6890000    I32TOF32     R0H, R0H
    3e1a59:   8D400464    MOVL         XAR1, #0x000464
    3e1a5b:   E84CE000    MPYF32       R0H, #0x3380, R0H

    I think this is correct. So I think the controller is working with a 62 R Rs and maybe that is the reason my motor runs away.  How is this value defined in the controller?  ctrlHandle.motorParams.Rs_Ohm  (0.35525)  ?

     Edit: Don't know if it is usefull. Here is the Esthandle data:


    Lab13B:
    gMotorVars.Rs_Ohm    float    0.35306 (Decimal)   
    ctrlHandle->estHandle    struct _EST_Obj_ *    0x00013840    0x013C58@Data    
        *(ctrlHandle->estHandle)    struct _EST_Obj_    {...}    0x013840@Data    
            a1    long    65539    
            b0    long    -403832832    
            b1    long    0    
            x1    long    0    
            y1    long    120000    


    My program:
    intr->MotorVars.Rs_Ohm    float    62.71356    
    obj->estHandle    struct _EST_Obj_ *    0x00013840    0x013C58@Data    
        *(obj->estHandle)    struct _EST_Obj_    {...}    0x013840@Data    
            a1    long    196621    
            b0    long    -403832832    
            b1    long    0    
            x1    long    0    
            y1    long    120000    

     

     

  • I would expect that your motor would run away if the motor parameters are really wrong.  That will mean that the estimator is working with bad parameters.  

    I'll have to defer to the TI experts about how to resolve this issue.

  • I changed my code from FPU32 to to Softlib. Then EST_getRs_Ohm dislay the correct value.  Unfortunately this didn't solve my runaway problem.

     When:

    USER_MOTOR_RES_EST_CURRENT= USER_MOTOR_MAX_CURRENT

     and

    EST_setFlag_enableRsRecalc(obj->estHandle, true);

    Then it is very hard to reproduce the problem.

     When EST_setFlag_enableRsRecalc(obj->estHandle, false); It happen very often.

     So the easy way to solver the problem is setting EST_setFlag_enableRsRecalc(obj->estHandle, true); I'm not so sure, this solve the problem but only hiding it.

    I was wondering is it useful to change from TMS320F28069M  to TMS320F28054M . The TMS320F28054M  has version 1.7. are there any significant changes?

     

     

     

  • evs said:

    I was wondering is it useful to change from TMS320F28069M  to TMS320F28054M . The TMS320F28054M  has version 1.7. are there any significant changes?

    not useful. The only change was in how the CTRL handle was initialized and fixing the variable type issue that is patched with softwareUpdate1p6 API.

    Certainly if your motor parameters are somehow being loaded incorrectly this would cause an issue. Even if you aren't using FAST the Rs and Ls are still used for setting the current controller gains.  If it's only happening with the FPU enabled I would check the link order of the FPU and all libraries. They need to be linked in a specific order as in our examples.

    But you are still having the issue even with correct motor parameters, so I don't think that's the root cause.

  • evs said:
    When EST_setFlag_enableRsRecalc(obj->estHandle, false); It happen very often.

    Unless you have replaced the code that sets up the offset between the motor electrical angle of 0 and the encoder electrical angle of 0, setting RsRecalc is not recommended.  Regardless of any other issues, if your system isn't aligned between motor and encoder I would not expect sensored control to work correctly.