ranenbg / Arduino-FFB-wheel

Stand alone directInput USB device recognized in Windows as a joystick with force feedback functionality, based on BRWheel by Fernando Igor from 2017.
147 stars 20 forks source link

AS5600 Magnetic Encoder #64

Open joeyda opened 1 week ago

joeyda commented 1 week ago

Hi, I have a brushless motor with an AS5600 magnetic encoder and an arduino pro micro, is it possible to work with your firmware using i2c?

ranenbg commented 1 week ago

Hi, I was thinking about this one some years ago, it's a nice suggestion, tnx. At the moment AS5600 is not supported natively via i2C in my firmware. I have no plans to implement its support any time soon. It is used mostly for digitizing pots, knobs or basic angle readout, but it may be usable for ffb wheel also. I'm not really sure.

You do know that you can't use bts7960 with a 3 phase bldc motor? What motor driver do you plan to use? If I'm not mistaken, AS5600 can be configured to output quadrature signals? If so, you could use it in the same way as optical encoder in my firmware, but not without bldc motor driver.

It seems to me that it's just not worth the effort, as this is pretty much the way to the direct drive rabbit hole. However, others have implemented it via i2C in their arduino ffb firmware, you may want to lookup valasko's firmware. You may get some ideas and manage to add it to my firmware yourself, it's not that difficuilt. I think in thrustmaster T300 they use some variation of this sensor with a bldc motor, but they have a special motor driver with current sensing and FOC (field oriented control) algorithm. Without such motor driver, to me it makes no sense to use this sensor with a bldc motor. Coupled with bts7960 and a dc motor, it is reasonable to try to use it.. (see valasko's github).

joeyda commented 1 week ago

Good to know, thank you!On Sep 2, 2024, at 12:36 AM, Miloš Ranković @.***> wrote: Hi, at the moment AS5600 is not supported in my firmware. I have no plans to implement its support in my firmware, as this type of encoders is not suitable for the ffb wheel due to not good enough response, speed, resolution and noise level. It is used mostly for digitizing pots, knobs or basic angle readout.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

joeyda commented 1 week ago

Thank you for the additional info. I was looking into making a small handheld wheel with a brushless gimbal motor since they are so quiet and tiny. I have a motor driver and was going to use simple FOC to control it

Just tried out https://github.com/vsulako/AFFBWheel and some initial testing it was able to pick up the encoder rotation

jairov96 commented 1 week ago

Hello,

just I'm also trying to use your firmware with an AS5600. I'm trying to build something like this but with FFB for Farming/eurotruck/Beamng: https://www.youtube.com/watch?v=7g6O4G1OXd4

Cheers

ranenbg commented 5 days ago

Yes, I see why you want AS5600 in the controller like this it is more convenient due to the small space, but I still think an optical encoder is far superior. It will have higher resolution, no noise at all, and instant reaction speed plus you can easily add some gears to it, add a DC motor and a small h-bridge like L298N and you're good to go.

I'll have a look at vsulako's code to get some ideas on how he implemented AS5600 but I'm not promising anything as there may not be enough memory to implement that in my firmware without significant cuts.

ranenbg commented 4 days ago

After digging a little deeper, it seems that there is enough memory left for implementing support for AS5600. I'm working on that currently and if all goes as expected, I'll probably release in the near future a new firmware version v240 with support for this magnetic angle sensor. Tnx for suggestion.

jairov96 commented 4 days ago

That's dope, thank you very much!

Anywhere I can donate/buy a coffee to the cause?

ranenbg commented 4 days ago

You're welcome. I still have to do some testing, but if you wish to donate there is my paypal in the GUI near bottom part of window.