mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
fix(volant): corriger l'echelle deltaMax a 31600 pour correspondre aux 120 degres reels
This commit is contained in:
1 parent
c791f8531c
commit
8977b9413c
1 file changed
+7
-5
+7
-5
@@ -51,7 +51,7 @@ const uint16_t GAZ_AVANT_MAX_PAR_VITESSE[3] = {
|
||||
#define DEADZONE_PEDALE 800
|
||||
|
||||
// Configuration par défaut du volant G29
|
||||
#define CENTRE_VOLANT_BRUT 32528
|
||||
#define CENTRE_VOLANT_BRUT 32768
|
||||
#define ANGLE_MAX_VOLANT_G29 900.0f
|
||||
#define ANGLE_DEFAUT_TOTAL 240.0f // Plage totale par defaut : 240 degres (+/- 120 degres)
|
||||
#define EXPO_DEFAUT 0.25f // 0.0f = Lineaire, 0.25f = Doux au centre (FPU RP2350)
|
||||
@@ -87,7 +87,9 @@ volatile ConfigG29 configSysteme;
|
||||
volatile int32_t maxDeltaVolant = 0;
|
||||
|
||||
void recalculerParametresVolant() {
|
||||
maxDeltaVolant = (int32_t)(((float)configSysteme.angleSouhaiteTotal / 2.0f) * (65535.0f / ANGLE_MAX_VOLANT_G29));
|
||||
// Le G29 en mode PS4 redistribue ses 65535 points (16-bit) sur toute la plage configurée par cmdRange (240°).
|
||||
// La butée logicielle démarre à ~116° (sur les 120° de demi-course), soit environ 31600 points du centre.
|
||||
maxDeltaVolant = 31600;
|
||||
}
|
||||
|
||||
// Boîte séquentielle : -1 = R, 0 = N (Point Mort), 1 = 1ère, 2 = 2ème, 3 = 3ème
|
||||
@@ -731,8 +733,8 @@ void gererVibrationHaptique() {
|
||||
|
||||
// Calcul du mur de butée active (Active Soft Stop FFB à +/- 120° avec hystérésis)
|
||||
int32_t posCentre = dernierVolantCentre;
|
||||
int32_t deltaMax = (maxDeltaVolant > 0) ? maxDeltaVolant : 8738;
|
||||
const int32_t HYSTERESIS_MUR = 120; // ~1.6° de marge pour repousser franchement sans osciller
|
||||
int32_t deltaMax = (maxDeltaVolant > 0) ? maxDeltaVolant : 31600;
|
||||
const int32_t HYSTERESIS_MUR = 450; // ~1.6° de marge pour repousser franchement sans osciller
|
||||
float forceButee = 0.0f;
|
||||
|
||||
// Machine à états pour la butée droite (> +120°)
|
||||
@@ -1108,7 +1110,7 @@ void __not_in_flash_func(tuh_hid_report_received_cb)(uint8_t dev_addr, uint8_t i
|
||||
|
||||
int32_t volantCentre = (int32_t)volantRaw - CENTRE_VOLANT_BRUT;
|
||||
dernierVolantCentre = volantCentre;
|
||||
int32_t deltaMax = (maxDeltaVolant > 0) ? maxDeltaVolant : 8738;
|
||||
int32_t deltaMax = (maxDeltaVolant > 0) ? maxDeltaVolant : 31600;
|
||||
int32_t volantBorne = constrain(volantCentre, -deltaMax, deltaMax);
|
||||
|
||||
float x = (float)volantBorne / (float)deltaMax;
|
||||
|
||||
Reference in new issue
Block a user