summaryrefslogtreecommitdiff
path: root/digital/mimot/src/dirty/models.host.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/mimot/src/dirty/models.host.c')
-rw-r--r--digital/mimot/src/dirty/models.host.c102
1 files changed, 41 insertions, 61 deletions
diff --git a/digital/mimot/src/dirty/models.host.c b/digital/mimot/src/dirty/models.host.c
index db4152e0..0b9b3665 100644
--- a/digital/mimot/src/dirty/models.host.c
+++ b/digital/mimot/src/dirty/models.host.c
@@ -32,66 +32,43 @@
#include <math.h>
#include <string.h>
-/* Marcel clamp, with a Faulhaber 2342 and 23/1 3.71:1 gearbox model. */
-static const struct motor_def_t marcel_clamp_f2342_model =
+/* RE25G with 1:20.25 gearbox model. */
+static const struct motor_def_t re25g_model =
{
/* Motor characteristics. */
- 366 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */
- 26.10 / 1000, /* Torque constant (N.m/A). */
+ 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)). */
- 7.10, /* Terminal resistance (Ohm). */
- 0.265 / 1000, /* Terminal inductance (H). */
- 24.0, /* Maximum voltage (V). */
- /* Gearbox characteristics. */
- 3.71, /* Gearbox ratio. */
- 0.88, /* Gearbox efficiency. */
- /* Load characteristics. */
- 0.100 * 0.005 * 0.005,/* Load (kg.m^2). */
- /* This is a pifometric estimation. */
- /* Hardware limits. */
- -INFINITY, +INFINITY,
-};
-
-/* Robospierre rotation motor, AMAX32GHP with 1:16 gearbox model. */
-static const struct motor_def_t robospierre_rotation_amax32ghp_model =
-{
- /* Motor characteristics. */
- 269 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */
- 25.44 / 1000, /* Torque constant (N.m/A). */
- 0, /* Bearing friction (N.m/(rad/s)). */
- 3.99, /* Terminal resistance (Ohm). */
+ 2.32, /* Terminal resistance (Ohm). */
0.24 / 1000, /* Terminal inductance (H). */
24.0, /* Maximum voltage (V). */
/* Gearbox characteristics. */
- 16, /* Gearbox ratio. */
+ 20.25, /* Gearbox ratio. */
0.75, /* Gearbox efficiency. */
/* Load characteristics. */
- 0.200 * 0.010 * 0.010, /* Load (kg.m^2). */
- /* This is a pifometric estimation. */
+ 0.0, /* Load (kg.m^2). */
/* Hardware limits. */
-INFINITY, +INFINITY,
};
-/* Marcel, APBTeam 2010. */
-static const struct robot_t marcel_robot =
-{
- /** Auxiliary motors, NULL if not present. */
- { &marcel_clamp_f2342_model, &marcel_clamp_f2342_model },
- /** Number of steps for each auxiliary motor encoder. */
- { 256, 256 },
- /** Sensor update function. */
- simu_sensor_update_marcel,
-};
-
-/* Robospierre, APBTeam 2011. */
-static const struct robot_t robospierre_robot =
+/* TazG, Taz with RE25G motors. */
+static const struct robot_t tazg_robot =
{
- /** Auxiliary motors, NULL if not present. */
- { &marcel_clamp_f2342_model, &robospierre_rotation_amax32ghp_model },
- /** Number of steps for each auxiliary motor encoder. */
- { 256, 250 },
- /** Sensor update function. */
- simu_sensor_update_robospierre,
+ /* Main motors. */
+ &re25g_model,
+ /* Number of steps on the main motors encoders. */
+ 500,
+ /* Wheel radius (m). */
+ 0.04,
+ /* Distance between the wheels (m). */
+ 0.30,
+ /* Weight of the robot (kg). */
+ 10.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). */
+ 0,
+ 0.0, 0.0, NULL
};
/* Table of models. */
@@ -100,8 +77,7 @@ static const struct
const char *name;
const struct robot_t *robot;
} models[] = {
- { "marcel", &marcel_robot },
- { "robospierre", &robospierre_robot },
+ { "tazg", &tazg_robot },
{ 0, 0 }
};
@@ -120,20 +96,24 @@ models_get (const char *name)
/** Initialise simulation models. */
void
-models_init (const struct robot_t *robot, struct motor_t aux_motor[])
+models_init (const struct robot_t *robot, struct motor_t *main_motor_left,
+ struct motor_t *main_motor_right)
{
- int i;
- if (aux_motor)
+ if (main_motor_left)
+ {
+ main_motor_left->m = *robot->main_motor;
+ main_motor_left->m.J = robot->weight * robot->wheel_r
+ * robot->wheel_r / 2;
+ main_motor_left->h = ECHANT_PERIOD;
+ main_motor_left->d = 1000;
+ }
+ if (main_motor_right)
{
- for (i = 0; i < AC_ASSERV_AUX_NB; i++)
- {
- if (robot->aux_motor[i])
- {
- aux_motor[i].m = *robot->aux_motor[i];
- aux_motor[i].h = ECHANT_PERIOD;
- aux_motor[i].d = 1000;
- }
- }
+ main_motor_right->m = *robot->main_motor;
+ main_motor_right->m.J = robot->weight * robot->wheel_r
+ * robot->wheel_r / 2;
+ main_motor_right->h = ECHANT_PERIOD;
+ main_motor_right->d = 1000;
}
}