From e00e3f5a3e8b88e559d3f3d62fe19ab220cc672d Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 19 Jun 2026 22:14:17 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9initialisation=20des=20int=C3=A9grateurs?= =?UTF-8?q?=20du=20correcteur=20des=20moteurs=20pour=20supprimer=20les=20?= =?UTF-8?q?=C3=A0-coups=20en=20reprise=20de=20trajectoire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Asser_Moteurs.c | 7 +++++++ Asser_Moteurs.h | 3 ++- config_robot.h | 4 ++-- main.c | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Asser_Moteurs.c b/Asser_Moteurs.c index 749f44a..7060b35 100644 --- a/Asser_Moteurs.c +++ b/Asser_Moteurs.c @@ -28,6 +28,13 @@ void AsserMoteur_Init(int id){ } } +void AsserMoteur_Reset(){ + for(unsigned int i =0; i< 2; i ++){ + commande_I[i]=0; + consigne_mm_s[i]=0; + } +} + /// @brief Défini une consigne de vitesse pour le moteur indiqué. /// @param moteur : Moteur à asservir /// @param _consigne_mm_s : consigne de vitesse en mm/s diff --git a/Asser_Moteurs.h b/Asser_Moteurs.h index dcdfe8f..5346c44 100644 --- a/Asser_Moteurs.h +++ b/Asser_Moteurs.h @@ -6,4 +6,5 @@ float AsserMoteur_getConsigne_mm_s(enum t_moteur moteur); float AsserMoteur_getVitesse_mm_s(enum t_moteur moteur, int step_ms); void AsserMoteur_Gestion(int step_ms); void AsserMoteur_Init(int); -void AsserMoteurs_stop(void); \ No newline at end of file +void AsserMoteurs_stop(void); +void AsserMoteur_Reset(void); diff --git a/config_robot.h b/config_robot.h index 7ecba7c..9c7a436 100644 --- a/config_robot.h +++ b/config_robot.h @@ -1,7 +1,7 @@ // Changer le define en fonction qu'on soit sur les PAMIs ou sur le robot principal -//#define ROBOT_PROPULSION_2026 -#define ROBOT_TYPE_PAMI +#define ROBOT_PROPULSION_2026 +//#define ROBOT_TYPE_PAMI #ifndef ROBOT_PROPULSION_2026 #ifndef ROBOT_TYPE_PAMI diff --git a/main.c b/main.c index 1ea9c50..8173e94 100644 --- a/main.c +++ b/main.c @@ -320,6 +320,7 @@ void main(void) mise_données_dans_échange((uint8_t*) &(etat_action_u8), sizeof(etat_action_u8), REG_PROPULSION_ETAT_TRAJET); if(etat_action == ACTION_TERMINEE){ + AsserMoteur_Reset(); mode = 0; } AsserMoteur_Gestion(step_ms);