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.
Dependencies: mbed ros_lib_kinetic
defines.h
00001 #ifndef DEFINES_H 00002 #define DEFINES_H 00003 00004 #include "defines_debug.h" 00005 #include "defines_pins.h" 00006 00007 //#####################################################################################\\ 00008 00009 #define SERIAL_BAUD_RATE 115200 00010 00011 #define N_THRUSTERS 8 00012 00013 #define PID_PERIOD 50.0 // [ms] Update period of the PID command 00014 #define LED_PERIOD 50.0 // [ms] Period of the blinking LED 00015 #define MEAS_PERIOD 50.0 // [ms] Period at which to publish new velocity measurement 00016 #define PID_DEBUG_PERIOD 2500.0 // [ms] Period at which to publish PID parameters 00017 #define THRUST_PERIOD 500.0 // [ms] PWM period of thrusters 00018 #define THRUST_PWM_N 20.0 // Number of PWM steps per PID period 00019 #define MOTOR_PWM_PERIOD 0.00005 // 20 kHz 00020 00021 // Parameters for motor encoder 00022 #define NCREV 64.0 // Number of counts per revolution 00023 #define SPEED_COUNTS 100 // Number of counts per speed measurement in encoder 00024 00025 #define NGR 18.75 // Gear ratio 00026 #define V_SMAX 500.0 // [RPM] No-load max shaft speed 00027 #define M2SEC 60.0 // [sec/min] Conversion 00028 #define REV2DEG 360.0 // [deg/rev] Conversion 00029 00030 #define V_SMAX_ENF 400.0 // [RPM] Enforced maximum shaft speed 00031 #define V_SMIN_ENF 0.0 // [RPM] Enforced minimum shaft speed 00032 00033 #define COUNTS2SHAFT M2SEC/NCREV/NGR // Counts/sec to shaft speed in RPM 00034 00035 #define R 2.4 // 12 V / 5 A 00036 #define CURRENT_MAX 5.0 // Stall curent of motor 00037 #define VOLTAGE_MAX 12.0 // Supply voltage to motor 00038 00039 // Regular PID 00040 #define KP_INIT 1.0 00041 #define KI_INIT 0.0001 00042 #define KD_INIT 0.0 00043 #define ACC_LIMIT_INIT 0.0 // Scaled accumulated error limit 00044 00045 // PID with feed-foward term 00046 #define KP_FF_INIT 0.1 00047 #define KI_FF_INIT 0.00001 00048 #define KD_FF_INIT 0.0 00049 #define ACC_LIMIT_FF_INIT 0.0 00050 #define SLOPE_FF_INIT 0.001704 00051 #define INTER_FF_INIT -0.0171 00052 00053 #define SMOOTHING_VAL 0.9 00054 #define PWM_LIMIT 0.7 00055 00056 #define INITIAL_SP 0.0 00057 #define COARSE_INCR 50.0 00058 #define FINE_INCR 25.0 00059 #define HAIR_INCR 5.0 00060 00061 #define KE VOLTAGE_MAX/(V_SMAX*NGR) 00062 00063 // RGBA LED parameters 00064 #define MODE_AMBER false 00065 #define RGB_LED_PERIOD 50 00066 #define DEF_CLR_FADE_T 1000 00067 #define DEF_ALP_FADE_T 1000 00068 00069 //#####################################################################################\\ 00070 00071 #endif // End include guard
Generated on Tue Jul 12 2022 21:35:43 by
