summaryrefslogtreecommitdiffhomepage
path: root/digital/asserv
diff options
context:
space:
mode:
authorNicolas Schodet2008-04-05 01:27:06 +0200
committerNicolas Schodet2008-04-05 01:27:06 +0200
commit96f5c1fa8f605beadee3a3693370f25a4f092028 (patch)
tree9f8d44ad97186158ab562c85331eaa7d19ee670e /digital/asserv
parent503feb408500ac5f2304e09e7d81c234ceaec09f (diff)
* digital/asserv/src/asserv:
- there is no two factor.
Diffstat (limited to 'digital/asserv')
-rw-r--r--digital/asserv/src/asserv/postrack.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/digital/asserv/src/asserv/postrack.c b/digital/asserv/src/asserv/postrack.c
index 0ecb8d58..47a86015 100644
--- a/digital/asserv/src/asserv/postrack.c
+++ b/digital/asserv/src/asserv/postrack.c
@@ -36,15 +36,14 @@ int32_t postrack_a;
/** Distance between the weels, u16. */
uint16_t postrack_footing;
/** Precomputed footing factor, f8.24.
- * postrack_footing_factor = (2 * 1/2pi * 256) / postrack_footing
+ * postrack_footing_factor = (1/2pi * 256) / postrack_footing
* Explanations:
* - Angles are between 0 and 1, corresponding to 0 and 2pi, therefore we
* must divide by 2pi to convert unit (Arc=Angle * Radius only works for
* radians).
* - dd (see postrack_update) is in f10.16 format, we multiply by 256 to have
* a angle in f8.24 format.
- * - this factor is in f8.24 format, therefore, 1 is writen (1L << 24).
- * - there is a two factor because of the sum done in the motor control. */
+ * - this factor is in f8.24 format, therefore, 1 is writen (1L << 24). */
static uint32_t postrack_footing_factor;
/** Initialise the position tracker. */
@@ -102,6 +101,6 @@ postrack_set_footing (uint16_t footing)
{
postrack_footing = footing;
postrack_footing_factor =
- (uint32_t) (M_1_PI * (1L << 8) * (1L << 24)) / footing;
+ (uint32_t) (0.5 * M_1_PI * (1L << 8) * (1L << 24)) / footing;
}