1
1
"""
2
- RobotAxis(; name, mLoad = 15, kp = 5, ks = 0.5, Ts = 0.05, q0 = 0, q1 = 120, swingtime = 0.5, refSpeedMax = 3, refAccMax = 10, kwargs)
2
+ RobotAxis(; name, mLoad = 15, kp = 5, ks = 0.5, Ts = 0.05, q0 = 0, q1 = 120, qd_max = 3, qdd_max = 10, kwargs)
3
3
4
- A single robot axis.
4
+ A single robot axis with a PID controller configured in a cascaded inner velocity PI loop and outer position P loop. The internal axis is `AxisType1` which includes a flexibility in the transmission.
5
+
6
+ The controller is following a point-to-point reference trajectory from `q0` to `q1` generated by [`point_to_point`](@ref).
5
7
6
8
- `mLoad`: Mass of load
7
9
- `kp`: Proportional gain of position controller
8
10
- `ks`: Proportional gain of velocity controller
9
11
- `Ts`: Time constant of integrator of velocity controller
10
12
- `q0`: Start angle in degrees
11
13
- `q1`: End angle in degrees
14
+ - `qd_max`: Maximum allowed velocity
15
+ - `qdd_max`: Maximum allowed acceleration
12
16
"""
13
17
function RobotAxis (; name, mLoad = 15 , kp = 5.0 , ks = 0.5 , Ts = 0.05 , q0 = 0 ,
14
- q1 = 120 , swingtime = 0.5 , refSpeedMax = 3 , refAccMax = 10 , kwargs... )
18
+ q1 = 120 , qd_max = 3 , qdd_max = 10 , kwargs... )
15
19
16
20
# parameter SI.Mass mLoad(min=0)=15 "Mass of load";
17
21
# parameter Real kp=5 "Gain of position controller of axis";
@@ -21,10 +25,9 @@ function RobotAxis(; name, mLoad = 15, kp = 5.0, ks = 0.5, Ts = 0.05, q0 = 0,
21
25
# parameter Modelica.Units.NonSI.Angle_deg q0 = 0 "Start angle of axis";
22
26
# parameter Modelica.Units.NonSI.Angle_deg q1 = 120 "End angle of axis";
23
27
24
- # parameter SI.Time swingtime=0.5
25
28
# "Additional time after reference motion is in rest before simulation is stopped";
26
- # parameter SI.AngularVelocity refSpeedMax =3 "Maximum reference speed";
27
- # parameter SI.AngularAcceleration refAccMax =10
29
+ # parameter SI.AngularVelocity qd_max =3 "Maximum reference speed";
30
+ # parameter SI.AngularAcceleration qdd_max =10
28
31
# "Maximum reference acceleration";
29
32
30
33
@parameters begin
@@ -34,12 +37,8 @@ function RobotAxis(; name, mLoad = 15, kp = 5.0, ks = 0.5, Ts = 0.05, q0 = 0,
34
37
Ts = Ts, [description = " Time constant of integrator of speed controller of axis" ]
35
38
# q0 = q0, [description = "Start angle of axis"]
36
39
# q1 = q1, [description = "End angle of axis"]
37
- swingtime = swingtime,
38
- [
39
- description = " Additional time after reference motion is in rest before simulation is stopped" ,
40
- ]
41
- # refSpeedMax = refSpeedMax, [description = "Maximum reference speed"]
42
- # refAccMax = refAccMax, [description = "Maximum reference acceleration"]
40
+ # qd_max = qd_max, [description = "Maximum reference speed"]
41
+ # qdd_max = qdd_max, [description = "Maximum reference acceleration"]
43
42
end
44
43
45
44
systems = @named begin
@@ -53,11 +52,11 @@ function RobotAxis(; name, mLoad = 15, kp = 5.0, ks = 0.5, Ts = 0.05, q0 = 0,
53
52
ks = ks,
54
53
Ts = Ts)
55
54
load = Rotational. Inertia (J = 1.3 * mLoad)
56
- pathPlanning = PathPlanning1 (;swingtime = swingtime,
55
+ pathPlanning = PathPlanning1 (;
57
56
q0deg = q0,
58
57
q1deg = q1,
59
- speed_max = refSpeedMax ,
60
- acc_max = refAccMax ,
58
+ speed_max = qd_max ,
59
+ acc_max = qdd_max ,
61
60
kwargs...
62
61
)
63
62
controlBus = ControlBus ()
@@ -83,10 +82,6 @@ function Robot6DOF(; name, kwargs...)
83
82
# [description = "Distance from last flange to load mass"]
84
83
# g = 9.81, [description = "Gravity acceleration"]
85
84
# refStartTime = 0, [description = "Start time of reference motion"]
86
- # refSwingTime = 0.5,
87
- # [
88
- # description = "Additional time after reference motion is in rest before simulation is stopped",
89
- # ]
90
85
# q01 = -60, [description = "Start angle of axis 1"]
91
86
# q02 = 20, [description = "Start angle of axis 2"]
92
87
# q03 = 90, [description = "Start angle of axis 3"]
@@ -99,9 +94,9 @@ function Robot6DOF(; name, kwargs...)
99
94
# q14 = 45, [description = "End angle of axis 4"]
100
95
# q15 = 110, [description = "End angle of axis 5"]
101
96
# q16 = 45, [description = "End angle of axis 6"]
102
- # refSpeedMax [1:6] = [3, 1.5, 5, 3.1, 3.1, 4.1],
97
+ # qd_max [1:6] = [3, 1.5, 5, 3.1, 3.1, 4.1],
103
98
# [description = "Maximum reference speeds of all joints"]
104
- # refAccMax [1:6] = [15, 15, 15, 60, 60, 60],
99
+ # qdd_max [1:6] = [15, 15, 15, 60, 60, 60],
105
100
# [description = "Maximum reference accelerations of all joints"]
106
101
# kp1 = 5, [description = "Gain of position controller"]
107
102
# ks1 = 0.5, [description = "Gain of speed controller"]
@@ -128,8 +123,8 @@ function Robot6DOF(; name, kwargs...)
128
123
g = 9.81 # , [description = "Gravity acceleration"]
129
124
refStartTime = 0 # , [description = "Start time of reference motion"]
130
125
refSwingTime = 0.5 # , [description = "Additional time after reference motion is in rest before simulation is stopped", ]
131
- refSpeedMax = [3 , 1.5 , 5 , 3.1 , 3.1 , 4.1 ] # [description = "Maximum reference speeds of all joints"]
132
- refAccMax = [15 , 15 , 15 , 60 , 60 , 60 ] # [description = "Maximum reference accelerations of all joints"]
126
+ qd_max = [3 , 1.5 , 5 , 3.1 , 3.1 , 4.1 ] # [description = "Maximum reference speeds of all joints"]
127
+ qdd_max = [15 , 15 , 15 , 60 , 60 , 60 ] # [description = "Maximum reference accelerations of all joints"]
133
128
kp1 = 5 # , [description = "Gain of position controller"]
134
129
ks1 = 0.5 # , [description = "Gain of speed controller"]
135
130
Ts1 = 0.05 # , [description = "Time constant of integrator of speed controller"]
@@ -183,10 +178,8 @@ function Robot6DOF(; name, kwargs...)
183
178
q15,
184
179
q16,
185
180
],
186
- speed_max = refSpeedMax,
187
- acc_max = refAccMax,
188
- startTime = refStartTime,
189
- swingtime = refSwingTime,
181
+ speed_max = qd_max,
182
+ acc_max = qdd_max,
190
183
kwargs... )
191
184
192
185
axis1 = AxisType1 (w = 4590 ,
0 commit comments