robot

Dependencies:   FastPWM3 mbed

Committer:
bwang
Date:
Thu Apr 06 17:33:47 2017 +0000
Revision:
92:a9dac72d8cac
Parent:
90:2ef53b1a22de
Child:
133:a5417cabea47
--PwmIn now checks lower bounds for sanity and fall without rise; --switched to edge aligned pwm to work around prius module propagation delays

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
bwang92:a9dac72d8cac 13#define TH_LIMIT_CRAZY_LOW 1000 //uS
bwang92:a9dac72d8cac 14#define TH_LIMIT_LOW 1050
bwang90:2ef53b1a22de 15#define TH_LIMIT_HIGH 1850
bwang92:a9dac72d8cac 16#define TH_LIMIT_CRAZY_HI 2000
bwang19:a6cf15f89f3d 17
bwang19:a6cf15f89f3d 18#define I_SCALE_RAW 25.0f //mv/A
bwang19:a6cf15f89f3d 19#define R_UP 12000.0f //ohms
bwang19:a6cf15f89f3d 20#define R_DOWN 3600.0f //ohms
bwang19:a6cf15f89f3d 21#define R_BIAS 3600.0f //ohms
bwang19:a6cf15f89f3d 22#define AVDD 3300.0f //mV
bwang19:a6cf15f89f3d 23
bwang19:a6cf15f89f3d 24#define I_OFFSET (AVDD * R_DOWN * R_UP / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
bwang19:a6cf15f89f3d 25#define I_SCALE (R_BIAS * R_DOWN * I_SCALE_RAW / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
bwang19:a6cf15f89f3d 26
bwang19:a6cf15f89f3d 27#define set_dtc(phase, value) *phase = (value)
bwang19:a6cf15f89f3d 28
bwang19:a6cf15f89f3d 29#endif