From ddf13c7289697864c1b29dc51c44b175ef0c3023 Mon Sep 17 00:00:00 2001 From: schodet Date: Mon, 6 Aug 2007 12:41:58 +0000 Subject: Fixed bad M_2_PI usage (M_2_PI = 2/pi, not 2*pi). --- n/asserv/src/asserv/models.host.c | 6 +++--- n/asserv/src/asserv/simu.host.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/n/asserv/src/asserv/models.host.c b/n/asserv/src/asserv/models.host.c index f978cb6..976edd3 100644 --- a/n/asserv/src/asserv/models.host.c +++ b/n/asserv/src/asserv/models.host.c @@ -32,7 +32,7 @@ static const struct motor_t gloubi_model = { /* Motor caracteristics. */ - 407 * M_2_PI / 60, /* Speed constant ((rad/s)/V). */ + 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). */ @@ -65,7 +65,7 @@ static const struct robot_t gloubi_robot = static const struct motor_t taz_model = { /* Motor caracteristics. */ - 407 * M_2_PI / 60, /* Speed constant ((rad/s)/V). */ + 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). */ @@ -98,7 +98,7 @@ static const struct robot_t taz_robot = static const struct motor_t tazg_model = { /* Motor caracteristics. */ - 407 * M_2_PI / 60, /* Speed constant ((rad/s)/V). */ + 407 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */ 40.2 / 1000, /* Torque constant (N.m/A). */ 0, /* Bearing friction (N.m/(rad/s)). */ 2.32, /* Terminal resistance (Ohm). */ diff --git a/n/asserv/src/asserv/simu.host.c b/n/asserv/src/asserv/simu.host.c index bb204c1..adf5b34 100644 --- a/n/asserv/src/asserv/simu.host.c +++ b/n/asserv/src/asserv/simu.host.c @@ -218,11 +218,11 @@ simu_step (void) motor_model_step (&simu_left_model); motor_model_step (&simu_right_model); /* Modify counters. */ - counter_left_diff = (simu_left_model.th - old_left_th) / M_2_PI * 500 * - simu_left_model.i_G; + counter_left_diff = (simu_left_model.th - old_left_th) / (2*M_PI) + * 500 * simu_left_model.i_G; counter_left += counter_left_diff; - counter_right_diff = (simu_right_model.th - old_right_th) / M_2_PI * 500 * - simu_right_model.i_G; + counter_right_diff = (simu_right_model.th - old_right_th) / (2*M_PI) + * 500 * simu_right_model.i_G; counter_right += counter_right_diff; /* Update position */ simu_pos_update ((simu_left_model.th - old_left_th) -- cgit v1.2.3