Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
0f82b26b
Commit
0f82b26b
authored
Aug 08, 2015
by
Jeroen Vreeken
Browse files
Improve limit of i2t when some budget is already taken...
parent
348c480c
Changes
2
Hide whitespace changes
Inline
Side-by-side
controller/block/block_i2t.c
View file @
0f82b26b
...
...
@@ -67,7 +67,7 @@ static void i2t_calculate(struct controller_block *block)
if
(
i2t
>=
peak2t
)
priv
->
Ilim
=
priv
->
continuous
;
else
priv
->
Ilim
=
priv
->
peaklim
;
priv
->
Ilim
=
sqrtf
(
peak2t
-
i2t
+
continuous2
)
;
priv
->
i2t
=
i2t
;
}
...
...
@@ -75,10 +75,9 @@ static void i2t_calculate(struct controller_block *block)
static
void
set_peak2t
(
struct
controller_block
*
i2t
)
{
struct
controller_block_private
*
priv
=
i2t
->
private
;
double
tick
=
controller_time_period_get
(
i2t
->
time
);
priv
->
peak2t
=
(
priv
->
peak
*
priv
->
peak
-
priv
->
continuous2
)
*
priv
->
duration
/
tick
;
priv
->
peaklim
=
priv
->
peak
/
tick
;
priv
->
peak2t
=
(
priv
->
peak
*
priv
->
peak
-
priv
->
continuous2
)
*
priv
->
duration
;
priv
->
peaklim
=
priv
->
peak
*
priv
->
duration
;
}
static
int
param_set_peak
(
struct
controller_block
*
i2t
,
char
*
param
,
int
argc
,
...
...
@@ -96,8 +95,9 @@ static int param_set_duration(struct controller_block *i2t, char *param, int arg
va_list
val
)
{
struct
controller_block_private
*
priv
=
i2t
->
private
;
double
tick
=
controller_time_period_get
(
i2t
->
time
);
priv
->
duration
=
va_arg
(
val
,
double
);
priv
->
duration
=
va_arg
(
val
,
double
)
/
tick
;
set_peak2t
(
i2t
);
return
0
;
...
...
controller/block/block_i2t.test.ctrl
View file @
0f82b26b
...
...
@@ -39,14 +39,14 @@ params {
}
{ "test_1_Ilim", "value", 30,
(float) {
3
0.0,
3
0.0,
3
0.0,
3
0.0,
3
0.0,
3
0.0,
3
0.0,
3
0.0,
3
0.0,
3
0.0,
30
.0,
30
.0,
30
.0,
3
0.0,
30
.0,
30
.0,
3
0.0,
30
.0, 30.0, 10.0,
10.0, 10.0, 10.0, 10.0, 10.0,
30
.0, 3
0
.0,
30
.0,
30
.0,
30
.0
9
0.0,
9
0.0,
9
0.0,
9
0.0,
9
0.0,
9
0.0,
9
0.0,
9
0.0,
9
0.0,
9
0.0,
85
.0,
81
.0,
75
.0,
7
0.0,
64
.0,
57
.0,
5
0.0,
41
.0, 30.0, 10.0,
10.0, 10.0, 10.0, 10.0, 10.0,
12
.0,
1
3.0,
16
.0,
19
.0,
22
.0
},
(float) {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0
}
}
{ "test_10_I", "value", 30, (float) {
...
...
@@ -56,14 +56,14 @@ params {
}
{ "test_10_Ilim", "value", 30,
(float) {
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
300
.0,
10.0, 10.0, 10.0, 10.0, 10.0,
300
.0,
300
.0, 30
0
.0,
300
.0,
300
.0
283
.0,
283
.0,
283
.0,
283
.0,
283
.0,
283
.0,
283
.0,
283
.0,
283
.0,
283
.0,
281
.0,
267
.0,
252
.0,
235
.0,
217
.0,
198
.0,
177
.0,
153
.0,
124
.0,
85
.0,
10.0, 10.0, 10.0, 10.0, 10.0,
12
.0,
22
.0, 30.0,
44
.0,
54
.0
},
(float) {
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0
.0,
0
.0,
0
.0,
0
.0,
0
.0
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0,
0.0, 0.0, 0.0, 0.0, 0.0,
1
.0,
1
.0,
1
.0,
1
.0,
1
.0
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment