Bayley Wang / foc-ed_in_the_bot_compact

robot

Dependencies:   FastPWM3 mbed

Committer:
bwang
Date:
Thu May 04 17:35:10 2017 +0000
Revision:
155:7c6005933d4c
Parent:
131:031df63c7dbc
05/04/2017 13:34 - changed logic in PwmIn::handle_fall, which no longer resets timer on invalid edges

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bwang15:b583cd30b063 1#ifndef __CONFIG_MOTOR_H
bwang15:b583cd30b063 2#define __CONFIG_MOTOR_H
bwang15:b583cd30b063 3
bwang39:80b38a8e1787 4/*# of pole pairs*/
bwang15:b583cd30b063 5#define POLE_PAIRS 3.0f
bwang39:80b38a8e1787 6
bwang97:785be556c06d 7/*electrical position offset,
bwang39:80b38a8e1787 8 measured as +a, -b, -c (radians)*/
bwang131:031df63c7dbc 9#define POS_OFFSET 5.7614f
bwang39:80b38a8e1787 10
bwang39:80b38a8e1787 11/*# of resolver lobes*/
bwang15:b583cd30b063 12#define RESOLVER_LOBES 3.0f
bwang39:80b38a8e1787 13
bwang39:80b38a8e1787 14/*CPR of encoder or encoder emulator*/
bwang15:b583cd30b063 15#define CPR 4096
bwang29:50e6e4e46580 16
bwang39:80b38a8e1787 17/*d and q axis inductances, henries*/
bwang114:095a77fcf53b 18#define Ld 0.000605f
bwang114:095a77fcf53b 19#define Lq 0.001536f
bwang30:c25c5bf0d951 20
bwang39:80b38a8e1787 21/*PM flux linkage, volt-seconds*/
bwang116:aab9ed9586b9 22#define FLUX_LINKAGE 0.0529f
bwang39:80b38a8e1787 23
bwang42:030e0ec4eac5 24/*torque/phase amp for approximate models*/
bwang42:030e0ec4eac5 25#define KT 0.3f
bwang42:030e0ec4eac5 26
bwang55:3568b78dc203 27/*a safe speed below which you
bwang55:3568b78dc203 28 never need to field weaken*/
bwang55:3568b78dc203 29#define W_SAFE 100.0f
bwang55:3568b78dc203 30
bwang39:80b38a8e1787 31/*maximum sane mechanical speed,
bwang39:80b38a8e1787 32 used to filter velocity (rad/s)*/
bwang139:d5ef8d1936f8 33#define W_CRAZY 2000.0f
bwang29:50e6e4e46580 34
bwang15:b583cd30b063 35#define PI 3.141593f
bwang15:b583cd30b063 36
bwang15:b583cd30b063 37#endif