changeset 2:ca16b2fe3eb3

servo fine tuning
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Thu, 20 Nov 2014 00:10:37 +0100
parents db1f05f1a2e4
children f0c05b8506be
files controller/servos.ino
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/controller/servos.ino	Wed Nov 19 21:39:25 2014 +0100
+++ b/controller/servos.ino	Thu Nov 20 00:10:37 2014 +0100
@@ -3,8 +3,8 @@
 #include <Servo.h>
 
 // Range of the servos.
-#define SERVO_FREQ_MIN 600
-#define SERVO_FREQ_MAX 2400
+#define SERVO_FREQ_MIN 300
+#define SERVO_FREQ_MAX 1200
 
 static const unsigned char SERVO_PINS[SERVOS] = {
 // ankle, knee, hip
@@ -15,17 +15,17 @@
 };
 static const char SERVO_REVERSE[SERVOS] = {
 // ankle, knee, hip
-    1, 1, 1,    // front left
+    -1, -1, -1,    // front left
     1, 1, 1,    // hind left
-    1, 1, 1,    // hind right
+    -1, -1, -1,    // hind right
     1, 1, 1     // front right
 };
 static const char SERVO_TRIM[SERVOS] = {
 // ankle, knee, hip
-    0, 0, 0,    // front left
-    0, 0, 0,    // hind left
-    0, 0, 0,    // hind right
-    0, 0, 0     // front right
+    -6, 0, -8,    // front left
+    2, -8, -8,    // hind left
+    -4, 0, 4,    // hind right
+    0, 2, 0     // front right
 };
 static Servo servos[SERVOS];
 
@@ -55,6 +55,7 @@
     for (unsigned char servo = 0; servo < SERVOS; ++servo) {
         servos[servo].attach(SERVO_PINS[servo],
                              SERVO_FREQ_MIN, SERVO_FREQ_MAX);
+        servo_move(servo, 0);
         delay(150);
     }
 }