]> git.droids-corp.org - aversive.git/commitdiff
optim cobboard
authorzer0 <zer0@carbon.local>
Tue, 27 Apr 2010 22:03:54 +0000 (00:03 +0200)
committerzer0 <zer0@carbon.local>
Tue, 27 Apr 2010 22:03:54 +0000 (00:03 +0200)
projects/microb2010/cobboard/actuator.c
projects/microb2010/cobboard/main.c
projects/microb2010/cobboard/shovel.c
projects/microb2010/cobboard/state.c

index 8dfe8bb44cea1ed0de020a00e85b381eaf3558bc..8d2355d15981184a6b0bdcdc76bd965361a5498c 100644 (file)
 #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();
 }
index 215fb5c0ee895d393d35a4ea9c800029992417e7..d01a92e83e42cc35a64e5c7f0b14c5896cb1c5af 100755 (executable)
@@ -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"));
index abf0c42db0a4c31c26fc607c9ec74417d65c0753..42ab78bce33c89b094357edf05064b5efd41a471 100644 (file)
@@ -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);
 }
 
index df0e4c66c69a68d2407dc58b46482d50970ea946..092d0deae348ca3c26ed2b88f767a509e0a7a3d9 100644 (file)
@@ -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 */