added serial up, down, left and right control

Dependencies:   mbed

Fork of Robot_a_cables_v3_6 by RaC2018

Committer:
unslaad
Date:
Tue Jun 05 12:29:57 2018 +0000
Revision:
12:98a051edb19a
Parent:
10:fb3542f3c5e6
all serial controls ready; changed serial output floats to ints

Who changed what in which revision?

UserRevisionLine numberNew contents of line
protongamer 10:fb3542f3c5e6 1 //Parameters of the robot
protongamer 10:fb3542f3c5e6 2 //includes CANopen codes and robot parameters
protongamer 3:86e21a36eecb 3
protongamer 3:86e21a36eecb 4
protongamer 10:fb3542f3c5e6 5 /*
protongamer 10:fb3542f3c5e6 6 Here is the list of the CANopen Codes to sent to the motor driver
protongamer 10:fb3542f3c5e6 7 There identifiers and word code
protongamer 10:fb3542f3c5e6 8 These parameters can be changed
protongamer 3:86e21a36eecb 9 */
protongamer 3:86e21a36eecb 10
protongamer 3:86e21a36eecb 11
protongamer 3:86e21a36eecb 12 //Identifier Codes
protongamer 3:86e21a36eecb 13
protongamer 3:86e21a36eecb 14 /*
protongamer 3:86e21a36eecb 15 To set right value for:
protongamer 3:86e21a36eecb 16 RPDO1 => 0x200 + ID
protongamer 3:86e21a36eecb 17 RPDO2 => 0x300 + ID
protongamer 3:86e21a36eecb 18 RPDO3 => 0x400 + ID
protongamer 3:86e21a36eecb 19 RPDO4 => 0x500 + ID
protongamer 3:86e21a36eecb 20 TPDO1 => 0x180 + ID
protongamer 3:86e21a36eecb 21 TPDO2 => 0x280 + ID
protongamer 3:86e21a36eecb 22 TPDO3 => 0x380 + ID
protongamer 3:86e21a36eecb 23 TPDO4 => 0x480 + ID
protongamer 3:86e21a36eecb 24 */
protongamer 3:86e21a36eecb 25
protongamer 3:86e21a36eecb 26
protongamer 3:86e21a36eecb 27 #define INITOP 0x00
protongamer 3:86e21a36eecb 28 #define RPDO1_R 0x215
protongamer 3:86e21a36eecb 29 #define RPDO2_R 0x315
protongamer 3:86e21a36eecb 30 #define RPDO3_R 0x415
protongamer 3:86e21a36eecb 31 #define RPDO4_R 0x515
protongamer 3:86e21a36eecb 32 #define TPDO1_R 0x195
protongamer 3:86e21a36eecb 33 #define TPDO2_R 0x295
protongamer 3:86e21a36eecb 34 #define TPDO3_R 0x395
protongamer 3:86e21a36eecb 35 #define TPDO4_R 0x495
protongamer 3:86e21a36eecb 36 #define RPDO1_L 0x220
protongamer 3:86e21a36eecb 37 #define RPDO2_L 0x320
protongamer 3:86e21a36eecb 38 #define RPDO3_L 0x420
protongamer 3:86e21a36eecb 39 #define RPDO4_L 0x520
protongamer 3:86e21a36eecb 40 #define TPDO1_L 0x1A0
protongamer 3:86e21a36eecb 41 #define TPDO2_L 0x2A0
protongamer 3:86e21a36eecb 42 #define TPDO3_L 0x3A0
protongamer 3:86e21a36eecb 43 #define TPDO4_L 0x4A0
protongamer 3:86e21a36eecb 44
protongamer 3:86e21a36eecb 45
protongamer 3:86e21a36eecb 46
protongamer 10:fb3542f3c5e6 47
protongamer 3:86e21a36eecb 48
protongamer 10:fb3542f3c5e6 49 //Driver adresses for operational mode
protongamer 10:fb3542f3c5e6 50 //Example : DRIVER_R1 = 0x01 DRIVER_R2= 0x15 ----> Code must be sent = DRIVER_R1 + DRIVER_R2 = 0x0115
protongamer 10:fb3542f3c5e6 51
protongamer 3:86e21a36eecb 52 #define DRIVER_R1 0x01
protongamer 3:86e21a36eecb 53 #define DRIVER_R2 0x15
protongamer 3:86e21a36eecb 54 #define DRIVER_L1 0x01
protongamer 3:86e21a36eecb 55 #define DRIVER_L2 0x20
protongamer 6:ffffa9dfadfc 56
protongamer 6:ffffa9dfadfc 57
protongamer 6:ffffa9dfadfc 58
protongamer 6:ffffa9dfadfc 59
protongamer 6:ffffa9dfadfc 60
protongamer 6:ffffa9dfadfc 61 //Robot setup
protongamer 10:fb3542f3c5e6 62
protongamer 10:fb3542f3c5e6 63 //Here is the configuration of the robot
protongamer 10:fb3542f3c5e6 64 //These value can be changed
protongamer 10:fb3542f3c5e6 65
protongamer 6:ffffa9dfadfc 66
protongamer 6:ffffa9dfadfc 67 //Length from motors to cursor in millimeters(mm) when the origin is taken
protongamer 10:fb3542f3c5e6 68
protongamer 6:ffffa9dfadfc 69 //Left motor to cursor
protongamer 10:fb3542f3c5e6 70 #define LENGTH_L1_PO 740
protongamer 10:fb3542f3c5e6 71
protongamer 7:e87feff62bfd 72 //Right motor to cursor
protongamer 10:fb3542f3c5e6 73 #define LENGTH_L2_PO 740
protongamer 10:fb3542f3c5e6 74
protongamer 7:e87feff62bfd 75 //Left motor to Right motor
protongamer 9:0f63d4cb5613 76 #define LENGTH_MOTOR 1000
protongamer 10:fb3542f3c5e6 77
protongamer 10:fb3542f3c5e6 78 //Max velocity for normal mode
protongamer 10:fb3542f3c5e6 79 #define ALPHA 425000
protongamer 10:fb3542f3c5e6 80
protongamer 10:fb3542f3c5e6 81 //Number of counters for 1 millimeters
protongamer 10:fb3542f3c5e6 82 #define REFERENCE 2545
protongamer 10:fb3542f3c5e6 83
protongamer 10:fb3542f3c5e6 84
protongamer 10:fb3542f3c5e6 85
protongamer 10:fb3542f3c5e6 86
protongamer 10:fb3542f3c5e6 87 /*Here is the default values
protongamer 10:fb3542f3c5e6 88
protongamer 10:fb3542f3c5e6 89
protongamer 10:fb3542f3c5e6 90 //Identifier Codes
protongamer 10:fb3542f3c5e6 91
protongamer 10:fb3542f3c5e6 92 #define INITOP 0x00
protongamer 10:fb3542f3c5e6 93 #define RPDO1_R 0x215
protongamer 10:fb3542f3c5e6 94 #define RPDO2_R 0x315
protongamer 10:fb3542f3c5e6 95 #define RPDO3_R 0x415
protongamer 10:fb3542f3c5e6 96 #define RPDO4_R 0x515
protongamer 10:fb3542f3c5e6 97 #define TPDO1_R 0x195
protongamer 10:fb3542f3c5e6 98 #define TPDO2_R 0x295
protongamer 10:fb3542f3c5e6 99 #define TPDO3_R 0x395
protongamer 10:fb3542f3c5e6 100 #define TPDO4_R 0x495
protongamer 10:fb3542f3c5e6 101 #define RPDO1_L 0x220
protongamer 10:fb3542f3c5e6 102 #define RPDO2_L 0x320
protongamer 10:fb3542f3c5e6 103 #define RPDO3_L 0x420
protongamer 10:fb3542f3c5e6 104 #define RPDO4_L 0x520
protongamer 10:fb3542f3c5e6 105 #define TPDO1_L 0x1A0
protongamer 10:fb3542f3c5e6 106 #define TPDO2_L 0x2A0
protongamer 10:fb3542f3c5e6 107 #define TPDO3_L 0x3A0
protongamer 10:fb3542f3c5e6 108 #define TPDO4_L 0x4A0
protongamer 10:fb3542f3c5e6 109
protongamer 10:fb3542f3c5e6 110
protongamer 10:fb3542f3c5e6 111 //Driver adresses for operational mode
protongamer 10:fb3542f3c5e6 112 //Example : DRIVER_R1 = 0x01 DRIVER_R2= 0x15 ----> Code must be sent = DRIVER_R1 + DRIVER_R2 = 0x0115
protongamer 10:fb3542f3c5e6 113
protongamer 10:fb3542f3c5e6 114 #define DRIVER11 0x01
protongamer 10:fb3542f3c5e6 115 #define DRIVER12 0x15
protongamer 10:fb3542f3c5e6 116 #define DRIVER21 0x01
protongamer 10:fb3542f3c5e6 117 #define DRIVER22 0x20
protongamer 10:fb3542f3c5e6 118
protongamer 10:fb3542f3c5e6 119
protongamer 10:fb3542f3c5e6 120
protongamer 10:fb3542f3c5e6 121 //Robot setup
protongamer 10:fb3542f3c5e6 122
protongamer 10:fb3542f3c5e6 123 //Here is the configuration of the robot
protongamer 10:fb3542f3c5e6 124 //These value can be changed
protongamer 10:fb3542f3c5e6 125
protongamer 10:fb3542f3c5e6 126
protongamer 10:fb3542f3c5e6 127 //Length from motors to cursor in millimeters(mm) when the origin is taken
protongamer 10:fb3542f3c5e6 128
protongamer 10:fb3542f3c5e6 129 //Left motor to cursor
protongamer 10:fb3542f3c5e6 130 #define LENGTH_L1_PO 740
protongamer 10:fb3542f3c5e6 131
protongamer 10:fb3542f3c5e6 132 //Right motor to cursor
protongamer 10:fb3542f3c5e6 133 #define LENGTH_L2_PO 740
protongamer 10:fb3542f3c5e6 134
protongamer 10:fb3542f3c5e6 135 //Left motor to Right motor
protongamer 10:fb3542f3c5e6 136 #define LENGTH_MOTOR 1000
protongamer 10:fb3542f3c5e6 137
protongamer 10:fb3542f3c5e6 138 //Max velocity for normal mode
protongamer 10:fb3542f3c5e6 139 #define ALPHA 425000
protongamer 10:fb3542f3c5e6 140
protongamer 10:fb3542f3c5e6 141 //Number of counters for 1 millimeters
protongamer 10:fb3542f3c5e6 142 #define REFERENCE 2545
protongamer 10:fb3542f3c5e6 143
protongamer 10:fb3542f3c5e6 144
protongamer 10:fb3542f3c5e6 145
protongamer 10:fb3542f3c5e6 146
protongamer 10:fb3542f3c5e6 147 */
protongamer 10:fb3542f3c5e6 148
protongamer 10:fb3542f3c5e6 149
protongamer 10:fb3542f3c5e6 150
protongamer 10:fb3542f3c5e6 151
protongamer 10:fb3542f3c5e6 152
protongamer 10:fb3542f3c5e6 153
protongamer 10:fb3542f3c5e6 154
protongamer 10:fb3542f3c5e6 155