... | ... | @@ -4,20 +4,28 @@ |
|
|
|
|
|
OwnTech Power API Library PID Current mode provides a PID control in current mode.
|
|
|
|
|
|
To enable it, add the following lines to the `lib_deps` section of file `src/owntech.ini` in OwnTech Power API:
|
|
|
```
|
|
|
pid_current=https://gitlab.laas.fr/owntech/power-api/opalib-pid-current-mode.git
|
|
|
# How to use
|
|
|
|
|
|
## Enable the library
|
|
|
|
|
|
To enable the library, just uncomment the `pid_current` library in `src/owntech.ini`.
|
|
|
|
|
|
Then, include the library header in `main.cpp`:
|
|
|
|
|
|
```c
|
|
|
#include "opalib_pid_current.h"
|
|
|
```
|
|
|
|
|
|
# Library structure
|
|
|
_Memo: the standalone PID Current library configuration is as follows:_
|
|
|
|
|
|
* `$(PROJECTDIR)/src/`
|
|
|
* `opalib_pid_current_mode.c` Main source file
|
|
|
* `opalib_pid_current_mode.h` List of public functions implemented in library
|
|
|
```plaintext
|
|
|
pid_current=https://gitlab.laas.fr/owntech/power-api/opalib-pid-current-mode.git
|
|
|
```
|
|
|
|
|
|
# How to use
|
|
|
## Using OPALIB PID Current
|
|
|
|
|
|
* Add the following line to your main: `#include "opalib_pid_current_mode.h"`.
|
|
|
* Configure the core modules, e.g. using [OPALIB Quick Start](https://gitlab.laas.fr/owntech/power-api/opalib-quick-start/-/wikis/home)'s init voltage function at the beginning of your `main()`.
|
|
|
* Initialize the pid with `opalib_pid_current_init()`
|
|
|
* Run the PID calculation periodically with `opalib_pid_current_periodic_task()` in order to update the duty cycle in the PWM.
|
|
|
|
... | ... | @@ -34,4 +42,10 @@ void main(void) |
|
|
|
|
|
opalib_quick_start_launch_task();
|
|
|
}
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
```
|
|
|
|
|
|
# Library structure
|
|
|
|
|
|
* `$(PROJECTDIR)/src/`
|
|
|
* `opalib_pid_current_mode.c` Main source file
|
|
|
* `opalib_pid_current_mode.h` List of public functions implemented in library |
|
|
\ No newline at end of file |