From 5d21466eb434aa44eeb334a19668c58ffef5665f Mon Sep 17 00:00:00 2001 From: zer0 Date: Wed, 28 Apr 2010 00:03:54 +0200 Subject: [PATCH] optim cobboard --- projects/microb2010/cobboard/actuator.c | 11 ++++++----- projects/microb2010/cobboard/main.c | 6 +++--- projects/microb2010/cobboard/shovel.c | 9 ++++++--- projects/microb2010/cobboard/state.c | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/projects/microb2010/cobboard/actuator.c b/projects/microb2010/cobboard/actuator.c index 8dfe8bb..8d2355d 100644 --- a/projects/microb2010/cobboard/actuator.c +++ b/projects/microb2010/cobboard/actuator.c @@ -45,12 +45,12 @@ #include "main.h" #include "actuator.h" -#define COBROLLER_SPEED 800 +#define COBROLLER_SPEED 600 //#define COBROLLER_SPEED 400 -#define SERVO_DOOR_OPEN 260 -#define SERVO_DOOR_CLOSED 500 -#define SERVO_DOOR_BLOCK 500 +#define SERVO_DOOR_OPEN 300 +#define SERVO_DOOR_CLOSED 530 +#define SERVO_DOOR_BLOCK 530 #define SERVO_CARRY_L_OPEN 295 #define SERVO_CARRY_L_CLOSED 400 // 510 @@ -113,5 +113,6 @@ void cobroller_reverse(uint8_t side) void actuator_init(void) { - + servo_door_open(); + servo_carry_open(); } diff --git a/projects/microb2010/cobboard/main.c b/projects/microb2010/cobboard/main.c index 215fb5c..d01a92e 100755 --- a/projects/microb2010/cobboard/main.c +++ b/projects/microb2010/cobboard/main.c @@ -258,13 +258,13 @@ int main(void) printf_P(PSTR("cobboard start\r\n")); + /* actuators */ + actuator_init(); + /* spickle, shovel */ spickle_init(); shovel_init(); - /* actuators */ - actuator_init(); - state_init(); printf_P(PSTR("\r\n")); diff --git a/projects/microb2010/cobboard/shovel.c b/projects/microb2010/cobboard/shovel.c index abf0c42..42ab78b 100644 --- a/projects/microb2010/cobboard/shovel.c +++ b/projects/microb2010/cobboard/shovel.c @@ -43,8 +43,8 @@ #include "shovel.h" #define SHOVEL_DOWN 100 -#define SHOVEL_MID 4900 -#define SHOVEL_UP 10000 +#define SHOVEL_MID 4500 +#define SHOVEL_UP 11000 /* init spickle position at beginning */ static void shovel_autopos(void) @@ -70,19 +70,22 @@ static uint8_t shovel_is_at_pos(int32_t pos) void shovel_down(void) { + quadramp_set_1st_order_vars(&cobboard.shovel.qr, 2500, 2500); quadramp_set_2nd_order_vars(&cobboard.shovel.qr, 50, 80); cs_set_consign(&cobboard.shovel.cs, SHOVEL_DOWN); } void shovel_mid(void) { + quadramp_set_1st_order_vars(&cobboard.shovel.qr, 2500, 2500); quadramp_set_2nd_order_vars(&cobboard.shovel.qr, 80, 80); cs_set_consign(&cobboard.shovel.cs, SHOVEL_MID); } void shovel_up(void) { - quadramp_set_2nd_order_vars(&cobboard.shovel.qr, 80, 20); + quadramp_set_1st_order_vars(&cobboard.shovel.qr, 2000, 2500); + quadramp_set_2nd_order_vars(&cobboard.shovel.qr, 80, 15); cs_set_consign(&cobboard.shovel.cs, SHOVEL_UP); } diff --git a/projects/microb2010/cobboard/state.c b/projects/microb2010/cobboard/state.c index df0e4c6..092d0de 100644 --- a/projects/microb2010/cobboard/state.c +++ b/projects/microb2010/cobboard/state.c @@ -118,7 +118,7 @@ static void spickle_prepare(uint8_t side) if (cob_count >= 5) spickle_pack(side); else if (is_deployed(side) && !is_autoharvest(side)) - spickle_mid(side); + spickle_deploy(side); /*spickle_mid(side);*/ else if (is_deployed(side) && is_autoharvest(side)) spickle_deploy(side); else @@ -206,7 +206,7 @@ static void state_do_harvest(uint8_t side) /* eat the cob */ spickle_pack(side); - time_wait_ms(250); + time_wait_ms(200); cobroller_on(side); /* check that cob is correctly in place */ -- 2.39.5