summaryrefslogtreecommitdiff
path: root/digital/avr/modules/motor/speed_control/speed_control.txt
blob: 2cdebb463e5d825c9aafe0ad45687cb10a3b4989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
============================
 motor/speed_control module
============================
:Author: Nicolas Schodet

Introduction
============

This module provides two speed control modes, to be chained with a position
control module.  Its role is to make sure that movement acceleration is not
too high.

Usage
=====

The `max` and `acc_f` parameters should be set to maximum speed and maximum
acceleration.  Other fields should better be changed using the helper
functions.

The first control mode respects a speed consign.  User choose a desired speed
and the module will change the actual speed according to acceleration to match
consign.  Use the `speed_control_set_speed`.

The second mode will move to a position, by increasing and decreasing speed
according to the acceleration. Use the `speed_control_pos_offset` and
`speed_control_pos_offset_from_here` functions.  The first function use an
offset relative to the current controlled position so that small errors are not
accumulated over several movements.

The `speed_control_hard_stop` function is quite dangerous as it does not
respect the maximum acceleration.  Only use this if you know what you are
doing!  This can be used for example to stop as soon as a contact is triggered
to find a zero position at very low speed.  The regular braking method is
`speed_control_set_speed` with a zero speed.

API
===

.. include:: speed_control.exd