Team Virgo v3 / Orion_newPCB_test_LV

Dependencies:   mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo

Fork of Orion_newPCB_test by Team Virgo v3

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers config.h Source File

config.h

00001 /*
00002  *
00003  *  config.h Virgo v3 PCB AV22032015
00004  *
00005  */
00006  
00007 #ifndef VirgoConfig_H
00008 #define VirgoConfig_H
00009 
00010 //** General Functions ****************************************************************************
00011 #define PC_BAUDRATE 921600
00012 
00013 //-------------------------------------------------------------------------------------------------
00014 
00015 //** Function exectution rates ********************************************************************
00016 #define Hearbeat_RateHz 1 //hearbeat loop run rate in Hz
00017 #define Hearbeat_RateMS (1000/Hearbeat_RateHz) //hearbeat loop run rate in ms
00018 
00019 #define imu_UpdateRateHz 110 // imu update rate in Hz
00020 #define imu_UpdatePeriodMS (1000/imu_UpdateRateHz) // imu update rate in ms
00021 
00022 #define motorControl_UpdateRateHz 50// 200 // motorControl update rate in Hz
00023 #define motorControl_UpdatePeriodMS (1000/motorControl_UpdateRateHz) // motorControl update rate in ms
00024 
00025 #define odometry_UpdateRateHz 125 //odometry update rate in Hz
00026 #define odometry_UpdatePeriodMS (1000/odometry_UpdateRateHz) //odometry update rate in ms
00027 
00028 #define PrintLoop_RateHz 10 //print loop run rate in Hz
00029 #define PrintLoop_PeriodMS (1000/PrintLoop_RateHz) //print loop run rate in ms
00030 
00031 #define PurePursuit_UpdateRateHz 20//Pure pursuit update run rate in Hz
00032 #define PurePursuit_UpdatePeriodMS (1000/PurePursuit_UpdateRateHz)//Pure pursuit update run rate in ms
00033 
00034 #define WaypointCmd_UpdateRateHz 10 //waypoint commander run rate in Hz
00035 #define WaypointCmd_UpdatePeriodMS (1000/WaypointCmd_UpdateRateHz) //waypoint commander run rate in ms
00036 
00037 #define CommLoop_UpdateRateHz 100 //Communications loop run rate in Hz
00038 #define CommLoop_UpdatePeriodMS (1000/CommLoop_UpdateRateHz) //Communications loop run rate in ms
00039 
00040 #define CommPump_UpdateRateHz 500 //nRF network communications pump run rate in Hz
00041 #define CommPump_UpdatePeriodMS (1000/CommPump_UpdateRateHz) //nRF network communications pump run rate in ms
00042 
00043 //#define nRfDefault_uploadRateMS 200 //default upload rate in ms for nRF wireless comm
00044 
00045 #define camera_cycleMinutes 15 //default camera switch on frequency in minutes
00046 #define camera_CaptureTimeS 30 //default camera capture time in seconds
00047 
00048 #define DataRecorder_RateHz 100 //data recorder loop run rate in Hz
00049 #define DataRecorder_PeriodMS (1000/DataRecorder_RateHz) //data recorder loop run rate in ms
00050 //-------------------------------------------------------------------------------------------------
00051 
00052 
00053 //** Drivetrain ********************************************************************************
00054 //** Motor **
00055 #define PWMfreq_khz 20
00056 
00057 #define PIDFf_kP    0.50
00058 #define PIDFf_kI    1.50
00059 #define PIDFf_kD    0.20
00060 #define PIDFf_kFf   2.50
00061 
00062 #define PIDFf_lim_P    0.05
00063 #define PIDFf_lim_I    0.30
00064 #define PIDFf_lim_D    0.05
00065 #define PIDFf_lim_Ff   0.60
00066 
00067 #define PIDFf_range_min     -1.0
00068 #define PIDFf_range_max     1.0
00069 
00070 #define pid_MWindowSize 10
00071 
00072 //#define motor_LimitRPM_min  -100.0
00073 //#define motor_LimitRPM_max  300.0
00074 
00075 //#define motor_Acc_limit     200.0
00076 //-------------
00077 
00078 //** Encoder **
00079 #define encoder_resolution 408.168 // Number of counts per revolution
00080 #define encoder_MWindowSize 10
00081 //-------------
00082 //-------------------------------------------------------------------------------------------------
00083 
00084 
00085 
00086 //** Localization *********************************************************************************
00087 //** IMU **
00088 #define Pose_MWindowSize 10
00089 #define GyroAcc_MWindowSize 10
00090 
00091 //* MPU6050 *
00092 #define MPU6050_StabilizationReadings 10 //number of non deviating data points to determine if imu has stabilized
00093 #define IMU_FIFO_RATE_DIVIDER 0x01 // FIFO rate = 200Hz / (1 + this value), range 0x00 to 0x09. Here, 0x01 implies 100Hz.
00094 #define IMU_SAMPLE_RATE_DIVIDER 1 // Sample rate = 1kHz / (1 + this value), Here, 1 implies 500Hz.
00095 #define MPU6050_GYRO_FS MPU6050_GYRO_FS_2000 // measuring range of gyroscope (±n deg/s)
00096 #define MPU6050_ACCEL_FS MPU6050_ACCEL_FS_2 // measuring range of acceleration sensor (±n g)
00097 //*   **   *
00098 
00099 //* BNO055 *
00100 #define BNO055_StabilizationReadings 200 //number of non deviating data points to determine if imu has stabilized
00101 
00102 //*   **   *
00103 
00104 //* Localization *
00105 #define wheel_dia 60 //wheel dia in mm * effective hypocyclic gear ratio
00106 #define track_width 165 // in mm
00107 
00108 
00109 //-------------------------------------------------------------------------------------------------
00110 
00111 
00112 //** PurePursuit controller *************************************************************************
00113 #define track_width 165 //track width in mm
00114 #define driveTrain_minV 10//175 //min velocity of individual drive in mm/s
00115 #define driveTrain_maxV 700//235 //max velocity of individual drive in mm/s
00116 
00117 //-------------------------------------------------------------------------------------------------
00118 
00119 //** Communications *******************************************************************************
00120 #define virgo3_robot_address 01 //address of this robot node
00121 #define virgo3_network_channel 68 //communications channel number
00122 
00123 //-------------------------------------------------------------------------------------------------
00124 
00125 
00126 //** Attitude Controller **************************************************************************
00127 #define wheelV_MWindowSize 25 //wheel velocity moving window filter size, customized for Pitch controller
00128 
00129 //** HansonController **
00130 
00131 
00132 //** PID pitch controller **
00133 // This PID controller adds/subtracts a percentage of command velocity based on the variations of
00134 // the pitch angle while controlling the pitch angle to a setpoint angle.
00135 
00136 #define AttPIDFf_kP    9.00
00137 #define AttPIDFf_kI    1.00
00138 #define AttPIDFf_kD    0.10
00139 #define AttPIDFf_kFf   0.00
00140 
00141 #define AttPIDFf_lim_P  0.6
00142 #define AttPIDFf_lim_I  0.1
00143 #define AttPIDFf_lim_D  0.3
00144 #define AttPIDFf_lim_Ff 0.0
00145 
00146 #define AttPIDFf_range_min  -1.0
00147 #define AttPIDFf_range_max   1.0
00148 
00149 
00150 //-------------------------------------------------------------------------------------------------
00151 
00152 //** Data Recorder ********************************************************************************
00153 #define max_coloumns 16
00154 //#define max_rows 1200
00155 #define max_rows 120
00156 #define max_RAM 16*1024 //max permissible ram usage in kB
00157 
00158 //-------------------------------------------------------------------------------------------------
00159 
00160 
00161 #endif /* VirgoConfig_H */