ESP Line Following Buggy
2nd Year Embedded System Project (Group 48 - 2023/24)
Loading...
Searching...
No Matches
constants.h File Reference

contains all the constant variables for easy access from one file More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PID_M_TAU   1
 
#define PID_M_MIN_OUT   -PID_M_MAX_OUT
 
#define PID_M_MAX_OUT   1
 
#define PID_M_MIN_INT   -PID_M_MAX_INT
 
#define PID_M_MAX_INT   1
 
#define PID_M_L_KP   0.5
 
#define PID_M_L_KI   7.5
 
#define PID_M_L_KD   0
 
#define PID_M_R_KP   PID_M_L_KP
 
#define PID_M_R_KI   PID_M_L_KI
 
#define PID_M_R_KD   PID_M_L_KD
 
#define PID_S_MIN_OUT   -PID_S_MAX_OUT
 
#define PID_S_MAX_OUT   1.5
 
#define PID_S_MIN_INT   -PID_S_MAX_INT
 
#define PID_S_MAX_INT   0
 
#define PID_S_KI   0
 
#define PID_S_TAU   0.001
 
#define PID_S_KP   0.30
 
#define PID_S_KD   0.08
 
#define PID_A_TAU   0.01
 
#define PID_A_MIN_OUT   -PID_A_MAX_OUT
 
#define PID_A_MAX_OUT   0.6
 
#define PID_A_MIN_INT   -PID_A_MAX_INT
 
#define PID_A_MAX_INT   0
 
#define PID_A_KP   0.2
 
#define PID_A_KI   0.1
 
#define PID_A_KD   0
 
#define SENS_SAMPLE_COUNT   1
 
#define SENS_ANGLE_COEFF   1
 
#define SENS_DETECT_RANGE   0.4
 
#define LINE_FOLLOW_VELOCITY   2.1
 
#define LINE_FOLLOW_VELOCITY_UTURN   2.1
 
#define LINE_FOLLOW_STOP_DISTANCE   0.3
 
#define UTURN_ANGLE   190
 
#define SLOW_ACCEL_TIME   0.4
 
#define SLOW_ACCEL_DIVIDER   2
 
#define STOP_DETECT_TIME   1
 
#define SLOW_TURNING_GAIN   0
 
#define SLOW_TURNING_THRESH   2
 
#define MANUAL_ACCEL_SPEED   0.5
 
#define MANUAL_ACCEL_DISTANCE   0.5
 
#define MANUAL_ACCEL_ANGLE   60
 
#define SQUARE_VELOCITY_SET   0.4
 
#define SQUARE_TURNING_RIGHT_ANGLE   92
 
#define SQUARE_TURNING_LEFT_ANGLE   101.5
 
#define SQUARE_DISTANCE   1.01
 
#define CONTROL_UPDATE_RATE   2500
 
#define CONTROL_UPDATE_PERIOD   (1.0f / CONTROL_UPDATE_RATE)
 
#define CONTROL_UPDATE_PERIOD_US   (int)(1'000'000 / CONTROL_UPDATE_RATE)
 
#define SENSOR_UPDATE_RATE   5000
 
#define SENSOR_UPDATE_PERIOD   (1.0f / CONTROL_UPDATE_RATE)
 
#define SENSOR_UPDATE_PERIOD_US   (int)(1'000'000 / CONTROL_UPDATE_RATE)
 
#define SERIAL_UPDATE_PERIOD   0.02
 

Detailed Description

contains all the constant variables for easy access from one file

All constants are in metres, seconds, hertz unless otherwise stated

Definition in file constants.h.

Macro Definition Documentation

◆ CONTROL_UPDATE_PERIOD

#define CONTROL_UPDATE_PERIOD   (1.0f / CONTROL_UPDATE_RATE)

Definition at line 89 of file constants.h.

◆ CONTROL_UPDATE_PERIOD_US

#define CONTROL_UPDATE_PERIOD_US   (int)(1'000'000 / CONTROL_UPDATE_RATE)

Definition at line 90 of file constants.h.

◆ CONTROL_UPDATE_RATE

#define CONTROL_UPDATE_RATE   2500

Definition at line 88 of file constants.h.

◆ LINE_FOLLOW_STOP_DISTANCE

#define LINE_FOLLOW_STOP_DISTANCE   0.3

Definition at line 64 of file constants.h.

◆ LINE_FOLLOW_VELOCITY

#define LINE_FOLLOW_VELOCITY   2.1

Definition at line 62 of file constants.h.

◆ LINE_FOLLOW_VELOCITY_UTURN

#define LINE_FOLLOW_VELOCITY_UTURN   2.1

Definition at line 63 of file constants.h.

◆ MANUAL_ACCEL_ANGLE

#define MANUAL_ACCEL_ANGLE   60

Definition at line 78 of file constants.h.

◆ MANUAL_ACCEL_DISTANCE

#define MANUAL_ACCEL_DISTANCE   0.5

Definition at line 77 of file constants.h.

◆ MANUAL_ACCEL_SPEED

#define MANUAL_ACCEL_SPEED   0.5

Definition at line 76 of file constants.h.

◆ PID_A_KD

#define PID_A_KD   0

Definition at line 51 of file constants.h.

◆ PID_A_KI

#define PID_A_KI   0.1

Definition at line 50 of file constants.h.

◆ PID_A_KP

#define PID_A_KP   0.2

Definition at line 49 of file constants.h.

◆ PID_A_MAX_INT

