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);