Arduino-FOC icon indicating copy to clipboard operation
Arduino-FOC copied to clipboard

Add two linear halls sensor module.

Open XieMaster opened this issue 2 years ago • 2 comments

Hello!

I implemented adding two Linear Halls to run the motor.

Get raw analog value A&B --> filter --> map --> float angle = atan2(hall_filtered_a, hall_filtered_b) * 180 / PI;

Thank you!

XieMaster avatar Jun 24 '22 10:06 XieMaster

Hey @XieMaster, Thanks for the contribution, we will merge this directly I think it a great contribution. However, I'm cannot test it as I do not have the hardware necessary so if someone is interested in testing it I would appreciate the feedback.

Also, I am not sure that I'll have enough time to document the new sensor for the release v2.2.3 so we might wait for the v2.2.4 to add it to the library.

askuric avatar Oct 09 '22 10:10 askuric

I have tested this, and in its current form it doesn't appear to work with anything but 1 pole pair. But if you paste in the electrical revolution tracking from nanoparticle's version, then it does work with my 12N14P motor. The range scaling can be useful to correct for unequal amplitude of sensor signals if they're not placed perfectly, but I think for speed and code size I prefer nanoparticle's version simplefoc/Arduino-FOC-drivers#12 which only subtracts the center value. Better to correct any amplitude difference by physical placement of the sensors.

dekutree64 avatar Dec 07 '23 23:12 dekutree64