From c00406af97d8009f89b4b542132cf2620d3f93f1 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 3 May 2009 00:19:40 +0200 Subject: * digital/asserv/src/asserv: - added AquaJim model. --- digital/asserv/src/asserv/models.host.c | 65 +++++++++++++++++++++++++++++++++ digital/asserv/src/asserv/simu.host.c | 15 +++++++- 2 files changed, 78 insertions(+), 2 deletions(-) (limited to 'digital/asserv') diff --git a/digital/asserv/src/asserv/models.host.c b/digital/asserv/src/asserv/models.host.c index 97341626..95446784 100644 --- a/digital/asserv/src/asserv/models.host.c +++ b/digital/asserv/src/asserv/models.host.c @@ -185,6 +185,70 @@ static const struct robot_t giboulee_robot = { 500, 0 }, }; +/* AquaJim arm model, with a RE40G and a 1:4 + 15:80 ratio gearbox. */ +static const struct motor_def_t aquajim_arm_model = +{ + /* Motor characteristics. */ + 317 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */ + 30.2 / 1000, /* Torque constant (N.m/A). */ + 0, /* Bearing friction (N.m/(rad/s)). */ + 0.316, /* Terminal resistance (Ohm). */ + 0.08 / 1000, /* Terminal inductance (H). */ + 24.0, /* Maximum voltage (V). */ + /* Gearbox characteristics. */ + 4.0 * 80.0 / 15.0, /* Gearbox ratio. */ + 0.75, /* Gearbox efficiency. */ + /* Load characteristics. */ + 0.05 * 2.5 * 0.06 * 0.06, /* Load (kg.m^2). */ +}; + +/* AquaJim elevator model, with a RE25CLL and a 1:10 ratio gearbox. */ +static const struct motor_def_t aquajim_elevator_model = +{ + /* Motor characteristics. */ + 407 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */ + 23.4 / 1000, /* Torque constant (N.m/A). */ + 0, /* Bearing friction (N.m/(rad/s)). */ + 2.18, /* Terminal resistance (Ohm). */ + 0.24 / 1000, /* Terminal inductance (H). */ + 24.0, /* Maximum voltage (V). */ + /* WARNING: this motor uses a 12V motor on 24V power, PWM should be + * limited to half scale. */ + /* Gearbox characteristics. */ + 10, /* Gearbox ratio. */ + 0.75, /* Gearbox efficiency. */ + /* Load characteristics. */ + 0.200 * 0.01 * 0.01,/* Load (kg.m^2). */ + /* This is a pifometric estimation. */ +}; + +/* AquaJim, APBTeam 2009. */ +static const struct robot_t aquajim_robot = +{ + /* Main motors. */ + &amax32ghp_model, + /* Number of steps on the main motors encoders. */ + 2500, + /* Wheel radius (m). */ + 0.065 / 2, + /* Distance between the wheels (m). */ + 0.16, + /* Weight of the robot (kg). */ + 20.0, + /* Distance of the gravity center from the center of motors axis (m). */ + 0.0, + /* Whether the encoder is mounted on the main motor (false) or not (true). */ + 1, + /** Encoder wheel radius (m). */ + 0.063 / 2, + /** Distance between the encoders wheels (m). */ + 0.28, + /** Auxiliary motors, NULL if not present. */ + { &aquajim_arm_model, &aquajim_elevator_model }, + /** Number of steps for each auxiliary motor encoder. */ + { 250, 250 }, +}; + /* Table of models. */ static const struct { @@ -195,6 +259,7 @@ static const struct { "taz", &taz_robot }, { "tazg", &tazg_robot }, { "giboulee", &giboulee_robot }, + { "aquajim", &aquajim_robot }, { 0, 0 } }; diff --git a/digital/asserv/src/asserv/simu.host.c b/digital/asserv/src/asserv/simu.host.c index 2ae3c3d4..0570729a 100644 --- a/digital/asserv/src/asserv/simu.host.c +++ b/digital/asserv/src/asserv/simu.host.c @@ -250,6 +250,12 @@ simu_step (void) counter_aux[i] += counter_aux_diff[i]; simu_counter_aux[i] = counter_aux_new; } + else + { + counter_aux_diff[i] = 0; + counter_aux[i] = 0; + simu_counter_aux[i] = 0; + } } /* Update position. */ simu_pos_update ((simu_left_model.th - old_left_th) @@ -281,8 +287,13 @@ simu_send (void) /* Send Aux position. */ m = mex_msg_new (0xa8); for (i = 0; i < AC_ASSERV_AUX_NB; i++) - mex_msg_push (m, "l", (int32_t) (1024.0 * simu_aux_model[i].th - / simu_aux_model[i].m.i_G)); + { + if (simu_robot->aux_motor[i]) + mex_msg_push (m, "l", (int32_t) (1024.0 * simu_aux_model[i].th + / simu_aux_model[i].m.i_G)); + else + mex_msg_push (m, "l", 0); + } mex_node_send (m); } -- cgit v1.2.3