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.
135 stars 19 forks source link

Problem with the pedals #56

Closed MatteoDav2607 closed 2 weeks ago

MatteoDav2607 commented 3 weeks ago

I only have 2 pedals and the remaining 2 free axles flicker continuously. How can I disable them?

ranenbg commented 3 weeks ago

Hi, you can not disable the unused axis, but you can still prevent flickering. This is noise on the floating unconnected inputs and it's normal.

You should connect all unused arduino analog inputs to gnd (0V). Then use manual calibration for pedals in GUI. You just need to raise the lower callibration limit of each unused axis until it is just slightly above the zero level, if it's not already at 0 and staying there.

MatteoDav2607 commented 3 weeks ago

I did this and solved the problem with the unused axes, but the 2 that are needed continue to flicker. what could I do?

ranenbg commented 3 weeks ago

This is quite tricky to solve completely, as there are several sources of noise in analog inputs:

[1] Analog to digital (ADC) conversion noise in arduino, that depends on the ADC settings. I'm using default settings, so +-1 step out of 1023, is normal noise.

[2] Unshielded cables or dirty pots. It is recommended to use shielded cables for all pots. You can use an usb cable wire, it has an outer shield plus 4 more wires inside, so you can use one such cable for up to 3 pots, where shield is gnd. For dirty pots I just spray WD40 which helps to get all the dirt out and sligthly lubricate it. This source of noise can be up to about +-10steps out of 1023.

[3] Electromagnetic interferrence - if you have unshielded wires that cary high amps with a pulsing or AC voltage close to your sensitive analog signal wires, this can create a lot of noise +-50 steps or more. Good practices are to twist motor wires, and move away any wires with 220V 50Hz AC. Shielding and earthing all sensitive analog parts, including enclosing arduino in a metal box. One should also avoid making ground loops, so basicaly you want all gnd wires connected in a star like pattern, where the middle part will be earthed at a wall socket earth plug. Take into account that you PC is already earthed and that gnd of usb port can act as this earthing point.