Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ssloy/penny.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Sokolov <ssloy@users.noreply.github.com>2020-02-19 18:00:06 +0300
committerGitHub <noreply@github.com>2020-02-19 18:00:06 +0300
commitd1b88d72006551b1bf3fd1d360841a81329c5dce (patch)
treec31e025811b13cc2daf0bca3b8da29974cbb72a3
parent042759a40d69575f003cfdf678b9cc9c6d592a8a (diff)
Update README.md
-rw-r--r--README.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index 9eeaa86..055f046 100644
--- a/README.md
+++ b/README.md
@@ -112,12 +112,16 @@ OCR2 = 1500/16; // center servo
```
## Movement planner
-![](https://raw.githubusercontent.com/ssloy/penny/master/doc/servos-pos-range.jpg)
-
+First of all, there are 6 important constants in the code:
```c
const uint8_t zero[3] = {45, 50, 40}; // zero position of the servo (degrees)
const uint8_t range[3] = {25, 25, 20}; // the servos are allowed to move in the zero[i] +- range[i] interval
```
+The `zero[3]` array provides the angles of all three servos corresponding to the neutral stance (left image):
+
+![](https://raw.githubusercontent.com/ssloy/penny/master/doc/servos-pos-range.jpg)
+
+Ideally, these angles are to be at 45° (midpoint of the servo range), but in practice if we set the servos to 45°, the legs won't be aligned due to descreet teeth position on the shaft. Next, `range[3]` specifies the admissible range. It means that the servo `i` is allowed to move in the `zero[i]-range[i]`to `zero[i]+range[i]` interval.
Current servo position (in degrees, 0°-90°) is supposed to be stored in the `uint8_t pos[3]` array. When calling `update_servo_timers()`, the timers are updated according to the array.