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.

CCS/LAUNCHXL-F28069M: Instaspin-focto implement the servo motor control with a absolute encoder

Part Number: LAUNCHXL-F28069M

Tool/software: Code Composer Studio

Now I want to implement the servo motor control using the Instaspin-foc.Obviously,the FAST encdoer can not work well.

we need an Incremental encoder or an absolute encoder to measure the Electrical angle.

Now I select an absolute encoder which is based on Biss protocol.

I use the TMS320F 28069M and a FPGA implement the servo motor control.

the FPGA read the absolute encoder value and sent the data to the 28069 via SPI bus.

Now I have some question and this scheme.

1.whether the 28069 and fpga scheme is reasonable?

2.I do not konw how to use the abssolute encoder offer the Electrical angle instead of FAST software encoder.

// generate the motor electrical angle
angle_pu = EST_getAngle_pu(obj->estHandle);

3.the 28069 read the electrical angle from the fpga via spi.

whether the 28069 read program can use the spi interrupt ?

how to add the spi read program into the instaspin-foc?

Thanks

  • 1) Yes, it is feasible to program the FPGA to read the encoder via Biss protocol and communicate with F28069 via SPI
    2) InstaSPIN-FOC FAST estimator is intended for sensorless angle estimation. With an absolute encoder, you will no longer need FAST. You can instead refer to InstaSPIN-MOTION labs 12 for sensored systems. These were designed for use with encoders.
    3) SPI initialization is talked about in this thread: e2e.ti.com/.../569677. You can add an SPI interrupt, as long as you ensure that it's priority is not higher than the ADC interrupt.

    Sean
  • Thanks,Sean.

    1.I find out that someone use the McBSP  to read the absolute encoder with BiSS-C interface.

       Do you think which methods is better?

    2.Please explain in detail how to use the absolute position encoder value as the electrical angle instead of an iIncremental encoder in lab12.

    I read the program in lab12b.

    in ctrlQEP.h the angle_pu is equal to the sensor electricalAngle .

    // generate the motor electrical angle
    angle_pu = EST_getAngle_pu(obj->estHandle);

    // Update electrical angle from the sensor
    angle_pu = electricalAngle;

    electricalAngle is caculated by the ENC_calcElecAngle() function.

    // compute the electrical angle
    ENC_calcElecAngle(encHandle, HAL_getQepPosnCounts(halHandle));

    void ENC_calcElecAngle(ENC_Handle encHandle, uint32_t posnCounts)
    {
    ENC_Obj *enc;
    uint32_t temp;

    // create an object pointer for manipulation
    enc = (ENC_Obj *) encHandle;

    // compute the mechanical angle
    temp = posnCounts*enc->mech_angle_gain;
    // add in calibrated offset
    temp += enc->enc_zero_offset;
    // convert to electrical angle
    temp = temp * enc->num_pole_pairs;
    // wrap around 1.0 (Q24)
    temp &= ((uint32_t) 0x00ffffff);
    // store encoder electrical angle
    enc->enc_elec_angle = (_iq)temp;
    // update the slip angle
    enc->enc_slip_angle = enc->enc_slip_angle + enc->incremental_slip;
    // wrap around 1.0 (Q24)
    enc->enc_slip_angle &= ((uint32_t) 0x00ffffff);
    // add in compensation for slip
    temp = temp + enc->enc_slip_angle;
    // wrap around 1.0 (Q24)
    temp &= ((uint32_t) 0x00ffffff);
    // store encoder magnetic angle
    enc->enc_magnetic_angle = (_iq)temp;

    return;
    } // end of ENC_calc_elec_angle() function

    I know How to handle the alignment between the motor and the absolute encoder.

    but I do not know how to ues  the absolute encoder value as the angle_pu,

    I just need to change the absolute encoder into IQ(24)?

    Please give me a hand~

    Thanks~