Bayley Wang / foc-ed_in_the_bot_compact

robot

Dependencies:   FastPWM3 mbed

config_motor.h

Committer:
bwang
Date:
3 weeks ago
Revision:
155:7c6005933d4c
Parent:
131:031df63c7dbc

File content as of revision 155:7c6005933d4c:

#ifndef __CONFIG_MOTOR_H
#define __CONFIG_MOTOR_H

/*# of pole pairs*/
#define POLE_PAIRS 3.0f

/*electrical position offset,
  measured as +a, -b, -c (radians)*/
#define POS_OFFSET 5.7614f

/*# of resolver lobes*/
#define RESOLVER_LOBES 3.0f

/*CPR of encoder or encoder emulator*/
#define CPR 4096

/*d and q axis inductances, henries*/
#define Ld 0.000605f
#define Lq 0.001536f

/*PM flux linkage, volt-seconds*/
#define FLUX_LINKAGE 0.0529f

/*torque/phase amp for approximate models*/
#define KT 0.3f

/*a safe speed below which you 
  never need to field weaken*/
#define W_SAFE 100.0f

/*maximum sane mechanical speed,
  used to filter velocity (rad/s)*/
#define W_CRAZY 2000.0f

#define PI 3.141593f

#endif