Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
config.h
- Committer:
- bwang
- Date:
- 2016-03-27
- Revision:
- 6:561d8ab80424
- Parent:
- 5:efd3838b79a6
File content as of revision 6:561d8ab80424:
#ifndef __CONFIG_H
#define __CONFIG_H
#define set_dtc(phase, value) *phase = 1.0f - (value)
#define PWMA PA_10//PA_8
#define PWMB PA_9//PA_9
#define PWMC PA_8//PA_10
#define EN PB_15
#define POLE_PAIRS 10.0f
#define RESOLVER_LOBES 1.0f
#define IA PA_4
#define IB PB_0
#define TEST_DAC PA_5
#define PI 3.141593f
#define CPR 4096
#define POS_OFFSET 1.82f
#define I_SCALE_RAW 25.0f //mv/A
#define R_UP 12000.0f //ohms
#define R_DOWN 3600.0f //ohms
#define R_BIAS 3600.0f //ohms
#define AVDD 3300.0f //mV
#define I_OFFSET (AVDD * R_DOWN * R_UP / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
#define I_SCALE (R_BIAS * R_DOWN * I_SCALE_RAW / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
#define K_LOOP 0.02f//1.0f
#define KI_BASE .008f//0.01f
#define BUS_VOLTAGE 20.0f
#define KP (K_LOOP / BUS_VOLTAGE)
#define KI (KI_BASE * K_LOOP / BUS_VOLTAGE)
#define INTEGRAL_MAX 1.0f
#endif