I just started using SimpleFOC a short while ago… so first of all many thanks! Amazing work!!
Still, I believe that there is an issue with the PWM angle / velocity reading in MagneticSensorPWM.
My setup is as follows:
-> Gimble Motor with integrated AS5048A, that I would like to use with PWM-based output
-> Arduino Uno, PWM connected to DigitalPin2
-> Running the “find_raw_min_max example”
The Sensor seems to be fine, checked with an scope and I am getting a nice PWM Signal between ~5us and ~920us with a magnitude of 3.3V:
In init everything is calculated correctly, then it doesnt update the values in the loop:
I am unfortunately not a programming pro, hope for some hints
What I found is:
-> is_interrupt_based is correctly set to true
-> So I guess “pulse_length_us” is calculated in doPWM since it shall be interrupt based…getRawCount() only returns it since the if-statement is skipped.