| Prochaine révision | Révision précédente |
| projets:tondeuse [2026/05/26 17:09] – créée chef | projets:tondeuse [2026/05/29 17:39] (Version actuelle) – [Conception] chef |
|---|
| ====== Tondeuse Télécommandé a base d'HoverBoard ====== | ====== Tondeuse Télécommandé a base d'HoverBoard ====== |
| |
| | ===== Description ===== |
| | Mon projet consiste a hacker des hoverboard pour les utiliser en moteurs piloté par une RC.\\ |
| | Exemple : https://www.youtube.com/watch?v=eUR2SnJFujk \\ |
| | Des hoverboard d'occasions se trouvent facilement, mais comme moi je vais dans de la pelouse, j'ai recherché des hoverboard avec des grandes roues (8.5")\\ |
| | Sinon on peu aussi prendre des HB (hovreboard) avec des roues de 6,5" puis changer les pneus avec des 200x50. |
| |
| Programmation | Donc je vais partir de 2 HB hacké pour avoir 4 roues motrices, fixé sur une planche, puis un moteur qui entraîne la lame de coupe.\\ |
| | L'avantage du hack est que l'on a les batteries avec (46V), mais pour la lame de coupe j'ai acheté un moteur 50W 24V, il me faudra faire un pack de batterie.\\ |
| | Il faut une télécommande RC avec son récepteur, j'ai trouvé une promo d'un modèle qui tiens dans une main. Mais le récepteur ne peut que faire du PWM, si c'était a refaire, je prendrais un récepteur qui soit en PPM.\\ |
| | Ensuite l'électronique se réduit aux connecteurs, Inter coup de poing et peut être une indication de charge des accus.\\ |
| | La mécanique reste le gros morceau, une imp 3D peut aider pour les fixations des moteurs et autres supports. |
| | |
| | ===== Matos ===== |
| | 2x hoverboard d'occas. |
| | 1x moteur de coupe. (soit récup sur trottinette ou achat) |
| | 1x RC avec récepteur |
| | Pack de batterie a base de 18650 (ou pas si récup) |
| | Connecteurs divers |
| | Inter coup de poing |
| | |
| | ===== Conception ===== |
| | |
| | Pour me faire une idée de la bête voici un dessin onshape.\\ |
| | Pour l'instant, une planche avec des support pour les moteurs, les cartes et batteries seront sur la planche.\\ |
| | Reste a trouver un mécanisme pour pouvoir régler la hauteur de la lame de coupe.\\ |
| | |
| | {{:projets:fichiers:assembly_1.png?600|}} |
| | |
| | |
| | Pour Connecter le récepteur RC à la carte mère on prendra le dernier connecteur en bas à gauche.\\ |
| | De gauche à droite on a :\\ |
| | 15V (coupé) 5V sur la carte -> V+ |
| | PA2 PWM1 -> CH1 (gaz) |
| | PA2 PWM2 -> CH2 (direction) |
| | GND -> GND |
| | |
| | Pour trouver comment il faut câbler le St-link et le récepteur RC, je vous propose de voir les excellentes explications de tchangly21 sur youtub.\\ |
| | https://www.youtube.com/watch?v=hxwh_wvMX74\\ |
| | |
| | |
| | ===== Programmation ===== |
| |
| On branche le ST-link V2 \\ | On branche le ST-link V2 \\ |
| |
| STM32F1 High Density | STM32F1 High Density |
| |
| Chip ID 0x414 | Chip ID 0x414 |
| |
| probablement un STM32F103ZE/ZET6 512 KB | probablement un STM32F103ZE/ZET6 512 KB |
| |
| https://github.com/EFeru/hoverboard-firmware-hack-FOC \\ | https://github.com/EFeru/hoverboard-firmware-hack-FOC \\ |
| Sur conseil de chatgpt, il faut changer 2 3 truc dans Inc/config.h\\ | Sur conseil de chatgpt, il faut changer 2 3 truc dans Inc/config.h\\ |
| | Mais j'ai bataillé un moment avant de comprendre que le :\\ |
| | #define CONTROL_PWM_LEFT 0 // use RC PWM as input on the LEFT cable. Number indicates priority for dual-input. Disable DEBUG_SERIAL_USART2! |
| | définissait le connecteur gauche et non pas le fils gauche du connecteur ! \\ |
| | Il faut donc décommenter le LEFT et commenter le :\\ |
| | //#define CONTROL_PWM_RIGHT |
| | |
| | Cela m'a fait essayé plusieurs firmware, au final j'ai terminé avec celui ci mais le premier doit fonctionner :\\ |
| | https://github.com/jebc/hoverboard-firmware-hack-FOC-pwmLR |
| | |
| | ==== Modification du Inc/config.h ==== |
| Il faut décommenter :\\ | Il faut décommenter :\\ |
| #define VARIANT_PWM // Variant for RC-Remote with PWM Signal | #define VARIANT_PWM // Variant for RC-Remote with PWM Signal |
| | |
| | 1. Vitesse maximale — N_MOT_MAX \\ |
| | |
| | // Ligne 156 — actuellement : |
| | #define N_MOT_MAX 1000 // [rpm] |
| | |
| | // Exemple pour réduire de moitié : |
| | #define N_MOT_MAX 500 // [rpm] |
| | |
| | 2. Rampe d'accélération — DEFAULT_RATE\\ |
| | C'est le paramètre principal pour un démarrage doux. Plus la valeur est basse, plus la montée en vitesse est lente. |
| | |
| | // Ligne 189 — actuellement : |
| | #define DEFAULT_RATE 480 // = 30.0 * 2^4 |
| | |
| | // Plus doux (exemples) : |
| | #define DEFAULT_RATE 160 // ~10.0 → très progressif |
| | #define DEFAULT_RATE 240 // ~15.0 → bon compromis |
| | #define DEFAULT_RATE 320 // ~20.0 → légèrement adouci |
| | |
| | 3. Filtre d'entrée — DEFAULT_FILTER\\ |
| | Lisse les variations brusques du signal PWM de ta RC. Plus la valeur est basse, plus c'est mou.\\ |
| | |
| | // Ligne 190 — actuellement : |
| | #define DEFAULT_FILTER 6553 // = 0.1 |
| | |
| | // Plus lissé : |
| | #define DEFAULT_FILTER 3276 // = 0.05 → répond plus lentement aux coups de stick |
| | |
| | 4. Deadband (zone morte au neutre)\\ |
| | Si les moteurs démarrent légèrement sans que tu touches les sticks, augmente la deadband dans PRI_INPUT1/2 : |
| | |
| | // Actuellement (dernier chiffre = deadband) : |
| | #define PRI_INPUT1 3, -1000, 0, 1000, 100 |
| | #define PRI_INPUT2 3, -1000, 0, 1000, 100 |
| | |
| | // Deadband plus large : |
| | #define PRI_INPUT1 3, -1000, 0, 1000, 150 |
| | #define PRI_INPUT2 3, -1000, 0, 1000, 150 |
| | |
| Puis dans :\\ | Puis dans :\\ |
| * Channel 1: steering, Channel 2: speed. | * Channel 1: steering, Channel 2: speed. |
| */ | */ |
| | |
| // #define DUAL_INPUTS // ADC*(Primary) + PWM(Auxiliary). Uncomment this to use Dual-inputs | // #define DUAL_INPUTS // ADC*(Primary) + PWM(Auxiliary). Uncomment this to use Dual-inputs |
| #ifdef DUAL_INPUTS | #ifdef DUAL_INPUTS |
| #define FLASH_WRITE_KEY 0x1105 // Flash memory writing key. Change this key to ignore the input calibrations from the flash memory and use the ones in config.h | #define FLASH_WRITE_KEY 0x1105 // Flash memory writing key. Change this key to ignore the input calibrations from the flash memory and use the ones in config.h |
| #define CONTROL_ADC 0 // use ADC as input. Number indicates priority for dual-input. Disable CONTROL_SERIAL_USART2, FEEDBACK_SERIAL_USART2, DEBUG_SERIAL_USART2! | #define CONTROL_ADC 0 // use ADC as input. Number indicates priority for dual-input. Disable CONTROL_SERIAL_USART2, FEEDBACK_SERIAL_USART2, DEBUG_SERIAL_USART2! |
| // #define CONTROL_PWM_RIGHT 1 // use RC PWM as input on the RIGHT cable. Number indicates priority for dual-input. Disable DEBUG_SERIAL_USART3! | #define CONTROL_PWM_RIGHT 1 // use RC PWM as input on the RIGHT cable. Number indicates priority for dual-input. Disable DEBUG_SERIAL_USART3! |
| #define CONTROL_PWM_RIGHT 0 // use RC PWM as input on the RIGHT cable. Number indicates priority for dual-input. Disable DEBUG_SERIAL_USART3! | |
| #define PRI_INPUT1 3, 0, 0, 4095, 0 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section | #define PRI_INPUT1 3, 0, 0, 4095, 0 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section |
| #define PRI_INPUT2 3, 0, 0, 4095, 0 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section | #define PRI_INPUT2 3, 0, 0, 4095, 0 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section |
| #define AUX_INPUT2 3, -1000, 0, 1000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section | #define AUX_INPUT2 3, -1000, 0, 1000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section |
| #else | #else |
| #define FLASH_WRITE_KEY 0x1005 // Flash memory writing key. Change this key to ignore the input calibrations from the flash memory and use the ones in config.h | #define FLASH_WRITE_KEY 0x1006 // Flash memory writing key. Change this key to ignore the input calibrations from the flash memory and use the ones in config.h |
| // #define CONTROL_PWM_LEFT 0 // use RC PWM as input on the LEFT cable. Number indicates priority for dual-input. Disable DEBUG_SERIAL_USART2! | #define CONTROL_PWM_LEFT 0 // use RC PWM as input on the LEFT cable. Number indicates priority for dual-input. Disable DEBUG_SERIAL_USART2! |
| #define CONTROL_PWM_RIGHT 0 // use RC PWM as input on the RIGHT cable. Number indicates priority for dual-input. Disable DEBUG_SERIAL_USART3! | //#define CONTROL_PWM_RIGHT 0 // use RC PWM as input on the RIGHT cable. Number indicates priority for dual-input. Disable DEBUG_SERIAL_USART3! |
| #define PRI_INPUT1 3, -1000, 0, 1000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section | #define PRI_INPUT1 3, -1000, 0, 1000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section |
| #define PRI_INPUT2 3, -1000, 0, 1000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section | #define PRI_INPUT2 3, -1000, 0, 1000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section |
| #endif | #endif |
| |
| //#define FILTER 6553 // 0.1f [-] fixdt(0,16,16) lower value == softer filter [0, 65535] = [0.0 - 1.0]. | #define FILTER 3270 // 0.1f [-] fixdt(0,16,16) lower value == softer filter [0, 65535] = [0.0 - 1.0]. |
| #define FILTER 10000 // 0.1f [-] fixdt(0,16,16) lower value == softer filter [0, 65535] = [0.0 - 1.0]. | #define SPEED_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14 |
| // #define SPEED_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14 | #define STEER_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14. If you do not want any steering, set it to 0. |
| #define SPEED_COEFFICIENT 8000 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14 | |
| //#define STEER_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14. If you do not want any steering, set it to 0. | |
| #define STEER_COEFFICIENT 6000 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14. If you do not want any steering, set it to 0. | |
| // #define TANK_STEERING // use for tank steering, each input controls each wheel | |
| // #define INVERT_R_DIRECTION | // #define INVERT_R_DIRECTION |
| // #define INVERT_L_DIRECTION | // #define INVERT_L_DIRECTION |
| // #define DEBUG_SERIAL_USART2 // left sensor cable debug | // #define DEBUG_SERIAL_USART2 // left sensor cable debug |
| #elif defined(CONTROL_PWM_LEFT) && !defined(DUAL_INPUTS) | #elif defined(CONTROL_PWM_LEFT) && !defined(DUAL_INPUTS) |
| // #define DEBUG_SERIAL_USART3 // right sensor cable debug | #define DEBUG_SERIAL_USART3 // right sensor cable debug |
| #endif | #endif |
| #endif | #endif |
| // ############################# END OF VARIANT_PWM SETTINGS ############################ | // ############################# END OF VARIANT_PWM SETTINGS ############################ |
| | |
| </code> | </code> |
| |