Réinitialisation des intégrateurs du correcteur des moteurs pour supprimer les à-coups en reprise de trajectoire

This commit is contained in:
Samuel 2026-06-19 22:14:17 +02:00
parent 7b472725cb
commit e00e3f5a3e
4 changed files with 12 additions and 3 deletions

View File

@ -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

View File

@ -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);
void AsserMoteurs_stop(void);
void AsserMoteur_Reset(void);

View File

@ -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

1
main.c
View File

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