Révision 111
Ajouté par aueuphrasi il y a plus de 6 ans
branch/euphrasie_auguste/Emb_App/SessionM32C_E8a_system.ini | ||
---|---|---|
[Target]
|
||
M32C E8a SYSTEM=Renesas Communications
|
||
[USER_DATA]
|
||
RESET=ff001a
|
||
RESET=ff0020
|
branch/euphrasie_auguste/Emb_App/programme_principal_etud.c | ||
---|---|---|
void periph_command(char addr, short valeur);
|
||
short periph_requete(char addr);
|
||
|
||
void assser_tourelle(void);
|
||
void asser_roue(void);
|
||
|
||
short consigne = 450;
|
||
short k = 2;
|
||
short commande;
|
||
|
||
short consigne_T = 450;
|
||
short k_T = 2;
|
||
short commande_T;
|
||
short ang_T;
|
||
|
||
short distance_centre = 721;
|
||
float k_D = 1.0;
|
||
short commande_D;
|
||
short dist_mur_droit;
|
||
|
||
|
||
void main()
|
||
... | ... | |
sta_cyc(ID_acqui);
|
||
// sta_tsk(ID_periph_rx);
|
||
|
||
periph_command('V', 1);
|
||
|
||
|
||
while(1)
|
||
{
|
||
LED_J=1;
|
||
dly_tsk(100);
|
||
LED_J=0;
|
||
dly_tsk(100);
|
||
|
||
//periph_command('V', 50);
|
||
|
||
|
||
ang_T = periph_requete('R');
|
||
commande = k * (consigne - ang_T);
|
||
periph_command('T', commande);
|
||
{
|
||
assser_tourelle();
|
||
asser_roue();
|
||
|
||
}
|
||
}
|
||
|
||
... | ... | |
}
|
||
|
||
|
||
void asser_roue(void){
|
||
dist_mur_droit = periph_requete('U');
|
||
commande_D = k_D * (dist_mur_droit - distance_centre);
|
||
periph_command('D', commande_D);
|
||
}
|
||
|
||
|
||
|
||
... | ... | |
|
||
|
||
|
||
|
||
|
||
|
||
void assser_tourelle(void){
|
||
ang_T = periph_requete('R');
|
||
commande_T = k_T * (consigne_T - ang_T);
|
||
periph_command('T', commande_T);
|
||
}
|
||
|
||
void periph_command(char addr, short valeur){
|
||
CanFrame comm;
|
Formats disponibles : Unified diff
creation de fonction d'asservissement de la position de la tourelle et de l'angle des roues
fonction position tourelle OK
fonction angle roue faite mais à ajuster
Début reflexion probleme message ligne depart