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:
142:0e0a164feb4c
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
bwang19:a6cf15f89f3d 1#ifndef __CONFIG_PINS_H
bwang19:a6cf15f89f3d 2#define __CONFIG_PINS_H
bwang19:a6cf15f89f3d 3
bwang24:5e18a87a0e95 4#define PWMA PA_8
bwang24:5e18a87a0e95 5#define PWMB PA_9
bwang19:a6cf15f89f3d 6#define PWMC PA_10
bwang19:a6cf15f89f3d 7#define EN PB_15
bwang19:a6cf15f89f3d 8
bwang19:a6cf15f89f3d 9#define IA PA_4
bwang19:a6cf15f89f3d 10#define IB PB_0
bwang19:a6cf15f89f3d 11
bwang19:a6cf15f89f3d 12#define TH_PIN PB_8
bwang151:5bbb15351798 13#define TH_LIMIT_LOW 1050 //uS
bwang136:607bdeb17e2f 14#define TH_LIMIT_HIGH 1950
bwang19:a6cf15f89f3d 15
bwang19:a6cf15f89f3d 16#define I_SCALE_RAW 25.0f //mv/A
bwang19:a6cf15f89f3d 17#define R_UP 12000.0f //ohms
bwang19:a6cf15f89f3d 18#define R_DOWN 3600.0f //ohms
bwang19:a6cf15f89f3d 19#define R_BIAS 3600.0f //ohms
bwang19:a6cf15f89f3d 20#define AVDD 3300.0f //mV
bwang19:a6cf15f89f3d 21
bwang19:a6cf15f89f3d 22#define I_OFFSET (AVDD * R_DOWN * R_UP / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
bwang19:a6cf15f89f3d 23#define I_SCALE (R_BIAS * R_DOWN * I_SCALE_RAW / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
bwang19:a6cf15f89f3d 24
bwang19:a6cf15f89f3d 25#define set_dtc(phase, value) *phase = (value)
bwang19:a6cf15f89f3d 26
bwang19:a6cf15f89f3d 27#endif