![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Clone per testare Mbed studio
Dependencies: PwmIn IONMcMotor MPU6050 Eigen ROVER
Fork of Hyfliers_Completo_testato by
controlDefineVariables.h@11:d93fbd8e02e9, 2022-07-27 (annotated)
- Committer:
- aledek
- Date:
- Wed Jul 27 09:37:11 2022 +0000
- Revision:
- 11:d93fbd8e02e9
- Parent:
- 10:62e9b61ed1ad
first commit,
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
anfontanelli | 6:584653235830 | 1 | #ifndef CONTROL_DEFINE_VARIABLES_H |
anfontanelli | 6:584653235830 | 2 | #define CONTROL_DEFINE_VARIABLES_H |
anfontanelli | 6:584653235830 | 3 | |
aledek | 10:62e9b61ed1ad | 4 | //NUCLEO-F767ZI |
aledek | 10:62e9b61ed1ad | 5 | #define FRONT_ION_TX PB_9 |
aledek | 10:62e9b61ed1ad | 6 | #define FRONT_ION_RX PB_8 |
aledek | 10:62e9b61ed1ad | 7 | #define REAR_ION_TX PG_14 |
aledek | 10:62e9b61ed1ad | 8 | #define REAR_ION_RX PG_9 |
aledek | 10:62e9b61ed1ad | 9 | #define MPU_SDA PF_15 |
aledek | 10:62e9b61ed1ad | 10 | #define MPU_SCL PF_14 |
aledek | 10:62e9b61ed1ad | 11 | #define SERVO_1 PE_11 //actx1 |
aledek | 10:62e9b61ed1ad | 12 | #define SERVO_2 PE_9 //actx2 |
aledek | 10:62e9b61ed1ad | 13 | #define LED_ORANGE PG_2 |
aledek | 10:62e9b61ed1ad | 14 | #define LED_RED PG_3 |
aledek | 10:62e9b61ed1ad | 15 | #define LOOP_HB PE_6 |
anfontanelli | 6:584653235830 | 16 | |
aledek | 10:62e9b61ed1ad | 17 | //NUCLEO-H743ZI2 |
aledek | 10:62e9b61ed1ad | 18 | /* |
aledek | 10:62e9b61ed1ad | 19 | #define FRONT_ION_TX PB_9 |
aledek | 10:62e9b61ed1ad | 20 | #define FRONT_ION_RX PB_8 |
aledek | 10:62e9b61ed1ad | 21 | #define REAR_ION_TX PB_6 |
aledek | 10:62e9b61ed1ad | 22 | #define REAR_ION_RX PB_7 |
aledek | 10:62e9b61ed1ad | 23 | #define MPU_SDA PB_11 |
aledek | 10:62e9b61ed1ad | 24 | #define MPU_SCL PB_10 |
aledek | 10:62e9b61ed1ad | 25 | */ |
aledek | 10:62e9b61ed1ad | 26 | /* motor defines*/ |
anfontanelli | 6:584653235830 | 27 | #define ionMcBoudRate 460800 |
anfontanelli | 6:584653235830 | 28 | #define frontBoardAddress 128 |
anfontanelli | 6:584653235830 | 29 | #define frontMotorGearBoxRatio 103 |
anfontanelli | 6:584653235830 | 30 | #define frontEncoderPulse 512 |
anfontanelli | 6:584653235830 | 31 | #define frontKt 0.00667 |
anfontanelli | 6:584653235830 | 32 | #define frontTransmissionRatio 1.0 |
anfontanelli | 6:584653235830 | 33 | #define retroTransmissionRatio 1.0 |
anfontanelli | 6:584653235830 | 34 | #define retroBoardAddress 129 |
anfontanelli | 6:584653235830 | 35 | #define retroMotorGearBoxRatio 103 |
anfontanelli | 6:584653235830 | 36 | #define retroEncoderPulse 512 |
anfontanelli | 6:584653235830 | 37 | #define retroKt 0.00667 |
anfontanelli | 6:584653235830 | 38 | |
aledek | 10:62e9b61ed1ad | 39 | /* rover geometric parameters */ |
aledek | 10:62e9b61ed1ad | 40 | #define r_wheels_ 0.0300 //wheels radius |
aledek | 10:62e9b61ed1ad | 41 | #define longitudinalSemiDist_ 0.1980 //distance from center to front and rear axle |
aledek | 10:62e9b61ed1ad | 42 | #define lateralSemiDist_ 0.0767 //distance from center to left and right contact point (arc on pipe) |
aledek | 10:62e9b61ed1ad | 43 | |
aledek | 10:62e9b61ed1ad | 44 | /* IMU defines*/ |
anfontanelli | 6:584653235830 | 45 | #define FS_a 8192 //per avere letture in g, sarebbe 32768/4 perchè 4g è il fondo scala |
anfontanelli | 6:584653235830 | 46 | #define FS_g 131.072 //per avere letture in gradi/s, sarebbe 32768/250 perchè 250 è il fondo scala |
anfontanelli | 6:584653235830 | 47 | |
aledek | 10:62e9b61ed1ad | 48 | /* control parameters*/ |
aledek | 10:62e9b61ed1ad | 49 | #define dtBoard_ 0.002 |
aledek | 10:62e9b61ed1ad | 50 | #define wheelsAcceleration_ 20000 |
aledek | 10:62e9b61ed1ad | 51 | #define Kp_stabilization_ 0.28 //0.3 |
aledek | 10:62e9b61ed1ad | 52 | #define Kd_stabilization_ 0.08 //TODO LOWER |
aledek | 10:62e9b61ed1ad | 53 | |
aledek | 10:62e9b61ed1ad | 54 | /* RC PWMs defines */ |
aledek | 10:62e9b61ed1ad | 55 | // avanzamento |
aledek | 10:62e9b61ed1ad | 56 | #define minPwmVel_ 1020.0 //[us] |
aledek | 10:62e9b61ed1ad | 57 | #define maxPwmVel_ 1980.0 //[us] |
aledek | 10:62e9b61ed1ad | 58 | #define zeroPwmVel_ 1500.0 //[us] |
aledek | 10:62e9b61ed1ad | 59 | #define deadzoneVel_ 10.0 //[us] |
aledek | 10:62e9b61ed1ad | 60 | #define maxVel_ 0.05 //[m/s] |
aledek | 10:62e9b61ed1ad | 61 | // switch modalità |
aledek | 10:62e9b61ed1ad | 62 | #define downLo_ 900.0 //[us] |
aledek | 10:62e9b61ed1ad | 63 | #define downHi_ 1100.0 //[us] |
aledek | 10:62e9b61ed1ad | 64 | #define centerLo_ 1400.0 //[us] |
aledek | 10:62e9b61ed1ad | 65 | #define centerHi_ 1600.0 //[us] |
aledek | 10:62e9b61ed1ad | 66 | #define upLo_ 1900.0 //[us] |
aledek | 10:62e9b61ed1ad | 67 | #define upHi_ 2100.0 //[us] |
aledek | 10:62e9b61ed1ad | 68 | #define constTravelVel_ 0.005 //[m/s] .5 cm/s |
anfontanelli | 6:584653235830 | 69 | |
anfontanelli | 6:584653235830 | 70 | |
anfontanelli | 6:584653235830 | 71 | #endif |