Implement new controller
Dependencies: mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo
Fork of Orion_newPCB_test by
Configuration/config.h@4:315716ef8178, 2016-01-20 (annotated)
- Committer:
- akashvibhute
- Date:
- Wed Jan 20 04:01:37 2016 +0000
- Revision:
- 4:315716ef8178
- Parent:
- 2:761e3c932ce0
- Child:
- 5:099cb2e76c7d
added BNO055 wrapper to imuHandler function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akashvibhute | 2:761e3c932ce0 | 1 | /* |
akashvibhute | 2:761e3c932ce0 | 2 | * |
akashvibhute | 2:761e3c932ce0 | 3 | * config.h Virgo v3 PCB AV22032015 |
akashvibhute | 2:761e3c932ce0 | 4 | * |
akashvibhute | 2:761e3c932ce0 | 5 | */ |
akashvibhute | 2:761e3c932ce0 | 6 | |
akashvibhute | 2:761e3c932ce0 | 7 | #ifndef VirgoConfig_H |
akashvibhute | 2:761e3c932ce0 | 8 | #define VirgoConfig_H |
akashvibhute | 2:761e3c932ce0 | 9 | |
akashvibhute | 2:761e3c932ce0 | 10 | //** General Functions **************************************************************************** |
akashvibhute | 2:761e3c932ce0 | 11 | #define PC_BAUDRATE 921600 |
akashvibhute | 2:761e3c932ce0 | 12 | |
akashvibhute | 2:761e3c932ce0 | 13 | //------------------------------------------------------------------------------------------------- |
akashvibhute | 2:761e3c932ce0 | 14 | |
akashvibhute | 2:761e3c932ce0 | 15 | //** Function exectution rates ******************************************************************** |
akashvibhute | 2:761e3c932ce0 | 16 | #define Hearbeat_RateHz 10 //hearbeat loop run rate in Hz |
akashvibhute | 4:315716ef8178 | 17 | #define Hearbeat_RateMS (1000/Hearbeat_RateHz) //hearbeat loop run rate in ms |
akashvibhute | 4:315716ef8178 | 18 | |
akashvibhute | 2:761e3c932ce0 | 19 | #define imu_UpdateRateHz 200 // imu update rate in Hz |
akashvibhute | 4:315716ef8178 | 20 | #define imu_UpdatePeriodMS (1000/imu_UpdateRateHz) // imu update rate in ms |
akashvibhute | 4:315716ef8178 | 21 | |
akashvibhute | 2:761e3c932ce0 | 22 | #define motorControl_UpdateRateHz 100 // motorControl update rate in Hz |
akashvibhute | 4:315716ef8178 | 23 | #define motorControl_UpdatePeriodMS (1000/motorControl_UpdateRateHz) // motorControl update rate in ms |
akashvibhute | 4:315716ef8178 | 24 | |
akashvibhute | 2:761e3c932ce0 | 25 | #define odometry_UpdateRateHz 125 //odometry update rate in Hz |
akashvibhute | 4:315716ef8178 | 26 | #define odometry_UpdatePeriodMS (1000/odometry_UpdateRateHz) //odometry update rate in ms |
akashvibhute | 4:315716ef8178 | 27 | |
akashvibhute | 2:761e3c932ce0 | 28 | #define PrintLoop_RateHz 10 //print loop run rate in Hz |
akashvibhute | 4:315716ef8178 | 29 | #define PrintLoop_PeriodMS (1000/PrintLoop_RateHz) //print loop run rate in ms |
akashvibhute | 4:315716ef8178 | 30 | |
akashvibhute | 2:761e3c932ce0 | 31 | #define PurePursuit_UpdateRateHz 20//Pure pursuit update run rate in Hz |
akashvibhute | 4:315716ef8178 | 32 | #define PurePursuit_UpdatePeriodMS (1000/PurePursuit_UpdateRateHz)//Pure pursuit update run rate in ms |
akashvibhute | 4:315716ef8178 | 33 | |
akashvibhute | 2:761e3c932ce0 | 34 | #define WaypointCmd_UpdateRateHz 10 //waypoint commander run rate in Hz |
akashvibhute | 4:315716ef8178 | 35 | #define WaypointCmd_UpdatePeriodMS (1000/WaypointCmd_UpdateRateHz) //waypoint commander run rate in ms |
akashvibhute | 4:315716ef8178 | 36 | |
akashvibhute | 2:761e3c932ce0 | 37 | #define CommLoop_UpdateRateHz 100 //Communications loop run rate in Hz |
akashvibhute | 4:315716ef8178 | 38 | #define CommLoop_UpdatePeriodMS (1000/CommLoop_UpdateRateHz) //Communications loop run rate in ms |
akashvibhute | 4:315716ef8178 | 39 | |
akashvibhute | 2:761e3c932ce0 | 40 | #define nRfDefault_uploadRateMS 200 //default upload rate in ms for nRF wireless comm |
akashvibhute | 2:761e3c932ce0 | 41 | #define camera_OnRateMinutes 15 //default camera switch on frequency in minutes |
akashvibhute | 2:761e3c932ce0 | 42 | #define camera_CaptureTimeS 30 //default camera capture time in seconds |
akashvibhute | 2:761e3c932ce0 | 43 | //------------------------------------------------------------------------------------------------- |
akashvibhute | 2:761e3c932ce0 | 44 | |
akashvibhute | 4:315716ef8178 | 45 | |
akashvibhute | 4:315716ef8178 | 46 | //** Drivetrain ******************************************************************************** |
akashvibhute | 4:315716ef8178 | 47 | //** Motor ** |
akashvibhute | 4:315716ef8178 | 48 | #define PWMfreq_khz 20 |
akashvibhute | 2:761e3c932ce0 | 49 | |
akashvibhute | 2:761e3c932ce0 | 50 | |
akashvibhute | 2:761e3c932ce0 | 51 | #define motor_LimitRPM_min -100.0 |
akashvibhute | 2:761e3c932ce0 | 52 | #define motor_LimitRPM_max 300.0 |
akashvibhute | 2:761e3c932ce0 | 53 | |
akashvibhute | 2:761e3c932ce0 | 54 | #define motor_Acc_limit 200.0 |
akashvibhute | 2:761e3c932ce0 | 55 | |
akashvibhute | 2:761e3c932ce0 | 56 | #define PIDFf_kP 0.500 |
akashvibhute | 2:761e3c932ce0 | 57 | #define PIDFf_kI 0.900 |
akashvibhute | 2:761e3c932ce0 | 58 | #define PIDFf_kD 0.010 |
akashvibhute | 2:761e3c932ce0 | 59 | #define PIDFf_kFf 1.000 |
akashvibhute | 2:761e3c932ce0 | 60 | |
akashvibhute | 2:761e3c932ce0 | 61 | #define PIDFf_TermsLimit_min -0.3 |
akashvibhute | 2:761e3c932ce0 | 62 | #define PIDFf_TermsLimit_max 0.9 |
akashvibhute | 2:761e3c932ce0 | 63 | |
akashvibhute | 2:761e3c932ce0 | 64 | #define control_SummLimit_min -0.5 |
akashvibhute | 2:761e3c932ce0 | 65 | #define control_SummLimit_max 1.0 |
akashvibhute | 2:761e3c932ce0 | 66 | |
akashvibhute | 2:761e3c932ce0 | 67 | #define pid_MWindowSize 10 |
akashvibhute | 4:315716ef8178 | 68 | //------------- |
akashvibhute | 2:761e3c932ce0 | 69 | |
akashvibhute | 4:315716ef8178 | 70 | //** Encoder ** |
akashvibhute | 4:315716ef8178 | 71 | #define encoder_resolution 104 |
akashvibhute | 4:315716ef8178 | 72 | #define encoder_MWindowSize 12 |
akashvibhute | 4:315716ef8178 | 73 | //------------- |
akashvibhute | 2:761e3c932ce0 | 74 | //------------------------------------------------------------------------------------------------- |
akashvibhute | 2:761e3c932ce0 | 75 | |
akashvibhute | 2:761e3c932ce0 | 76 | |
akashvibhute | 4:315716ef8178 | 77 | |
akashvibhute | 2:761e3c932ce0 | 78 | |
akashvibhute | 2:761e3c932ce0 | 79 | //** Localization ********************************************************************************* |
akashvibhute | 4:315716ef8178 | 80 | //** IMU ** |
akashvibhute | 4:315716ef8178 | 81 | #define Pose_MWindowSize 10 |
akashvibhute | 4:315716ef8178 | 82 | #define GyroAcc_MWindowSize 25 |
akashvibhute | 4:315716ef8178 | 83 | |
akashvibhute | 4:315716ef8178 | 84 | //* MPU9150 * |
akashvibhute | 4:315716ef8178 | 85 | #define MPU6050_StabilizationReadings 10 //number of non deviating data points to determine if imu has stabilized |
akashvibhute | 4:315716ef8178 | 86 | #define IMU_FIFO_RATE_DIVIDER 0x01 // FIFO rate = 200Hz / (1 + this value), range 0x00 to 0x09. Here, 0x01 implies 100Hz. |
akashvibhute | 4:315716ef8178 | 87 | #define IMU_SAMPLE_RATE_DIVIDER 1 // Sample rate = 1kHz / (1 + this value), Here, 1 implies 500Hz. |
akashvibhute | 4:315716ef8178 | 88 | #define MPU6050_GYRO_FS MPU6050_GYRO_FS_2000 // measuring range of gyroscope (±n deg/s) |
akashvibhute | 4:315716ef8178 | 89 | #define MPU6050_ACCEL_FS MPU6050_ACCEL_FS_2 // measuring range of acceleration sensor (±n g) |
akashvibhute | 4:315716ef8178 | 90 | //* ** * |
akashvibhute | 4:315716ef8178 | 91 | |
akashvibhute | 4:315716ef8178 | 92 | //* BNO055 * |
akashvibhute | 4:315716ef8178 | 93 | #define BNO055_StabilizationReadings 10 //number of non deviating data points to determine if imu has stabilized |
akashvibhute | 4:315716ef8178 | 94 | |
akashvibhute | 4:315716ef8178 | 95 | //* ** * |
akashvibhute | 4:315716ef8178 | 96 | |
akashvibhute | 4:315716ef8178 | 97 | //------------- |
akashvibhute | 2:761e3c932ce0 | 98 | #define wheel_dia 10 //wheel dia in mm |
akashvibhute | 2:761e3c932ce0 | 99 | |
akashvibhute | 2:761e3c932ce0 | 100 | //------------------------------------------------------------------------------------------------- |
akashvibhute | 2:761e3c932ce0 | 101 | |
akashvibhute | 2:761e3c932ce0 | 102 | |
akashvibhute | 2:761e3c932ce0 | 103 | //** Drivetrain commander ************************************************************************* |
akashvibhute | 2:761e3c932ce0 | 104 | #define track_width 25 //track width in mm |
akashvibhute | 2:761e3c932ce0 | 105 | #define driveTrain_minV 100 //min velocity of individual drive in mm/s |
akashvibhute | 2:761e3c932ce0 | 106 | #define driveTrain_maxV 200 //max velocity of individual drive in mm/s |
akashvibhute | 2:761e3c932ce0 | 107 | |
akashvibhute | 2:761e3c932ce0 | 108 | //------------------------------------------------------------------------------------------------- |
akashvibhute | 2:761e3c932ce0 | 109 | |
akashvibhute | 2:761e3c932ce0 | 110 | //** Communications ******************************************************************************* |
akashvibhute | 2:761e3c932ce0 | 111 | #define virgo3_robot_address 01 //address of this robot node |
akashvibhute | 2:761e3c932ce0 | 112 | #define virgo3_network_channel 90 //communications channel number |
akashvibhute | 2:761e3c932ce0 | 113 | |
akashvibhute | 2:761e3c932ce0 | 114 | //------------------------------------------------------------------------------------------------- |
akashvibhute | 2:761e3c932ce0 | 115 | |
akashvibhute | 2:761e3c932ce0 | 116 | |
akashvibhute | 2:761e3c932ce0 | 117 | //** HansonController ***************************************************************************** |
akashvibhute | 2:761e3c932ce0 | 118 | #define wheelV_MWindowSize 25 //wheel velocity moving window filter size, customized for Pitch controller |
akashvibhute | 2:761e3c932ce0 | 119 | |
akashvibhute | 2:761e3c932ce0 | 120 | //------------------------------------------------------------------------------------------------- |
akashvibhute | 2:761e3c932ce0 | 121 | #endif /* VirgoConfig_H */ |