#define PID_A_MAX_INT   0

Definition at line 48 of file constants.h.

◆ PID_A_MAX_OUT

#define PID_A_MAX_OUT   0.6

Definition at line 46 of file constants.h.

◆ PID_A_MIN_INT

#define PID_A_MIN_INT   -PID_A_MAX_INT

Definition at line 47 of file constants.h.

◆ PID_A_MIN_OUT

#define PID_A_MIN_OUT   -PID_A_MAX_OUT

Definition at line 45 of file constants.h.

◆ PID_A_TAU

#define PID_A_TAU   0.01

Definition at line 44 of file constants.h.

◆ PID_M_L_KD

#define PID_M_L_KD   0

Definition at line 23 of file constants.h.

◆ PID_M_L_KI

#define PID_M_L_KI   7.5

Definition at line 22 of file constants.h.

◆ PID_M_L_KP

#define PID_M_L_KP   0.5

Definition at line 21 of file constants.h.

◆ PID_M_MAX_INT

#define PID_M_MAX_INT   1

Definition at line 18 of file constants.h.

◆ PID_M_MAX_OUT

#define PID_M_MAX_OUT   1

Definition at line 16 of file constants.h.

◆ PID_M_MIN_INT

#define PID_M_MIN_INT   -PID_M_MAX_INT

Definition at line 17 of file constants.h.

◆ PID_M_MIN_OUT

#define PID_M_MIN_OUT   -PID_M_MAX_OUT

Definition at line 15 of file constants.h.

◆ PID_M_R_KD

#define PID_M_R_KD   PID_M_L_KD

Definition at line 28 of file constants.h.

◆ PID_M_R_KI

#define PID_M_R_KI   PID_M_L_KI

Definition at line 27 of file constants.h.

◆ PID_M_R_KP

#define PID_M_R_KP   PID_M_L_KP

Definition at line 26 of file constants.h.

◆ PID_M_TAU

#define PID_M_TAU   1

Definition at line 14 of file constants.h.

◆ PID_S_KD

#define PID_S_KD   0.08

Definition at line 39 of file constants.h.

◆ PID_S_KI

#define PID_S_KI   0

Definition at line 35 of file constants.h.

◆ PID_S_KP

#define PID_S_KP   0.30

Definition at line 38 of file constants.h.

◆ PID_S_MAX_INT

#define PID_S_MAX_INT   0

Definition at line 34 of file constants.h.

◆ PID_S_MAX_OUT

#define PID_S_MAX_OUT   1.5

Definition at line 32 of file constants.h.

◆ PID_S_MIN_INT

#define PID_S_MIN_INT   -PID_S_MAX_INT

Definition at line 33 of file constants.h.

◆ PID_S_MIN_OUT

#define PID_S_MIN_OUT   -PID_S_MAX_OUT

Definition at line 31 of file constants.h.

◆ PID_S_TAU

#define PID_S_TAU   0.001

Definition at line 37 of file constants.h.

◆ SENS_ANGLE_COEFF

#define SENS_ANGLE_COEFF   1

Definition at line 58 of file constants.h.

◆ SENS_DETECT_RANGE

#define SENS_DETECT_RANGE   0.4

Definition at line 59 of file constants.h.

◆ SENS_SAMPLE_COUNT

#define SENS_SAMPLE_COUNT   1

Definition at line 57 of file constants.h.

◆ SENSOR_UPDATE_PERIOD

#define SENSOR_UPDATE_PERIOD   (1.0f / CONTROL_UPDATE_RATE)

Definition at line 94 of file constants.h.

◆ SENSOR_UPDATE_PERIOD_US

#define SENSOR_UPDATE_PERIOD_US   (int)(1'000'000 / CONTROL_UPDATE_RATE)

Definition at line 95 of file constants.h.

◆ SENSOR_UPDATE_RATE

#define SENSOR_UPDATE_RATE   5000

Definition at line 93 of file constants.h.

◆ SERIAL_UPDATE_PERIOD

#define SERIAL_UPDATE_PERIOD   0.02

Definition at line 98 of file constants.h.

◆ SLOW_ACCEL_DIVIDER

#define SLOW_ACCEL_DIVIDER   2

Definition at line 68 of file constants.h.

◆ SLOW_ACCEL_TIME

#define SLOW_ACCEL_TIME   0.4

Definition at line 67 of file constants.h.

◆ SLOW_TURNING_GAIN

#define SLOW_TURNING_GAIN   0

Definition at line 73 of file constants.h.

◆ SLOW_TURNING_THRESH

#define SLOW_TURNING_THRESH   2

Definition at line 74 of file constants.h.

◆ SQUARE_DISTANCE

#define SQUARE_DISTANCE   1.01

Definition at line 85 of file constants.h.

◆ SQUARE_TURNING_LEFT_ANGLE

#define SQUARE_TURNING_LEFT_ANGLE   101.5

Definition at line 84 of file constants.h.

◆ SQUARE_TURNING_RIGHT_ANGLE

#define SQUARE_TURNING_RIGHT_ANGLE   92

Definition at line 83 of file constants.h.

◆ SQUARE_VELOCITY_SET

#define SQUARE_VELOCITY_SET   0.4

Definition at line 82 of file constants.h.

◆ STOP_DETECT_TIME

#define STOP_DETECT_TIME   1

Definition at line 70 of file constants.h.

◆ UTURN_ANGLE

#define UTURN_ANGLE   190

Definition at line 65 of file constants.h.