PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Motor
libservo360
servo360_setControlSys.c
1
/*
2
@file servo360_setControlSys.c
3
4
@author Parallax Inc
5
6
@copyright
7
Copyright (C) Parallax Inc. 2017. All Rights MIT Licensed. See end of file.
8
9
@brief
10
*/
11
12
13
#include "
simpletools.h
"
14
#include "
servo360.h
"
15
16
int
servo360_setControlSys
(
int
pin,
int
constant,
int
value)
17
{
18
if
(!_fb360c.servoCog) servo360_run();
19
int
p = servo360_findServoIndex(pin);
20
if
(p == -1)
return
-1;
21
22
switch
(constant)
23
{
24
case
S360_SETTING_KPV:
25
_fs[p].KpV = value;
26
break
;
27
case
S360_SETTING_KIV:
28
_fs[p].KiV = value;
29
break
;
30
case
S360_SETTING_KDV:
31
_fs[p].KdV = value;
32
break
;
33
case
S360_SETTING_IV_MAX:
34
_fs[p].iMaxV = value;
35
_fs[p].iMinV = -value;
36
break
;
37
case
S360_SETTING_KPA:
38
_fs[p].Kp = value;
39
break
;
40
case
S360_SETTING_KIA:
41
_fs[p].Ki = value;
42
break
;
43
case
S360_SETTING_KDA:
44
_fs[p].Kd = value;
45
break
;
46
case
S360_SETTING_IA_MAX:
47
_fs[p].iMax = value;
48
_fs[p].iMin = -value;
49
break
;
50
}
51
return
p;
52
}
53
54
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
servo360_setControlSys
int servo360_setControlSys(int pin, int constant, int value)
The servo360.h library is designed to use Proportional, Integral and Derivative (PID) control to main...
Definition:
servo360_setControlSys.c:16
servo360.h
Parallax Feedback 360 High Speed Servo control and monitoring functions. Uses one additional cog to c...
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17