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.
Config/current_controller_config.h@0:5216ca879852, 2021-10-22 (annotated)
- Committer:
- kevincheng
- Date:
- Fri Oct 22 07:43:47 2021 +0000
- Revision:
- 0:5216ca879852
a controller for micro motor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kevincheng | 0:5216ca879852 | 1 | #ifndef CURRENT_CONTROLLER_CONFIG_H |
kevincheng | 0:5216ca879852 | 2 | #define CURRENT_CONTROLLER_CONFIG_H |
kevincheng | 0:5216ca879852 | 3 | |
kevincheng | 0:5216ca879852 | 4 | // Current controller/// |
kevincheng | 0:5216ca879852 | 5 | #define K_D .05f // Loop gain, Volts/Amp |
kevincheng | 0:5216ca879852 | 6 | #define K_Q .05f // Loop gain, Volts/Amp |
kevincheng | 0:5216ca879852 | 7 | //#define K_SCALE 0.0001f // K_loop/Loop BW (Hz) 0.0042 |
kevincheng | 0:5216ca879852 | 8 | #define K_SCALE 0.00165f |
kevincheng | 0:5216ca879852 | 9 | // #define K_SCALE 0.0008 |
kevincheng | 0:5216ca879852 | 10 | //#define K_SCALE 0.0004 |
kevincheng | 0:5216ca879852 | 11 | #define KI_D 0.0255f // PI zero, in radians per sample |
kevincheng | 0:5216ca879852 | 12 | #define KI_Q 0.0255f // PI zero, in radians per sample |
kevincheng | 0:5216ca879852 | 13 | #define V_BUS 24.0f // Volts |
kevincheng | 0:5216ca879852 | 14 | #define OVERMODULATION 1.2f // 1.0 = no overmodulation |
kevincheng | 0:5216ca879852 | 15 | |
kevincheng | 0:5216ca879852 | 16 | #define D_INT_LIM V_BUS/(K_D*KI_D) // Amps*samples |
kevincheng | 0:5216ca879852 | 17 | #define Q_INT_LIM V_BUS/(K_Q*KI_Q) // Amps*samples |
kevincheng | 0:5216ca879852 | 18 | |
kevincheng | 0:5216ca879852 | 19 | #define I_MAX 40.0f |
kevincheng | 0:5216ca879852 | 20 | |
kevincheng | 0:5216ca879852 | 21 | //Observer// |
kevincheng | 0:5216ca879852 | 22 | #define DT 0.000025f |
kevincheng | 0:5216ca879852 | 23 | #define K_O 0.02f |
kevincheng | 0:5216ca879852 | 24 | |
kevincheng | 0:5216ca879852 | 25 | |
kevincheng | 0:5216ca879852 | 26 | |
kevincheng | 0:5216ca879852 | 27 | |
kevincheng | 0:5216ca879852 | 28 | #endif |