A thread for finally figuring out sensorless drive strategies

Line 361 in loopFOC https://github.com/Candas1/Arduino-FOC/blob/accda992e5f56f9c1179e944da764679eab86070/src/BLDCMotor.cpp

1 Like

Yes you found it :stuck_out_tongue_winking_eye:

It’s worth learning how to better use github as well:

  • That’s how I share a reference to a particular line of code
  • here you see the commits of this branch. It’s a bit of a mess because I had to revert some changes
  • this should be a comparison between the dev branch of Simplefoc and my branch
1 Like

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.

1 Like

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.

3 Likes

That looks really cool! I think a sensor class is a good way to add it to the codebase :slight_smile:

1 Like

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?

It’s described here