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.
Diff: Defaults/derived.h
- Revision:
- 185:5c102874b490
diff -r 633119bb0b77 -r 5c102874b490 Defaults/derived.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Defaults/derived.h Fri Feb 09 22:19:52 2018 +0000 @@ -0,0 +1,23 @@ +/* + *derived macros for the controller + *don't change these unless you know what you're doing! + */ + +#ifndef __DERIVED_H +#define __DERIVED_H + +#include "defaults.h" + +/*max modulation depth at which inveter is still linear*/ +#define LINEAR_MODULATION_MAX (2.f * LINEAR_DTC_MAX - 1.f) + +/*internally computed loop parameters*/ +#define KP_D (K_LOOP_D / BUS_VOLTAGE / LINEAR_MODULATION_MAX) +#define KI_D (KI_BASE_D * K_LOOP_D / BUS_VOLTAGE * 5000.0f / F_SW / LINEAR_MODULATION_MAX) + +#define KP_Q (K_LOOP_Q / BUS_VOLTAGE / LINEAR_MODULATION_MAX) +#define KI_Q (KI_BASE_Q * K_LOOP_Q / BUS_VOLTAGE * 5000.0f / F_SW / LINEAR_MODULATION_MAX) + +#define SLOW_LOOP_COUNTER ((int) (F_SW / F_SLOW_LOOP)) + +#endif \ No newline at end of file