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/TMS320F28335: Reduce number of samples in rslver_algo_float()

Part Number: TMS320F28335

Tool/software: Code Composer Studio

Hi,

In a high temperature application I'm using the F28335 and the Resolver_Lib_Float.lib library. I have successfully implemented the rslver_algo_float() function, and I'm getting good quality angle updates every 16th ADC sample. However, due to the high temperature application I have reduced the system frequency to 90MHz and timing becomes an issue. Is there any way to reduce the number of sampling points required by the rslver_algo_float() function?

I realize that the x035 demo provided with the library package requires only 8 samples to produce an angle update. However, this example uses the Resolver_Lib_Fixed.lib library i.e. rslver_algo_fixed(). When I try to implement the 8 sample approach in my source code, the rsolvr_algo_float() fails to produce any angle data i.e. it never reaches the state where the angle data is calculated.

The following summarize what I have done in my attempt to reduce the number of sampling point required:

- DELAY_LENGTH set to 8

- Updated SINE_TABLE to match new DELAY_LENGTH

- Updated FIR_COEFF to match new DELAY_LENGTH (copied the coefficients from the x035 demo, but made them float type)

- Doubled SINE_CARRIER to maintain the resolver excitation frequency.

I suspect that with these changes the rslverOut.sineIndex never reaches the value where it triggers an angle calculation in the rslvr_algo_float() routine. Can this be the case?

Am I missing something in my approach?

Any help and pointers are much appreciated :)

 

  • SINE_CARRIER represents the PERIOD of carrier generating the exc sine wave. This particular count sets the EPWM to generate the carrier to sine carrier at 240KHz. This PWM is LPFed to get 10KHz sine wave. 

    To keep the same carrier PWM frequency (240KHz), set the SINE_CARRIER to 250 * 90/60 = 250 * 1.5.  Hope it helps.

    Pls review the user guide for details.

  • Thanks for responding :)

    I understand the SINE_CARRIER and its relation to the sine wave. I want to half the sine carrier frequency so I can generate the same sine wave frequency with a SINE_TABLE of size 8 (DELAY_LENGTH). Anyway, I don't think this is the root of my problem, as I'm able to generate the 10kHz sine wave. What I'm hoping to achieve is to generate angle outputs with only 8 samples i.e. 8 executions of the rsolvr_algo_float(). Is this even possible to achieve with the rsolvr_algo_float() function?

  • In the resolver_float_algo(), the function expects 16 entries to complete a sine wave. It is hard coded in the library. However, you can work around it

    In the reslvr_ISR(), before and after calling resolver_alog_float(), you may have to do some manipulation

    SineIndexStack = rslvrOut.sineIndex;

    rslvrOut.sineIndex += 8;

    if (resolver_algo_Float())
    {
    EPwm1Regs.ETCLR.bit.INT = 1; // clear EPwm1 INT flag

    }

    rslvrOut.sineIndex = SineIndexStack ;

    For the FIR coefficient table, keep it 16 entries but repeat 2 sets of 8 cycle values inside so that it will pick the same value regardless of addition of 8 as shown above.

      

  • Ramesh,

    Thanks, this worked perfectly :)

    Btw, is there any chance of getting the source code for the rslvr_algo_float() routine?

  • Glad it worked out.

    Your query reg source code will be answered by someone of us.