Fork and fix for mwork

Dependencies:   mbed-dev-f303 FastPWM3 millis

Committer:
benkatz
Date:
Mon May 01 15:22:58 2017 +0000
Revision:
26:2b865c00d7e9
Parent:
25:f5741040c4bb
Child:
28:8c7e29f719c5
- Added CAN Send/Receive; - Updated to most recent MBED (Broke SPI 16-bit read/write.  Hacked to work with 2 8-bit writes now); - Removed most sine/cos calculations; - Fixed sign error in autocalibration routine

Who changed what in which revision?

UserRevisionLine numberNew contents of line
benkatz 23:2adf23ee0305 1 /// Values stored in flash, which are modifieable by user actions ///
benkatz 23:2adf23ee0305 2
benkatz 23:2adf23ee0305 3 #ifndef USER_CONFIG_H
benkatz 23:2adf23ee0305 4 #define USER_CONFIG_H
benkatz 23:2adf23ee0305 5
benkatz 23:2adf23ee0305 6
benkatz 25:f5741040c4bb 7 #define E_OFFSET __float_reg[0] // Encoder electrical offset
benkatz 25:f5741040c4bb 8 #define M_OFFSET __float_reg[1] // Encoder mechanical offset
benkatz 25:f5741040c4bb 9 #define I_BW __float_reg[2] // Current loop bandwidth
benkatz 25:f5741040c4bb 10 #define TORQUE_LIMIT __float_reg[3] // Torque limit (current limit = torque_limit/(kt*gear ratio))
benkatz 26:2b865c00d7e9 11 #define THETA_MIN __float_reg[4] // Minimum position setpoint
benkatz 26:2b865c00d7e9 12 #define THETA_MAX __float_reg[5] // Maximum position setpoint
benkatz 23:2adf23ee0305 13
benkatz 25:f5741040c4bb 14 #define PHASE_ORDER __int_reg[0] // Phase swapping during calibration
benkatz 25:f5741040c4bb 15 #define CAN_ID __int_reg[1] // CAN bus ID
benkatz 26:2b865c00d7e9 16 #define CAN_MASTER __int_reg[2] // CAN bus "master" ID
benkatz 25:f5741040c4bb 17 #define ENCODER_LUT __int_reg[4] // Encoder offset LUT - 128 elements long
benkatz 23:2adf23ee0305 18
benkatz 23:2adf23ee0305 19 extern float __float_reg[];
benkatz 23:2adf23ee0305 20 extern int __int_reg[];
benkatz 23:2adf23ee0305 21
benkatz 23:2adf23ee0305 22 #endif