-
Notifications
You must be signed in to change notification settings - Fork 0
/
pid_bo_controller.py
executable file
·102 lines (91 loc) · 3.88 KB
/
pid_bo_controller.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Copyright (c) 2016 Konstantinos G. Papdopoulos. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this distribution,
# and is available at http://www.eclipse.org/legal/epl-v10.html
"""
Main configuration script for choosing the control loop design
-The control loop can be of type-I, type-II, type-III, type-V
-The control loop design can be either of analog/digital
-The plant to be controlled (process) can be determined manually by the user
or generated manually.
"""
import argparse
import plant
def main():
"""This is the main function where the main test application starts.
"""
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--control-loop-type',
required=True,
type=str,
dest='control_loop_type',
action='store',
help="type_I (for zero steady state position error)\n"
"type_II (for zero steady state position/velocity error)\n"
"type_III (for zero steady state position/velocity/acceleration error)\n"
"type_IV (for elimination higher order errors )"
)
parser.add_argument('--plant',
required=False,
type=str,
dest='plant',
action='store',
help="random\n"
"determined"
)
parser.add_argument('--poles',
required=True,
type=str,
dest='poles',
action='store',
help="number of poles"
)
parser.add_argument('--zeros',
required=True,
type=str,
dest='zeros',
action='store',
help="number of zeros"
)
parser.add_argument('--time-delay',
required=False,
type=str,
dest='time_delay',
action='store',
help="time delay of the controlled process"
)
parser.add_argument('--design_type',
required=False,
type=str,
dest='plant',
action='store',
help="analog\n"
"digital"
)
parser.add_argument('--log-file',
dest='log_file',
action='store',
help='log file name')
parser.add_argument('--output-dir',
required=False,
type=str,
dest='output_dir',
action='store',
help='result files output directory ')
parser.add_argument('--logging-level',
type=str,
dest='logging_level',
action='store',
default='DEBUG',
help="log level set."
"possible values are:\n"
"INFO\n"
"DEBUG (default)\n"
"ERROR")
args = parser.parse_args()
plantGp = plant.Plant(args)
plantGp.create_plant(args)
FclOptimal = pid_optimal_tuning.ControllerOptimal(args)
if __name__ == '__main__':
main()