summaryrefslogtreecommitdiff
path: root/n/asserv/src/asserv/postrack.c
diff options
context:
space:
mode:
authorschodet2006-05-25 22:01:18 +0000
committerschodet2006-05-25 22:01:18 +0000
commit1aff85cbaa8174f4aef9ded81c2156c8f1c5a508 (patch)
tree63d0bf3440ba1b1ce34e7e6812de83419772df6f /n/asserv/src/asserv/postrack.c
parentd4a465bb7fc8737df54ba49ea1b65396daecbdd2 (diff)
Petite correction d'un facteur deux sur le calcul de l'angle de rotation.
Diffstat (limited to 'n/asserv/src/asserv/postrack.c')
-rw-r--r--n/asserv/src/asserv/postrack.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/n/asserv/src/asserv/postrack.c b/n/asserv/src/asserv/postrack.c
index 2f8aae5..bd4373c 100644
--- a/n/asserv/src/asserv/postrack.c
+++ b/n/asserv/src/asserv/postrack.c
@@ -30,14 +30,16 @@ int32_t postrack_a;
/** Distance between the weels, u16. */
uint16_t postrack_footing;
/** Precomputed footing factor, f8.24.
- * postrack_footing_factor = (1/2pi * 256) / postrack_footing
+ * postrack_footing_factor = (2 * 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 f11.16 format, we multiply by 256 to have
+ * - 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). */
+ * - this factor is in f8.24 format, therefore, 1 is writen (1L << 24).
+ * - il y a un facteur deux à cause de la somme effectuée dans
+ * l'asservissement pid. */
uint32_t postrack_footing_factor;
/* +AutoDec */
@@ -111,5 +113,5 @@ postrack_set_footing (uint16_t footing)
{
postrack_footing = footing;
postrack_footing_factor =
- (uint32_t) (0.5 * M_1_PI * (1L << 8) * (1L << 24)) / footing;
+ (uint32_t) (M_1_PI * (1L << 8) * (1L << 24)) / footing;
}