Bayley Wang / foc-ed_in_the_bot_compact

robot

Dependencies:   FastPWM3 mbed

Committer:
bwang
Date:
Tue Feb 28 03:32:21 2017 +0000
Revision:
79:d0b1bb3dcf68
Parent:
75:591556ce033d
Child:
88:703780322d5b
added FlashWriter class

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bwang15:b583cd30b063 1#ifndef __CONFIG_LOOP_H
bwang15:b583cd30b063 2#define __CONFIG_LOOP_H
bwang15:b583cd30b063 3
bwang22:72840d3db788 4#include "config_inverter.h"
bwang22:72840d3db788 5
bwang62:581aa9235ad6 6#define K_LOOP_D 2.5f
bwang62:581aa9235ad6 7#define KI_BASE_D 0.025f
bwang62:581aa9235ad6 8
bwang62:581aa9235ad6 9#define K_LOOP_Q 6.0f
bwang62:581aa9235ad6 10#define KI_BASE_Q 0.01f
bwang62:581aa9235ad6 11
bwang76:c66014e50384 12#define F_SLOW_LOOP 100.0f
bwang15:b583cd30b063 13
bwang15:b583cd30b063 14#define INTEGRAL_MAX 1.0f
bwang15:b583cd30b063 15
bwang39:80b38a8e1787 16/*filter strengths, 0-1.0
bwang39:80b38a8e1787 17 higher = stronger filtering*/
bwang24:5e18a87a0e95 18#define W_FILTER_STRENGTH 0.99f
bwang64:b4175385d718 19#define DQ_FILTER_STRENGTH 0.95f
bwang75:591556ce033d 20#define THROTTLE_FILTER_STRENGTH 0.0f
bwang74:f10cb573d7ca 21
bwang15:b583cd30b063 22
bwang44:3fd6a43b91f0 23/*internally computed*/
bwang58:7316c5a4c417 24#define KP_D (K_LOOP_D / BUS_VOLTAGE)
bwang58:7316c5a4c417 25#define KI_D (KI_BASE_D * K_LOOP_D / BUS_VOLTAGE * 5000.0f / F_SW)
bwang58:7316c5a4c417 26
bwang58:7316c5a4c417 27#define KP_Q (K_LOOP_Q / BUS_VOLTAGE)
bwang58:7316c5a4c417 28#define KI_Q (KI_BASE_Q * K_LOOP_Q / BUS_VOLTAGE * 5000.0f / F_SW)
bwang58:7316c5a4c417 29
bwang44:3fd6a43b91f0 30#define SLOW_LOOP_COUNTER ((int) (F_SW / F_SLOW_LOOP))
bwang44:3fd6a43b91f0 31
bwang15:b583cd30b063 32#endif