r/howdidtheycodeit • u/Odd-Estate-2623 • Jan 16 '24
Question How did they code force feedback?
Hello everybody! I am making a steering wheel with ffb. It uses an arduino leonardo as the microcontroller. I am done with the hardware part, but know I don't know how to code the force feedback part. I was using the JoystickFFB library but it has one problem. It's really bad. The force feedback ''curve'' is not linear. It has stronger force feedback towards the middle and has weaker force feedback towards the maximum steering angle. That means when I let go of the wheel for it to self-center, it would overshoot, and then when it tries to self-center again it would overshoot again, and go into a cycle. Now I am trying to code the force feedback myself but I no idea where to start. If anyone could send me some source code or explain it better to me, I would appreciate it!
View all comments
Show parent comment
2
u/ILikeFirmware Jan 17 '24
Yeah lol, solving one PID issue simply by implementing a completely different PID. They were real geniuses for that naming lmao.
Honestly i think he'd be better off changing whatever code is making his device operate the way it is than going the whole custom driver route I wrote about. But if he wants to go that route, it is exciting