SPRUHJ1I January 2013 – October 2021 TMS320F2802-Q1 , TMS320F28026-Q1 , TMS320F28026F , TMS320F28027-Q1 , TMS320F28027F , TMS320F28027F-Q1 , TMS320F28052-Q1 , TMS320F28052F , TMS320F28052F-Q1 , TMS320F28052M , TMS320F28052M-Q1 , TMS320F28054-Q1 , TMS320F28054F , TMS320F28054F-Q1 , TMS320F28054M , TMS320F28054M-Q1 , TMS320F2806-Q1 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1
Decimation rates allow the user to configure each loop rate to meet their code execution requirements. It is recommended to use the default decimation rates as a starting point. The user must verify real-time scheduling is met, verifying that a single interrupt period allows execution of all software in the ISR. This can be done by simply toggling (2) GPIO pins, one at the start and the other at the end of the ISR, and observing on an oscilloscope. If real-time scheduling is not met then InstaSPIN performance is not predictable.
Real-time scheduling is required for consistent InstaSPIN performance.
Following are the default decimation rates:
// Defines the number of pwm clock ticks per isr clock tick
// Note: Valid values are 1, 2 or 3 only
#define USER_NUM_PWM_TICKS_PER_ISR_TICK (1)
// Defines the number of isr ticks (hardware) per controller clock tick (software)
#define USER_NUM_ISR_TICKS_PER_CTRL_TICK (1)
// Defines the number of controller clock ticks per estimator clock tick
#define USER_NUM_CTRL_TICKS_PER_EST_TICK (1)
// Defines the number of controller clock ticks per current controller clock tick
#define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK (1)
// Defines the number of controller clock ticks per speed controller clock tick
#define USER_NUM_CTRL_TICKS_PER_SPEED_TICK (10)
// Defines the number of controller clock ticks per trajectory clock tick
#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (10)
If the interrupt period does not allow these decimation rates to complete, see Section 10.1 to learn more about changing the decimation rates.