Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OwnTech
Power API
OPALIB PID Current mode
Commits
38c0b236
Commit
38c0b236
authored
Jul 17, 2021
by
Clément Foucher
Browse files
Compute slope on first task start instead of init so that driver is initialized.
parent
2ee8c7e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/opalib_pid_current_mode.c
View file @
38c0b236
...
...
@@ -167,8 +167,6 @@ void opalib_pid_current_init(double setpoint, double p_i, double i_i, double d_i
p
=
p_i
;
i
=
i_i
;
d
=
d_i
;
_opalib_pid_current_compute_slope
();
}
void
opalib_pid_current_update_setpoint
(
double
setpoint
)
...
...
@@ -180,6 +178,13 @@ void opalib_pid_current_update_setpoint(double setpoint)
void
opalib_pid_current_periodic_task
()
{
static
uint8_t
first_run
=
1
;
if
(
first_run
==
1
)
{
_opalib_pid_current_compute_slope
();
first_run
=
0
;
}
_opalib_pid_current_acquire_dac_values
();
_opalib_pid_current_compute_reset_value
();
_opalib_pid_current_update_reset_value
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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