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.
- download ffb report
- force calculator:
+ constant force
+ ramp force
B. Todo
- force calculator
+condition effect:
According to this page:
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:
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.
GitHub - hoantv/VNPedal: Pedal uses multiple load cells
Pedal uses multiple load cells. Contribute to hoantv/VNPedal development by creating an account on GitHub.
github.com
GitHub - hoantv/VNWheel: Opensource FFB Wheel
Opensource FFB Wheel. Contribute to hoantv/VNWheel development by creating an account on GitHub.
github.com
- pc recognized it as ffb device.
- read increment encoder w/wo Z index upto 32 bit, calculate velocity, acceleration of axis.
- download ffb report
- force calculator:
+ constant force
+ ramp force
B. Todo
- force calculator
+condition effect:
According to this page:
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: