Mechatronic Zen Garden
0.1
This webpage contains documentation for the ME 507 term project: Mechatronic Zen Garden.
Control.h
1
13
class
Control
14
{
15
protected
:
16
public
:
17
18
//Constructor
19
Control
(
float
vel_gain,
float
pos_gain);
20
21
//Runs control system to calculate PWM
22
void
run
(
float
pos_ref,
float
pos,
float
vel_ref,
float
vel);
23
25
float
Kd
= 1.003;
26
28
float
Kp
= 0.0203;
29
31
float
PWM_vel
;
32
34
float
PWM_pos
;
35
37
float
PWM
;
38
};
Control
Class for implementing Mechatronic Zen Garden control system.
Definition:
Control.h:14
Control::PWM_vel
float PWM_vel
velocity error contribution to PWM
Definition:
Control.h:31
Control::run
void run(float pos_ref, float pos, float vel_ref, float vel)
Computes PWM based on positional error and velocity error.
Definition:
Control.cpp:30
Control::Control
Control(float vel_gain, float pos_gain)
Instantiates control system object.
Definition:
Control.cpp:17
Control::Kp
float Kp
Proportional gain.
Definition:
Control.h:28
Control::Kd
float Kd
Derivative gain.
Definition:
Control.h:25
Control::PWM_pos
float PWM_pos
position error contribution to PWM
Definition:
Control.h:34
Control::PWM
float PWM
PWM sent to motors.
Definition:
Control.h:37
src
Control.h
Generated on Tue Dec 7 2021 19:09:33 for Mechatronic Zen Garden by
1.8.20