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.

What do hardware and software decimation mean?

sir/madam,

In the page 10 of 《qsg_gui_instaspin_foc》,there are lines as following:

In higher PWM applications where the current control rate will run slower anyways (to allow the control system to run on < 100 MHz MCUs) the ADC can be decimated by using the Piccolo ePWM ADC SOC hardware (recommended), or through the user.h software decimation.

What do hardware and software decimation mean?

thank you very much.

  • hardware decimation means that you use the ePWM peripheral hardware feature which can allow the ADC start of conversion to be fired every 1, 2, or 3rd event.

    So it your PWM is (45) KHz and you use

    #define USER_NUM_PWM_TICKS_PER_ISR_TICK        (3)

    the _ISR_TICK become 45 / 3 = 15 KHz

    and then this 15 KHz _ISR_TICK can then be further decimated by software, meaning a simple software counter is used to decide if the next level of control should be executed every time, every 2nd, 3rd, etc.

    see chapter 8.3.1 of SPRUHJ1 for a diagram

  • Thank you,ChrisClearman!

    The lines recommands the hardware decimation rather than the user.h software decimation.It  implies that the hardware decimation and the hardware decimation are different.so what is the user.h software decimation?

    In my opinion,they are the same.

     

  • they are not the same

    as I explained above, the hardware decimation uses a feature of the peripheral to delay the ADC SOC

    software decimation uses a standard software timer / counter INSIDE the interrupt to delay execution of an inner control loop.

    it is always preferred to minimize the use of software timers inside of interrupts

  • I have understood the definition of the hardware decimation.

    But I think software decimation is not in the user.h file,but in other source files,and the hardware decimation is set in user.h.

    Right?

  • there is only 1 HW decimation and it is set by

    #define USER_NUM_PWM_TICKS_PER_ISR_TICK        (3)

    all of the other _TICK settings in user.h are for software

    this is explained in the chapter of SPRUHJ1 I mentioned above

  • Thank you!!!

    :  )