From befacfdc788c6ae1f01a6e27230be85d8b51f2c6 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 26 Mar 2018 10:07:21 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9finition=20contr=C3=B4leur=20moteur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chef/src/dimensions.h | 21 +++++++++++++++++++++ chef/src/movement.h | 13 ++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 chef/src/dimensions.h diff --git a/chef/src/dimensions.h b/chef/src/dimensions.h new file mode 100644 index 0000000..f5d4139 --- /dev/null +++ b/chef/src/dimensions.h @@ -0,0 +1,21 @@ +#ifndef __DIMENSIONS_H__ +#define __DIMENSIONS_H__ + +#include + +// TODO None of that is verified + +// [mm] +#define WHEEL_DIAMETER 80.0 +// [mm] +#define WHEEL_PERIMETER WHEEL_DIAMETER * M_PI +// [cycles/revolution] +#define CODER_RESOLUTION 100 +// [increments/revolution] +#define CODER_DATA_RESOLUTION CODER_RESOLUTION * 4 +// [mm] +#define CODER_DELTA_DISTANCE WHEEL_PERIMETER / CODER_DATA_RESOLUTION +// [mm] +#define DISTANCE_BETWEEN_WHEELS 250.0 + +#endif diff --git a/chef/src/movement.h b/chef/src/movement.h index caca772..e54ac11 100644 --- a/chef/src/movement.h +++ b/chef/src/movement.h @@ -1,9 +1,8 @@ -#ifndef __MOVEMENT_H_ -#define __MOVEMENT_H_ -#include "CA.h" -void brake(); -void aller(struct position* pos); - -#endif +int bouger(float vitL, float vitR); +// Vitesse en mm/s +// Vitesse < 0 ⇒ sens inverse +// Si vitesse < seuil ⇒ brake +int brake(); +int freewheel();