Skip to content
GitLab
Menu
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 Voltage mode
Commits
dbbfda61
Commit
dbbfda61
authored
Sep 06, 2021
by
Clément Foucher
Browse files
Rename library as there is now a "PID Current" library.
parent
c0f35565
Changes
3
Hide whitespace changes
Inline
Side-by-side
library.json
View file @
dbbfda61
{
"name"
:
"opalib_pid"
,
"version"
:
"
1
.0.
1
"
,
"name"
:
"opalib_pid
_voltage
"
,
"version"
:
"
2
.0.
0
"
,
"description"
:
"OwnTech Power API Library for PID in voltage mode."
,
"keywords"
:
"OwnTech Power API"
}
src/opalib_pid.c
→
src/opalib_pid
_voltage
.c
View file @
dbbfda61
...
...
@@ -39,7 +39,7 @@
#include
"data_conversion.h"
// Current file header
#include
"opalib_pid.h"
#include
"opalib_pid
_voltage
.h"
/////
...
...
@@ -80,7 +80,7 @@ static uint16_t pwm_period, pwm_phase_shift, pwm_low_pulse_width, pwm_high_pulse
* This function initializes all the parameters
* needed for the PID calculation for the buck topoligy
*/
void
pid
_init_buck
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
,
uint32_t
task_period_us
)
void
opalib_pid_voltage
_init_buck
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
,
uint32_t
task_period_us
)
{
pwm_period
=
leg_period
();
pwm_phase_shift
=
pwm_period
/
2
;
...
...
@@ -102,7 +102,7 @@ void pid_init_buck(float32_t vref, float32_t kp, float32_t ki, float32_t kd, uin
* This function initializes all the parameters
* needed for the PID calculation for the boost topoligy
*/
void
pid
_init_boost
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
,
uint32_t
task_period_us
)
void
opalib_pid_voltage
_init_boost
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
,
uint32_t
task_period_us
)
{
pwm_phase_shift
=
pwm_period
/
2
;
pwm_low_pulse_width
=
pwm_period
*
LOW_DUTY
;
...
...
@@ -124,7 +124,7 @@ void pid_init_boost(float32_t vref, float32_t kp, float32_t ki, float32_t kd, ui
* This function calculation of the PID for the chosen
* topology and set the new duty cycle in the hrtim PWM
*/
void
pid
_calculation_and_pwm_update
()
void
opalib_pid_voltage
_calculation_and_pwm_update
()
{
// Conversion of the raw data from measures
data_conversion
();
...
...
src/opalib_pid.h
→
src/opalib_pid
_voltage
.h
View file @
dbbfda61
...
...
@@ -22,8 +22,8 @@
* @author Antoine Boche <antoine.boche@laas.fr>
*/
#ifndef OPALIB_PID_H_
#define OPALIB_PID_H_
#ifndef OPALIB_PID_
VOLTAGE_
H_
#define OPALIB_PID_
VOLTAGE_
H_
#include
<arm_math.h>
// adds all the CMSIS library
...
...
@@ -40,7 +40,7 @@ extern "C" {
* @param[in] ki ki for PID
* @param[in] kd kd for PID
*/
void
pid
_init_buck
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
,
uint32_t
task_period_us
);
void
opalib_pid_voltage
_init_buck
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
,
uint32_t
task_period_us
);
/**
* @brief This function Initialize all the parameters
...
...
@@ -51,13 +51,13 @@ void pid_init_buck(float32_t vref, float32_t kp, float32_t ki, float32_t kd, uin
* @param[in] ki ki for PID
* @param[in] kd kd for PID
*/
void
pid
_init_boost
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
,
uint32_t
task_period_us
);
void
opalib_pid_voltage
_init_boost
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
,
uint32_t
task_period_us
);
/**
* @brief This function calculation of the PID for the chosen
* topology and set the new duty cycle in the hrtim PWM
*/
void
pid
_calculation_and_pwm_update
();
void
opalib_pid_voltage
_calculation_and_pwm_update
();
void
test
();
...
...
@@ -65,5 +65,5 @@ void test();
}
#endif
#endif // OPALIB_PID_H_
#endif // OPALIB_PID_
VOLTAGE_
H_
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