PWM blocks with two different switching frequencies

Hi Sachith,

Overall the speed/position decoding approach you’re using is unclear which is something you must develop. How is the excitation signal being generated? Are these the decoded sin/cos values or is the excitation super imposed? How does the derivative block relate to your implementation for resolver speed sensing? If the derivative senses the angle derivative, how will it handle rollovers and reversals?

I can provide the following guidance:

  • It would be helpful to have an equivalent offline model of your resolver circuit. That way you can test your algorithm directly. We do not have the hardware to recreate your observations.
  • When using the integrator blocks for code generation you should use integrator wrapping and limits where applicable. For example, the integrator you’re using as a clock generator will lose precision as the floating point number grows large. Set it to wrapping.
  • Derivative implementations are extremely sensitive to noise. One approach we take in the PID controller block is to set a cutoff frequency for the derivative calculation. You can use a transfer function block to implement a s/(s/kf+1) where kf sets the cutoff frequency. However, this won’t handle rollover which you may require a C-Script for.

Hope that helps!