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
3422c03b
Commit
3422c03b
authored
Jun 09, 2021
by
Clément Foucher
Browse files
Missing call to data conversion.
parent
93f11e79
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pid.c
View file @
3422c03b
...
@@ -34,13 +34,12 @@
...
@@ -34,13 +34,12 @@
// Drivers
// Drivers
#include "leg.h" // PWM management layer by inverter leg interface
#include "leg.h" // PWM management layer by inverter leg interface
#include "owntech_leg_driver.h" // PWM management layer by inverter leg interface
// Application
// Application
#include "data_conversion.h"
#include "data_conversion.h"
// Current file header
// Current file header
#include "pid.h"
#include "
opalib_
pid.h"
/////
/////
...
@@ -51,10 +50,6 @@
...
@@ -51,10 +50,6 @@
#define HIGH_DUTY 0.9
#define HIGH_DUTY 0.9
/////
// Global variables
/////
/////
// Local variables
// Local variables
...
@@ -119,6 +114,9 @@ void pid_init_boost(float32_t vref, float32_t kp, float32_t ki, float32_t kd)
...
@@ -119,6 +114,9 @@ void pid_init_boost(float32_t vref, float32_t kp, float32_t ki, float32_t kd)
*/
*/
void
pid_calculation_and_pwm_update
()
void
pid_calculation_and_pwm_update
()
{
{
// Conversion of the raw data from measures
data_conversion
();
// PID CALCUALTIONS
// PID CALCUALTIONS
V1_value
=
get_value_converted
(
2
,
0
);
V1_value
=
get_value_converted
(
2
,
0
);
arm_sub_f32
(
&
V1_value
,
&
Vref
,
&
error_pid
,
1
);
// CALCULATING THE ERROR BASED ON THE REFERENCE
arm_sub_f32
(
&
V1_value
,
&
Vref
,
&
error_pid
,
1
);
// CALCULATING THE ERROR BASED ON THE REFERENCE
...
...
src/pid.h
View file @
3422c03b
...
@@ -22,8 +22,8 @@
...
@@ -22,8 +22,8 @@
* @author Antoine Boche <antoine.boche@laas.fr>
* @author Antoine Boche <antoine.boche@laas.fr>
*/
*/
#ifndef PID_H_
#ifndef
OPALIB_
PID_H_
#define PID_H_
#define
OPALIB_
PID_H_
#include <arm_math.h> // adds all the CMSIS library
#include <arm_math.h> // adds all the CMSIS library
...
@@ -34,12 +34,22 @@ extern "C" {
...
@@ -34,12 +34,22 @@ extern "C" {
/**
/**
* @brief This function Initialize all the parameters
* @brief This function Initialize all the parameters
* needed for the PID calculation for the buck topoligy
* needed for the PID calculation for the buck topoligy
*
* @param[in] vref Reference voltage for the PID
* @param[in] kp kp for PID
* @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
);
void
pid_init_buck
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
);
/**
/**
* @brief This function Initialize all the parameters
* @brief This function Initialize all the parameters
* needed for the PID calculation for the buck topoligy
* needed for the PID calculation for the buck topoligy
*
* @param[in] vref Reference voltage for the PID
* @param[in] kp kp for PID
* @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
);
void
pid_init_boost
(
float32_t
vref
,
float32_t
kp
,
float32_t
ki
,
float32_t
kd
);
...
@@ -54,4 +64,5 @@ void pid_calculation_and_pwm_update();
...
@@ -54,4 +64,5 @@ void pid_calculation_and_pwm_update();
}
}
#endif
#endif
#endif // PID_H_
#endif // OPALIB_PID_H_
Write
Preview
Markdown
is supported
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