[DIY] USB Force Feedback Controller

U

User 22237

after optimize, here is the log test and log test 2 results compare to MMOS with same hardware. it is same result with mmos.
https://youtu.be/w_jKZw3ujMc
Anhang anzeigen 82877 Anhang anzeigen 82878


Damn hoantv, this looks really promissing. Really like the direction this is going. Wish I could help with some code testing, but at the moment I am waaaaay too green in coding to offer any usable help.
you can help me by testing the firmware :).
here is video I tested on ets2.
https://youtu.be/RpCJnq8G1h4

sorry for the vertical video.

There are many tasks to do:
- add filter
- test each effects one by one
- add config gain for each effect, total.
- GUI
 
U

User 22237

These firmware is for testing. Currently I haven't made GUI. I hardcode some:


  • Gain total = 30%
  • gain for each effect is 100%.
  • PWM mode is H-Brigde (PE9, PE11)
  • metric for conditional effect (damper, interia, friction)
based on your encoder choose correcponding to firmware
Please report issuses i will solve them as soon as possible.
I will find the way to create GUI and log report from STM32. currently I dont know how to made this :(.

https://github.com/hoantv/CarSimulatorFirmware
 
Zuletzt bearbeitet:
U

User 22542

Hallo, ich habe ein Reimer Motorsport osw mit einem 30 nm kollmorgen servo ergattern können. Ich bin in der osw Sparte relativ neu deswegen bräuchte ich Hilfe:
Das osw läuft nur über mmos was auch eigentlich funktioniert, zumindest habe ich ffb. Zwar nicht wirklich brauchbar aber es ist da.
Jetzt habe ich gesehen dass die Grundeinstellung nicht ausgefüllt sind. Was kommen den da für zahlen rein? Leider habe ich über Google oder sufu nur verschiedene Sachen gelesen, z.b kommen da bei einem 20000 als Zahl rein bei einem anderen 40000. aber das war dann für einen mige ? Oder simucube? Assetto Corsa zeigt mir aber Argon an? Stimmt das?
ich habe mich daran probiert mit Ergebnis das das Wheel versucht hat meine Daumen zu amputieren.
Ich wäre über jede Hilfe dankbar!
Liebe Grüße


Gesendet von iPhone mit Tapatalk
 
U

User 23633

I have one question regarding the STM32 Discovery boards, I managed to get 3 of the F4291 Discoveries for free (a few pins not working, otherwise board is working fine, at least appears to be) and if a flash it with MMOS or HoanTV's version, it just doesn't get recognized by PC as game controller. Any ideas why is that so?
 
U

User 22237

I have one question regarding the STM32 Discovery boards, I managed to get 3 of the F4291 Discoveries for free (a few pins not working, otherwise board is working fine, at least appears to be) and if a flash it with MMOS or HoanTV's version, it just doesn't get recognized by PC as game controller. Any ideas why is that so?
I think you can not used stm32’ hex. They are different artchitechture. Try stm32f407vet for chip. After finish stm32 f407 i will release on new chip. May be teensy 4.0 or stm32 newer and stronger stm32f407.
Here video i test with AC. Im not good racer, special with h pattern shifter ( i am learning). Everythinh is good ( my encoder have a problem, it is not tighten with the wheel rod. So some time wheel position is wrong. After i use glue, the problem is solved. Firmware work with cycle test at maximum torque without error and position deviance.
https://youtu.be/aMWORnRhG1s
 
Zuletzt bearbeitet:
U

User 22542

Hallo,
Ich versuche die Frage noch einmal, da ich bis jetzt nichts gefunden habe und ich meine erste Frage zu ausschweifend gestellt habe.
Kann mir bitte jemand sagen was bei einem Argon mit einem großen kollmorgen servo hier rein kommt? Oder muss da gar nichts rein? Die Parameter die hier drin stehen habe ich aufgrund diverser suchen eingetragen sind aber glaube ich nicht für einen Argon bestimmt. Und für was steht das überhaupt?
Vielen Dank schon mal!
306cb8e7baad831a5d3bea7ca31c5d41.jpg



Gesendet von iPhone mit Tapatalk
 
U

User 11065

schick mal ein Bild von der Servo Nummer, bzw dessen Typenschild, dann kann ich dir sagen, welche CPR eingetragen werden müssen.
PWM Frequenz sind 3,4khz oder 4,2khz (ausprobieren)
PWM Modus ist PWM&Dir
Indes auswerten mit haken, sonst nichts
Analogachsen abschalten, ebenso wie Tasten 1-16
Habs gerade selber heraus gefunden: es sind 40000CPR für den Kollmorgen.

Die weiteren "Grundeinstellungen" die immer verwendet wurden kommen auch gleich, muss erst herausfinden, warum mein STM32 hier am Rechner nicht läuft
 
Zuletzt bearbeitet:
U

User 22237

I 've tested. It can use HID send report to config firmware. there is 2 type of config.

this is used for hardware setup, need reset STM32

typedef struct { // Setup Report
uint8_t reportId; // =20
uint32_t encoderCPR;
uint32_t encoderIndex;
uint32_t encoderReverse;
uint8_t pwmMode;
uint8_t pwmFrequency;
} __attribute__((packed)) USB_Setup_Report;


This is used for wheel setup on flying

typedef struct { // Setup Report
uint8_t reportId; // =20
uint8_t resetWheelPostion; // =20
uint16_t maxWheelAngle;
uint16_t minForce;
uint16_t maxForce;
uint16_t constantGain;
uint16_t rampGain;
uint16_t squareGain;
uint16_t sineGain;
uint16_t triangleGain;
uint16_t sawtoothDownGain;
uint16_t sawtoothUpGain;
uint16_t springGain;
uint16_t damperGain;
uint16_t inertiaGain;
uint16_t frictionGain;
} __attribute__((packed)) USB_Config_Report;
maybe more like filter factor, pid factor,...
do you recommend some things else?
 
Zuletzt bearbeitet:
U

User 16612

I 've tested. It can use HID send report to config firmware. there is 2 type of config.

this is used for hardware setup, need reset STM32

typedef struct { // Setup Report
uint8_t reportId; // =20
uint32_t encoderCPR;
uint32_t encoderIndex;
uint32_t encoderReverse;
uint8_t pwmMode;
uint8_t pwmFrequency;
} __attribute__((packed)) USB_Setup_Report;


This is used for wheel setup on flying

typedef struct { // Setup Report
uint8_t reportId; // =20
uint8_t resetWheelPostion; // =20
uint16_t maxWheelAngle;
uint16_t minForce;
uint16_t maxForce;
uint16_t constantGain;
uint16_t rampGain;
uint16_t squareGain;
uint16_t sineGain;
uint16_t triangleGain;
uint16_t sawtoothDownGain;
uint16_t sawtoothUpGain;
uint16_t springGain;
uint16_t damperGain;
uint16_t inertiaGain;
uint16_t frictionGain;
} __attribute__((packed)) USB_Config_Report;
maybe more like filter factor, pid factor,...
do you recommend some things else?


I am following your project with great enthusiasm, I understand that the pinout is the same that the mmos firmware uses.
In the firmware version that you have posted on github, I see that you indicate that it uses the PE9 and PE11 pins for PWM mode in H-Brigde, do you plan to implement output in PWM & DIR mode and 16.8khz?
 
U

User 22237

I 've tested. It can use HID send report to config firmware. there is 2 type of config.

this is used for hardware setup, need reset STM32

typedef struct { // Setup Report
uint8_t reportId; // =20
uint32_t encoderCPR;
uint32_t encoderIndex;
uint32_t encoderReverse;
uint8_t pwmMode;
uint8_t pwmFrequency;
} __attribute__((packed)) USB_Setup_Report;


This is used for wheel setup on flying

typedef struct { // Setup Report
uint8_t reportId; // =20
uint8_t resetWheelPostion; // =20
uint16_t maxWheelAngle;
uint16_t minForce;
uint16_t maxForce;
uint16_t constantGain;
uint16_t rampGain;
uint16_t squareGain;
uint16_t sineGain;
uint16_t triangleGain;
uint16_t sawtoothDownGain;
uint16_t sawtoothUpGain;
uint16_t springGain;
uint16_t damperGain;
uint16_t inertiaGain;
uint16_t frictionGain;
} __attribute__((packed)) USB_Config_Report;
maybe more like filter factor, pid factor,...
do you recommend some things else?


I am following your project with great enthusiasm, I understand that the pinout is the same that the mmos firmware uses.
In the firmware version that you have posted on github, I see that you indicate that it uses the PE9 and PE11 pins for PWM mode in H-Brigde, do you plan to implement output in PWM & DIR mode and 16.8khz?
yes. I will do all things that mmos has. I will add some:
- encoder absolute, sending real encoder position to PC without reducing to 65535 16 bit axis.
- add more effects than MMOS.
- add loadcell (1 or 3 load cell based on configurations)
- shifter (maybe ffb shifter later)
- wheel
- dashboard
- iffb
If stm32f4 is not enough i will move to other stronger.
about pwm: which differences between pwm modes? I dont know, my DD and belt puly base use hbrigde (belt version is for development, DD is too dangerous :d.
p/s: i need another driver to replace bts7960. Could any one recommend for me which is better (any pwm mode)!
 
Zuletzt bearbeitet:
U

User 16612

about pwm: which differences between pwm modes? I dont know, my DD and belt puly base use hbrigde (belt version is for development, DD is too dangerous :d.
p/s: i need another driver to replace bts7960. Could any one recommend for me which is better (any pwm mode)!

The difference is simple, h-bridge uses two pins, for example if you want to rotate in one direction you put PE9 in low or PWM = 0% and PE11 with a PWM of 50% if you want it to rotate in the opposite direction PE9 PWM = 50% and PE11 PWM = 0%
In DIR & PWM mode the PE11 pin is used to indicate the direction of rotation, low for one direction, high for the opposite direction. and the 16.8khz is the PWM update frequency, this is the standard of practically all servo motor drivers, I consider the implementation is very important to give an alternative to those who use MMOS for not having simucube compatible hardware.

For load cells if you plan to use the HX711 driver it has a lot of delay, I would rule it out, much better to use a differential amplifier, which in the end gives you an analog signal like the one a traditional potentiometer gives, and you don't need to implement specific code.

the ffb for the shifter sounds great, but the question is is this command controlled by any game?
 
U

User 22237

The difference is simple, h-bridge uses two pins, for example if you want to rotate in one direction you put PE9 in low or PWM = 0% and PE11 with a PWM of 50% if you want it to rotate in the opposite direction PE9 PWM = 50% and PE11 PWM = 0%
In DIR & PWM mode the PE11 pin is used to indicate the direction of rotation, low for one direction, high for the opposite direction. and the 16.8khz is the PWM update frequency, this is the standard of practically all servo motor drivers, I consider the implementation is very important to give an alternative to those who use MMOS for not having simucube compatible hardware.

For load cells if you plan to use the HX711 driver it has a lot of delay, I would rule it out, much better to use a differential amplifier, which in the end gives you an analog signal like the one a traditional potentiometer gives, and you don't need to implement specific code.

the ffb for the shifter sounds great, but the question is is this command controlled by any game?

I mean about the performance? which is better. If I used Pul/Dir for DC motor? which can a driver replace my broken BTS7960?

About loadcell, I dont use hx711, I will used INA122 with 120khz ( (purchased,not test yet. but HX711 enable 80hz it is fast too).
ffb for the shifter => I think I will use telemetry to collect information about speed, clutch value to make ffb.
 
U

User 16612

I mean about the performance? which is better. If I used Pul/Dir for DC motor? which can a driver replace my broken BTS7960?
The performance is the same, it is simply for compatibility, I do not use a DC motor, so I ask you if you could implement the DIR & PWM output, if you do it you would make me very happy.
About the driver, a long time ago they spoke well of the SparkFun Monster Moto Shield, people used this and the IBT-2, which I suppose will be the one that has been broken, there are people who use several in parallel to hold more current, the IBT-2 is cheap but there are many copies and some do not work well.
 
U

User 22237

I mean about the performance? which is better. If I used Pul/Dir for DC motor? which can a driver replace my broken BTS7960?
The performance is the same, it is simply for compatibility, I do not use a DC motor, so I ask you if you could implement the DIR & PWM output, if you do it you would make me very happy.
About the driver, a long time ago they spoke well of the SparkFun Monster Moto Shield, people used this and the IBT-2, which I suppose will be the one that has been broken, there are people who use several in parallel to hold more current, the IBT-2 is cheap but there are many copies and some do not work well.
I will sent you a hex file with pul/dir if you can test. Send me your wheel parameters:
- encoder ppr
- max torque you use
I dont have pul/dir driver for test. So i need clearify some things i dont know.
1st: i saw pul/dir has 2 type: pul/dir and pul+-/dir+-. What is difference?
2nd: implement pul/dir, PE 9 is for pulse, PE 11 for dir. PE 9 is for value of dutycycle, which pin 11 value for CW (high or low)?
3nd: pul+-, dir+-, it need 4 pins in stm32. I dont know how to set value for pin 9,10,11,12.
 
U

User 16612

I mean about the performance? which is better. If I used Pul/Dir for DC motor? which can a driver replace my broken BTS7960?
The performance is the same, it is simply for compatibility, I do not use a DC motor, so I ask you if you could implement the DIR & PWM output, if you do it you would make me very happy.
About the driver, a long time ago they spoke well of the SparkFun Monster Moto Shield, people used this and the IBT-2, which I suppose will be the one that has been broken, there are people who use several in parallel to hold more current, the IBT-2 is cheap but there are many copies and some do not work well.
I will sent you a hex file with pul/dir if you can test. Send me your wheel parameters:
- encoder ppr
- max torque you use
I dont have pul/dir driver for test. So i need clearify some things i dont know.
1st: i saw pul/dir has 2 type: pul/dir and pul+-/dir+-. What is difference?
2nd: implement pul/dir, PE 9 is for pulse, PE 11 for dir. PE 9 is for value of dutycycle, which pin 11 value for CW (high or low)?
3nd: pul+-, dir+-, it need 4 pins in stm32. I dont know how to set value for pin 9,10,11,12.

I send you an mp
 
U

User 22237

I mean about the performance? which is better. If I used Pul/Dir for DC motor? which can a driver replace my broken BTS7960?
The performance is the same, it is simply for compatibility, I do not use a DC motor, so I ask you if you could implement the DIR & PWM output, if you do it you would make me very happy.
About the driver, a long time ago they spoke well of the SparkFun Monster Moto Shield, people used this and the IBT-2, which I suppose will be the one that has been broken, there are people who use several in parallel to hold more current, the IBT-2 is cheap but there are many copies and some do not work well.
I will sent you a hex file with pul/dir if you can test. Send me your wheel parameters:
- encoder ppr
- max torque you use
I dont have pul/dir driver for test. So i need clearify some things i dont know.
1st: i saw pul/dir has 2 type: pul/dir and pul+-/dir+-. What is difference?
2nd: implement pul/dir, PE 9 is for pulse, PE 11 for dir. PE 9 is for value of dutycycle, which pin 11 value for CW (high or low)?
3nd: pul+-, dir+-, it need 4 pins in stm32. I dont know how to set value for pin 9,10,11,12.

I send you an mp
done. check my repo in github.
 
Oben