Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
BREMS/derived.h@192:3152a86cd108, 2018-02-10 (annotated)
- Committer:
- bwang
- Date:
- Sat Feb 10 03:58:36 2018 +0000
- Revision:
- 192:3152a86cd108
- Parent:
- 190:01674f19f9ce
- Child:
- 196:7172e6e28867
02/09/2018 22:58 - everything but main.cpp and friends moved to flash configuration
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bwang | 185:5c102874b490 | 1 | /* |
| bwang | 185:5c102874b490 | 2 | *derived macros for the controller |
| bwang | 185:5c102874b490 | 3 | *don't change these unless you know what you're doing! |
| bwang | 185:5c102874b490 | 4 | */ |
| bwang | 185:5c102874b490 | 5 | |
| bwang | 185:5c102874b490 | 6 | #ifndef __DERIVED_H |
| bwang | 185:5c102874b490 | 7 | #define __DERIVED_H |
| bwang | 185:5c102874b490 | 8 | |
| bwang | 189:760cd81a7633 | 9 | #include "layout.h" |
| bwang | 189:760cd81a7633 | 10 | #include "prefs.h" |
| bwang | 185:5c102874b490 | 11 | |
| bwang | 189:760cd81a7633 | 12 | /*max modulation depth at which inverter is still linear*/ |
| bwang | 185:5c102874b490 | 13 | #define LINEAR_MODULATION_MAX (2.f * LINEAR_DTC_MAX - 1.f) |
| bwang | 185:5c102874b490 | 14 | |
| bwang | 185:5c102874b490 | 15 | /*internally computed loop parameters*/ |
| bwang | 190:01674f19f9ce | 16 | #define KP_D (_K_LOOP_D / _BUS_VOLTAGE / LINEAR_MODULATION_MAX) |
| bwang | 190:01674f19f9ce | 17 | #define KI_D (_KI_BASE_D * _K_LOOP_D / _BUS_VOLTAGE * 5000.0f / _F_SW / LINEAR_MODULATION_MAX) |
| bwang | 185:5c102874b490 | 18 | |
| bwang | 190:01674f19f9ce | 19 | #define KP_Q (_K_LOOP_Q / _BUS_VOLTAGE / LINEAR_MODULATION_MAX) |
| bwang | 190:01674f19f9ce | 20 | #define KI_Q (_KI_BASE_Q * _K_LOOP_Q / _BUS_VOLTAGE * 5000.0f / _F_SW / LINEAR_MODULATION_MAX) |
| bwang | 185:5c102874b490 | 21 | |
| bwang | 189:760cd81a7633 | 22 | #define SLOW_LOOP_COUNTER ((int) (_F_SW / _F_SLOW_LOOP)) |
| bwang | 185:5c102874b490 | 23 | |
| bwang | 185:5c102874b490 | 24 | #endif |