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.

Lab12 problem

Other Parts Discussed in Thread: MOTORWARE

Hello,

I am using Estun_EMJ_04APB22 (HVPMSM kit motor) in my project. Using Lab12 I try sensored control with this motor. But I have problem. Sometimes motor runs correctly everything is OK, motor speed tracks reference speed.

But sometimes motor dosent spin or spins very fast in reverse direction with same code.

Let say I am reseting and restartig code 5 times, 2 times is OK but 3 times with problem.

I think I cant say its wiring problem  because sometimes motor running is OK.

It seems like starting problem. Setting calibrating angle or detecting index pulse can be wrong in my application.

If starting is good then everything is OK.

Is there any way of running motor in sensorless mode or ramp angle mode then switch to sensored mode. In sensorless mode or ramp angle mode I can check QEP angle with ossiloscope using PWMDAC.

  • Rasit,

    In the Lab 12 example, we establish a calibrated angle when the estimator goes into the Rs Recalibrtion state.  During this state the motor is aligned to a zero electrical angle, and we can read an offset from the quadrature encoder.  It is critical that in the example the motor goes through this state otherwise the encoder angle will have a fixed offset from the actual electrical angle of the motor.  

    From the description of your problem it sounds like the motor angle is not getting properly aligned with the encoder angle.

    When you tried the Lab 12 example did you modify the code to turn off the Rs Recalibration step?  

    Another option is to increase the USER_MOTOR_RES_EST_CURRENT, this will use more current in order to estimate the motor resistance and will have more force when aligning the motor to an electrical angle of zero.

    The Lab 12 example is designed as an example of how to replace the FAST software encoder with a physical encoder.  For specific implementations, there might need to be some considerations that are not taken into account with this project.  

    Hope this helps

  • I didnt turn off Rs Recalibration during  work. I tried increasing estimation current. It dosent solve problem as well.

    So until now, I havent solve problem. Sometimes rotor dosent rotate, sometimes rotates 2-3 spins then stop, sometimes rotate well as should be .

    I need more debug. I have problem observing variables in watch window. As an example I want to watch 

    enc_zero_offset variable in ENC_setZeroOffset function in enc.h file. What I have to write to watch window to see this variable? I tried someting but Its written Undefined variable in wach window.

    And I also want to see variable using PWMDAC channel. What I have to write in code and in which file to see variable on PWMDAC channel? As an example we were writing  

    pwmdac1.MfuncC1 = rg1.Out; 

    in control suite applications in main .c file. I didnt see this for the Motorware application.

    Best Regards,

  • Rasit,

    In order to setup the PWMDAC you will need to setup the drivers located in: C:\ti\motorware\MotorWare_1_01_00_09\sw\drivers\pwmdac

    I don't believe there is an example project that does this, however it should be fairly straight forward.  

    In order to watch the encoder variable in the watch window you would need to add the structure enc into the watch window.  

    It is also important to ensure that you are not command too low of a speed, encoders have a minimum resolvable speed.  You should also ensure that your inertia and bandwidth are set correctly according to labs 05c & 05e.  This will ensure that your speed controller is working correctly.

    Hope this helps!