Skip to content
Snippets Groups Projects
Commit 645a1cb8 authored by Nathan Girard's avatar Nathan Girard
Browse files

position m3508 + correction numero roues

parent d7f73924
No related branches found
No related tags found
2 merge requests!6Position m3508 + cleaning bsp,!5position m3508 + correction numero roues
...@@ -129,15 +129,24 @@ void motors_all_init(void){ ...@@ -129,15 +129,24 @@ void motors_all_init(void){
motors_init(&gm6020_up, 0x205, GM6020); motors_init(&gm6020_up, 0x205, GM6020);
motors_init(&m3508_frontleft, 0x201, M3508); motors_init(&m3508_frontleft, 0x201, M3508);
motors_init(&m3508_frontright, 0x202, M3508); motors_init(&m3508_frontright, 0x202, M3508);
motors_init(&m3508_backleft, 0x203, M3508); motors_init(&m3508_backright, 0x203, M3508);
motors_init(&m3508_backright, 0x204, M3508); motors_init(&m3508_backleft, 0x204, M3508);
gm6020_up.MIN_POSITION = 5565; // Paramtres ICRA
gm6020_up.MAX_POSITION = 6675; // gm6020_up.MIN_POSITION = 5565;
gm6020_down.MIN_POSITION = 2519; // gm6020_up.MAX_POSITION = 6675;
gm6020_down.MAX_POSITION = 7015; // gm6020_up.target = 6200;
// gm6020_down.MIN_POSITION = 2519;
// gm6020_down.MAX_POSITION = 7015;
// gm6020_down.target = 4750;
// Paramtres StandardMeca
gm6020_up.MIN_POSITION = 2220;
gm6020_up.MAX_POSITION = 3840;
gm6020_up.target = 3450;
gm6020_down.MIN_POSITION = 2800;
gm6020_down.MAX_POSITION = 6700;
gm6020_down.target = 4750; gm6020_down.target = 4750;
gm6020_up.target = 6200;
} }
...@@ -92,7 +92,12 @@ void set_motor_speed(motor_t *motor) ...@@ -92,7 +92,12 @@ void set_motor_speed(motor_t *motor)
float target = motor->target; float target = motor->target;
switch(motor->type){ switch(motor->type){
case M3508: case M3508:
if ((target < 100.0) && (target > -100.0)){
run_motor_from_command(motor, motor->pid_pos, target, motor->info.M3508_info.angle);
}
else{
run_motor_from_command(motor, motor->pid_speed, target, motor->info.M3508_info.speed); run_motor_from_command(motor, motor->pid_speed, target, motor->info.M3508_info.speed);
}
case GM6020: case GM6020:
run_motor_from_command(motor, motor->pid_speed, target, motor->info.GM6020_info.speed); run_motor_from_command(motor, motor->pid_speed, target, motor->info.GM6020_info.speed);
case M2006: case M2006:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment