# Need support about firmwares for ffb wheel and 3 pedal loadcell

#### HoanTV

##### 1RPM
I am making opensource firmware for ffb wheel and 3 loadcell pedal. i code for arduino 1st. I have not much time, no need helps to finish them soon.
1. 3 Loadcell pedal for arduino pro micro: finished, it works well.
I will add button for shifter and make vibration for pedal or even shifter.
2. Ffbwheel for arduino leonardo
A. Finished
- pc recognized it as ffb device.
- read increment encoder w/wo Z index upto 32 bit, calculate velocity, acceleration of axis.
- force calculator:
+ constant force
+ ramp force
B. Todo
- force calculator
+condition effect:

https://developer.apple.com/documentation/forcefeedback/ffcondition?changes=__8&language=objc

depend on Effectype, metric is one of these:

spring - exerts a force proportional to the displacement

damper - exerts a force proportional to the position velocity

inertia - exerts a force proportional to the position acceleration

friction - exerts a constant force when the position is changing

if metric < cpOffset - deadBand

force = (metric - (cpOffset - deadBand)) * negativeCoefficient;

else if metric > (cpOffset + deadBand)

force = (metric -(cpOffset + deadBand)) * positiveCoefficient;

Because metric value is in [-1.0,1.0] so need normalize it.

string: metric=(currentPositionEncoder/encoderRange) => OK

friction: metric = (currentPositionEncoder- lastPositionEncoder)/encoderRange => OK

I don't have idea for damper and inertia, how to normalize currentVelocity and acceleration.

currentVelocity = (currentPositionEncoder- oldPositionEncoder)/(currentTimeInMillis - lastTimeInMillis) => metric = ??

acceleration = (currentVelocity-lastVelocity)/(currentTimeInMillis - lastTimeInMillis) => metric = ??
+ periodic effect: not yet investigated.
- pwm: use analogwrite(pin, force)
- UI config: not yet investigated
After finished all for arduino, i will make code for stm32 later if it work well !
If anyone is interested in this project, pls join to finish it soon.
Video test pedal:

Last edited:

#### HoanTV

##### 1RPM
A.Update:
1. Wheel
- calculated periodic effect
- made pwm via pin 5,6 with 2 mode pulse/dir and pwm +/-
2. Pedal
B. Todo:
1. Wheel
- caculate force for damper/interia effect
- apply gain from UI config
- UI config
2. Pedal
- add force feed back for shifter.

fate0048

#### HoanTV

##### 1RPM
Updated:
Force feedback testing with Wheelcheck . Still missing effect about damper, inetria.

Sieben and fate0048

#### pastranario3

##### 75RPM
Hi, what kind of arduino have you used with load cells pedal? Arduino Uno or Arduino Pro Micro?

#### HoanTV

##### 1RPM
Hi, what kind of arduino have you used with load cells pedal? Arduino Uno or Arduino Pro Micro?

Testing shifter:

Sieben

#### diego.viejo

##### 1RPM
Hi Hoan,
Nice work!
I would like to help you with this project (NVWheel mainly). I already downloaded your firmware from github and compiled it successfully. Then I tried to run it on an Leonardo just to test it. It is detected as a game controler FFB capable but when I connect a rotary encoder to it... nothing happens.
I'm not sure whether I connected the encoder incorrectly. ¿Do you have a schema showing connections? It would be very helpful.
Thanks

#### HoanTV

##### 1RPM
Hi Hoan,
Nice work!
I would like to help you with this project (NVWheel mainly). I already downloaded your firmware from github and compiled it successfully. Then I tried to run it on an Leonardo just to test it. It is detected as a game controler FFB capable but when I connect a rotary encoder to it... nothing happens.
I'm not sure whether I connected the encoder incorrectly. ¿Do you have a schema showing connections? It would be very helpful.
Thanks
Encoder use pin 0,1. If encoder has z phase connect z to pin 2.
Pin 9, 10 for pwm.
Currently it worked.
I am trying to code for stm32 too (still continue arduino for future teensy 4). Test receive ffb report on stm32:

#### yolaw

##### 1RPM
Hi,thanks for your coding,I make my own ffb Wheel recently too! And what's the application you operated in windows? I want to use it to test the HID_PID communication about PC and Arduino.

#### rosciio

##### 1RPM
Hello
Im' trying to use your firmware.
I have used WheelConfig and I can't see firmware version. what kind of another software I need?

Thanks Marco