From 3462dbdfea97226ce1ddb27d23ccaca8d10b7e11 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 11 May 2010 22:39:29 +0200 Subject: digital/{asserv,io}, host/simu/robots/marcel: add gate simulation --- digital/asserv/src/asserv/models.host.c | 26 ++++++++++++++++++++++++-- digital/io/tools/test_simu_control.py | 12 ++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) (limited to 'digital') diff --git a/digital/asserv/src/asserv/models.host.c b/digital/asserv/src/asserv/models.host.c index 9c16539a..f4d8ca5a 100644 --- a/digital/asserv/src/asserv/models.host.c +++ b/digital/asserv/src/asserv/models.host.c @@ -289,6 +289,28 @@ static const struct motor_def_t marcel_elevator_model = 0.0, +INFINITY, }; +/* Marcel gate model, with a RE25CLL and a 1:10 ratio gearbox. */ +static const struct motor_def_t marcel_gate_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.100 * 0.01 * 0.01,/* Load (kg.m^2). */ + /* This is a pifometric estimation. */ + /* Hardware limits. */ + -INFINITY, +INFINITY, +}; + /* Marcel, APBTeam 2010. */ static const struct robot_t marcel_robot = { @@ -311,9 +333,9 @@ static const struct robot_t marcel_robot = /** Distance between the encoders wheels (m). */ 0.28, /** Auxiliary motors, NULL if not present. */ - { &marcel_elevator_model, NULL }, + { &marcel_elevator_model, &marcel_gate_model }, /** Number of steps for each auxiliary motor encoder. */ - { 256, 0 }, + { 256, 250 }, /** Sensor update function. */ simu_sensor_update_marcel, }; diff --git a/digital/io/tools/test_simu_control.py b/digital/io/tools/test_simu_control.py index 49691fb7..1f51f1c2 100644 --- a/digital/io/tools/test_simu_control.py +++ b/digital/io/tools/test_simu_control.py @@ -46,6 +46,11 @@ class TestSimuControl (TestSimu): text = 'Elevator', indicatoron = False, variable = self.elevator_var, command = self.elevator_command) self.elevator_button.pack () + self.gate_var = IntVar () + self.gate_button = Checkbutton (self.control_frame, + text = 'Gate', indicatoron = False, + variable = self.gate_var, command = self.gate_command) + self.gate_button.pack () self.loader_up_button = Button (self.control_frame, text = 'Loader up', padx = 0, pady = 0, command = self.loader_up_command) @@ -83,6 +88,13 @@ class TestSimuControl (TestSimu): pos = 0 self.asserv.goto_pos ('a0', pos) + def gate_command (self): + if self.gate_var.get (): + pos = 0x2081 + else: + pos = 0 + self.asserv.goto_pos ('a1', pos) + def loader_up_command (self): self.io.loader ('u') -- cgit v1.2.3