summaryrefslogtreecommitdiffhomepage
path: root/digital/asserv/src/asserv/speed.c
diff options
context:
space:
mode:
authorNicolas Schodet2008-03-09 17:40:28 +0100
committerNicolas Schodet2008-03-09 17:40:28 +0100
commita60c072e17cd502a06d9cea5de928b899d5cac16 (patch)
treea5c0c387fb9549f774fa4bbc3f2dd92fa77c0265 /digital/asserv/src/asserv/speed.c
parent9943963706b24fec06d09999e706cca975039e92 (diff)
* digital/asserv/src/asserv:
- cleaned up, separated compilation. - prepared auxialliary motor control.
Diffstat (limited to 'digital/asserv/src/asserv/speed.c')
-rw-r--r--digital/asserv/src/asserv/speed.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/digital/asserv/src/asserv/speed.c b/digital/asserv/src/asserv/speed.c
index 7e8ed558..be673273 100644
--- a/digital/asserv/src/asserv/speed.c
+++ b/digital/asserv/src/asserv/speed.c
@@ -22,6 +22,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* }}} */
+#include "common.h"
+#include "speed.h"
+
+#include "modules/utils/utils.h"
+#include "modules/math/fixed/fixed.h"
+
+#include "pos.h"
+#include "state.h"
/**
* This file is responsible for speed control. It changes the current shafts
@@ -39,15 +47,12 @@ int8_t speed_theta_max, speed_alpha_max;
int8_t speed_theta_slow, speed_alpha_slow;
/** Consign position. */
uint32_t speed_theta_pos_cons, speed_alpha_pos_cons;
-/** Weither to use the consign position (1) or not (0). */
+/** Whether to use the consign position (1) or not (0). */
uint8_t speed_pos;
/** Acceleration, uf8.8. */
int16_t speed_theta_acc, speed_alpha_acc;
-/* +AutoDec */
-/* -AutoDec */
-
/** Update shaft position consign according to a speed consign. */
static void
speed_update_by_speed (void)
@@ -104,11 +109,11 @@ speed_update_by_position (void)
speed_alpha_cur = speed_compute_max_speed (alpha_d, speed_alpha_cur,
speed_alpha_acc, speed_alpha_max);
if (speed_theta_cur == 0 && speed_alpha_cur == 0)
- main_sequence_finish = main_sequence;
+ state_finish (&state_main);
}
/** Update shaft position consign according to consign. */
-static void
+void
speed_update (void)
{
/* Update speed. */