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.

TMS320F28069M: Motor Instability in SpinTac velocity control

Part Number: TMS320F28069M

I am using a 8301D board with a F28069 control card. I have all estimator functions turned off, just RunIdentify, and EnableSys are on from startup and all values are initialized to init values. When I run the motor, about 50% of the time, in a seemingly random pattern, I can give the motor a positive velocity(any positive velocity) with a normal acceleration, then the motor will spin in reverse at max velocity. The code is based on lab 12b using the QEP as feedback for the control. I have also tested the lab code with the same results, it sometimes spins in reverse at max velocity.

  • 1. Use lab02b/c to identify the motor parameters first, and then set these parameters in user.h.
    2. Make sure that the encoder and motor is connected in correct order.

    3. Use lab12a to identify the inertia and friction of motor, and set these two paramerters in user.h also.
    4. Set the USER_MOTOR_ENCODER_LINES in user.h for ENC module based on your encoder.
    5. Change the SpinTAC parameters, and tune the USER_SYSTEM_BANDWIDTH_SCALE to run the motor smoothly.

  • I've gone through, and redone these labs to set the parameters. All of the values from lab2c are correct, and the encoder settings are correct, I've also done lab 12a to set the bandwidth. Do you have any idea which parameter in particular would cause this behavior?
  • How about running the lab12a to identify the inertia and friction of motor without the load? And what condition will cause the motor can't run well? Target speed, Acceleration and Load.
  • Yanming,

    I Re-Ran Lab12A with no load attached, and input those values into user.h. The condition as far as I can tell begins at startup, when it occurs no matter what velocity, or acceleration, or torque I input, it spin at -3krpm. I can also change the kp, ki, and bandwidth values with no effect on this error condition, the speed controller shows no error.

    Thanks

    Daniel Rush

  • Yanming,

    Also, as a follow up, the error state also takes in negative velocities and spins in the positive direction. Do you have any ideas on parameters I should specifically be looking at? I've done all labs that you have listed to verify correct motor parameters. This is what my initialization parameters look like when EST and CTRL start up.

  • 1. Can you share the user.h with us? And did you have current waveform to show the issue? What's the rated and maximum speed of your motor?
    2. Did you enable the Rs re-calculation to implement the encoder calibration?
  • Hey Yanming,

    So we found the part of documentation about rs recalibration which is done to set the rotor to a zero position. This resolved the issue that we were having, however it does add a lot of overhead in terms of start-up time and movement at startup to a zero point. Is there a way to not require Rs recalibration to run the control loop with encoder feedback, by starting from some relative encoder position?

    Thanks,

    Daniel

  • You may enable Rs recalibration to get the correct offset of encoder first, set the encoder's offset in ENC_setup() as below and bypass the Rs recalibration in next time.

    // setup the ENC module
    ENC_setup(encHandle, 1, USER_MOTOR_NUM_POLE_PAIRS, USER_MOTOR_ENCODER_LINES, USER_ENCODER_ZERO_OFFSET, USER_IQ_FULL_SCALE_FREQ_Hz, USER_ISR_FREQ_Hz, 8000.0);
  • It's starting to make some more sense, but I have some questions. So is this a number that depends on rotor starting in the same position at startup every time? I have run startup a few times to see if enc->enc_zero_offset is different after each startup including when it starts at the same position. What value am I looking for to put into that setup function?

  • You need to do the offset calibration at the controller power up every time, and need to record the encoder output even the motor stops. Read the enc.enc_zero_offset and set it to ENC_setup() as below.
    ENC_setup(encHandle, 1, USER_MOTOR_NUM_POLE_PAIRS, USER_MOTOR_ENCODER_LINES, enc.enc_zero_offset , USER_IQ_FULL_SCALE_FREQ_Hz, USER_ISR_FREQ_Hz, 8000.0);