Line 361 in loopFOC https://github.com/Candas1/Arduino-FOC/blob/accda992e5f56f9c1179e944da764679eab86070/src/BLDCMotor.cpp
Yes you found it
It’s worth learning how to better use github as well:
Ok, I will try to see if I can get it into a single function that is contained and independent, then try to calculate/measure the flux linkage for my motor, and see if I can get it to give me information and see how it compares with the info from the angle sensor.
Why do you need to change anything ?
You already have access to motor.eletrical_angle and motor.sensorless_electrical_angle…
This is not meant to be the final version, just to prove it works.
Ok, sounds good. I can try that then. I have my hardware and fan set up still.
Make sure you use a power supply.
I sometimes managed to enter a kind of resonance state even at 0 torque when turning the motor by hand.
My power supply went to constant current mode (0.4A).
With the advices from @dekutree64 and the help from charizardrekt on discord, I am experimenting with a sensor for flux observer, but please don’t use it, it still needs few fixes and changes in SimpleFOC to work. It will require refactoring in Sfoc also to avoid redundant code as it does the clarke transform.
That looks really cool! I think a sensor class is a good way to add it to the codebase
It might take me a while to try this, but it’s definitely on my list of things to do!
What kind of IDE or Debugger are you using to display these real-time graphs of variables of you code?