-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
83 lines (60 loc) · 1.92 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef CODER_H
#define CODER_H
//#define DEV_BOARD
#ifdef DEV_BOARD
/*coder's pins*/
#define CODER_L_A (2)
#define CODER_L_B (3)
#define CODER_R_A (6)
#define CODER_R_B (7)
#define MOTOR_L_PWM 10
#define MOTOR_L_DIR 10
#define MOTOR_L_BRAKE 10
#define MOTOR_L_SENSE A1
#define MOTOR_R_PWM 10
#define MOTOR_R_DIR 10
#define MOTOR_R_BRAKE 10
#define MOTOR_R_SENSE A0
#else
#define CODER_L_A (4)
#define CODER_L_B (3)
#define CODER_R_A (5)
#define CODER_R_B (6)
#define MOTOR_L_PWM 10
#define MOTOR_L_DIR 11
#define MOTOR_L_BRAKE 12
#define MOTOR_L_SENSE A1
#define MOTOR_R_PWM 9
#define MOTOR_R_DIR 7
#define MOTOR_R_BRAKE 8
#define MOTOR_R_SENSE A0
#endif //DEV_BOARD
#define DEBUG_PIN_ASSERV 12
#define DEBUG_PIN_GENERAL 13
#define DEFAULT_TICK_PER_METERS (4798.0)
#define DEFAULT_TICK_PER_RADS (3011.0)
//refresh frequency of the PID and odometry, in Hz
#define REFRESH_FREQ 1000
//Absolute pwm that must not be exceded to avoid damaging the motors
#define PWM_MAX 200
//frequency off the pwm (the noise generated by the pwm become almost inaudible above 16khz)
#define PWM_FREQ 16000
//If the target pwm is < ZONE_51 it will be considered equal to 0
//Avoid useless "biiiiiiiiiii" from the motors when to pwm is to low to make it move
#define ZONE_51 0
#define BLOCK_CMD_DETECT_MIN ((int32_t)(50))
#define BLOCK_DURATION_MIN ((int32_t)(1000)) //ms
#define BLOCK_DURATION_LOOP_COUNT ((int32_t)((BLOCK_DURATION_MIN*REFRESH_FREQ)/1000))
#define ACK_DIST 0.02 //en m
#define ACK_ANGLE 0.02 //en rad
#define DIST_WHEEL2CENTER (0.055)
#define SERVO_BRAS_LEFT 15
#define SERVO_BRAS_RIGHT 17
#define SERVO_BRAS_LEFT_HIGH 105 //ok
#define SERVO_BRAS_LEFT_LOW 45
#define SERVO_BRAS_LEFT_IDLE (SERVO_BRAS_LEFT_HIGH+SERVO_BRAS_LEFT_LOW)/2
#define SERVO_BRAS_RIGHT_HIGH 75
#define SERVO_BRAS_RIGHT_LOW 135
#define SERVO_BRAS_RIGHT_IDLE (SERVO_BRAS_RIGHT_HIGH+SERVO_BRAS_RIGHT_LOW)/2
#define ULTRASOUND_PIN 14
#endif