Hello,
I have questions related to the SFO library to calibrate the HRPWM.
As we are under aeronautical constraints, we can't really integrate a library without knowing what's inside it. I contacted our FAE before Christmas holidays to see if we could get the source code.
However, in the meantime, we ran a dissassembly on the library to try to understand what it does.
Our understanding is the following, please confirm if we are correct:
- The calibration is done with a calibration mechanism which registers are under the EPWM1 peripherals address space.
- The calibration is done on one peripheral at a time (loop).
- A first call is needed to initialize the SFO library variables.
- The HW part of the calibration takes 130000 EPWM cycles and at least 3-4 calls are required to effectively reach the result (one call to start the engine - only for first array element -, one call to configure the calibration multiplexer, one call to wait for completion - this one could require to be called multiple times - and one call to compute and update the data).
- During the calibration, the high resolution is disabled on the given peripheral --> THIS IS NOT STATED IN THE TRM
- The calibration result is written in the HRMSTEP register of the EPWM1 peripheral whatever the calibrated peripheral, meaning that the same value is used for all PWM peripherals where high resolution is active even if they have different resulting MEP scale factor --> THIS IS NOT STATED IN THE TRM
The two last items are more annoying as these are not stated in the TRM and are important to be aware of.
Also, we wonder, would it be better to have a calibration per PWM peripheral ? I guess this could be achieved without using the AUTOCONV and managing ourselves a table of scale factors based on the MEP_scaleFactor variable computed by the SFO function. But it would mean either calling the function with only one element in the EPWM array or detecting a change back of the state machine to the step 2 after a call of the function to monitor the progress on the array and log the scale factor.
Best regards,
Clément
