Posted 14 April 2022
Wall-E3 has a significantly different form-factor than Wall-E2, requiring modification of the lead-in rails on the charging station, as shown below.
Once the required mods were made, I uncommented ‘#define IR_HOMING_ONLY in my code to have Wall-E3 concentrate solely on homing to the charging station, and then worked my way into a set of PID values (100,0,30) that gave reasonable homing performance, as shown in the following short video:
And here’s an Excel plot showing typical homing performance.
24 April 2022 Update:
The above data and video was collected using the ‘NoPing’ version of the IR Homing algorithm, so I went back and did this again using the version that monitors the front distance, both for detecting a ‘stuck’ condition and for the ability to navigate around the charging station if a charge isn’t needed. Of course, this didn’t work right away for various reasons, but eventually I got it working and made another test run. Here’s a short slo-mo video, and the accompanying Excel chart showing homing performance.
01 May 2022 Update:
Wall-E3 has made some significant progress in the last week, and is now capable of switching from right-wall tracking to IR Homing to the charging station, as shown in the following short video and telemetry output:
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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
In TrackRightWallOffset with Kp/Ki/Kd = 400.00 0.00 0.00 In TrackRightWallOffset with RR/RC/RF = 20 18 19 straight window = 8 cm GetWallOrientDeg(-0.0900): slopeval = 0.02, offparalleldeg -5.14 R/C/F dists = 20 18 19 Steerval = -0.090, WallAngle = -5.14, Inside GetWallOrientDeg(0.4400): slopeval = 0.02, offparalleldeg 25.14 R/C/F dists = 20 20 24 Steerval = 0.440, WallOrientDeg = 25.14 approach start: orient angle = 25.143, tgt_distCm = 35 At start: meas_dist = 20, corr_dist = 18, err = prev_err = -17 GetWallOrientDeg(0.4800): slopeval = 0.02, offparalleldeg 27.43 R/C/F dists = 20 21 25 Steerval = 0.480, OrientDeg = 27.43, err/prev_err = -17 Msec RFront RCtr RRear ODeg ORad c_dist Err P_err 11065 26 22 20 27.4 0.5 18 -17 -17 11179 30 26 22 27.4 0.5 23 -12 -17 11293 33 28 25 27.4 0.5 24 -11 -12 11407 36 32 29 27.4 0.5 28 -7 -11 11521 40 35 31 27.4 0.5 31 -4 -7 11635 44 40 35 27.4 0.5 35 0 -4 At end of offset capture - prev_res*res = 0 correct back to parallel (Right side): RF/RC/RR/Orient = 44 40 35 27.43 TrackRightWallOffset: Start tracking offset of 40cm with Kp/Ki/Kd = 400.00 0.00 0.00 Msec LF LC LR RF RC RR F Fvar R Rvar Steer Set Output LSpd RSpd 12235 728 112 816 41 39 38 104 11326 49 508 0.30 0.25 -20 94 55 12335 728 111 816 40 39 40 103 11536 56 479 0.01 0.25 96 0 127 12439 728 111 127 41 40 39 103 11730 57 452 0.23 0.25 8 67 83 12539 728 111 816 41 39 40 103 11891 54 428 0.14 0.25 44 31 119 12637 728 111 816 42 39 40 101 12011 57 405 0.12 0.25 52 23 127 12736 728 110 816 43 42 39 100 12071 68 385 0.42 0.25 -68 127 7 12839 728 115 816 46 43 42 99 12052 75 370 0.47 0.25 -88 127 0 12936 728 109 816 47 45 42 91 11963 71 353 0.59 0.25 -136 127 0 13039 728 105 816 47 45 44 86 11772 79 342 0.45 0.25 -80 127 0 13138 111 113 123 48 45 43 80 11461 83 335 0.52 0.25 -108 127 0 13237 728 112 121 47 46 45 77 10997 76 323 0.40 0.25 -60 127 14 13336 728 117 126 48 46 46 76 10351 84 318 0.17 0.25 32 43 107 13437 728 794 126 50 49 49 76 9497 100 329 0.21 0.25 16 59 91 13537 728 794 816 47 48 49 71 9628 104 346 0.02 0.25 92 0 127 13635 113 111 816 47 46 47 67 9771 97 352 0.16 0.25 36 39 111 13738 107 794 816 46 44 46 64 9918 95 356 0.12 0.25 52 23 127 13836 728 794 816 44 43 43 61 10073 108 376 0.12 0.25 52 23 127 13935 728 794 125 44 42 43 57 10213 98 382 0.17 0.25 32 42 107 14036 728 112 816 44 42 42 55 10343 104 395 0.22 0.25 12 63 87 14134 728 119 816 44 41 41 50 10483 116 426 0.40 0.25 -60 127 14 14237 728 794 816 45 43 41 44 10637 121 463 0.50 0.25 -100 127 0 14338 106 98 125 46 43 41 38 10797 109 480 0.51 0.25 -104 127 0 In HandleAnomalousConditions with WALL_OFFSET_DIST_AHEAD error code detected WALL_OFFSET_DIST_AHEAD case detected with tracking case Right IRHomingValTotalAvg = 33711 IR Beam Detected with Battery Voltage = 6.87 Low battery - homing to Charger OK we have a IR Beacon, with front distance = 121! In IRHomingNavigateToIAP with LF/LR/LS/RF/RR/RS = 728 816 -8.86 29 28 0.16 In IRHomingNavigateToIAP(Right) with LF/LR/LS/RF/RR/RS = 728 816 -8.86 30 27 0.26 IP is at 60 cm offset, 135 cm away from charging station, a ratio of 0.44 Robot is at 121 from charger, so we need a 53 cm offset Current wall offset is 28 cm or 52% of required offset offset is too small or too large - turn away from wall to adjust After SpinTurn(), rear dist (cm) is 28 In MoveToDesiredRearDistCm(53) with Kp/Ki/Kd = 2.0/0.5/0.0 Msec Rdist TgtD err Ival Out 19015 25 53 28.0 14.0 70.0 19215 32 53 21.0 24.5 66.5 19415 34 53 19.0 34.0 72.0 19615 47 53 6.0 37.0 49.0 19815 50 53 3.0 38.5 44.5 20015 62 53 -9.0 34.0 16.0 20215 60 53 -7.0 30.5 16.5 20415 70 53 -17.0 22.0 -12.0 20615 70 53 -17.0 13.5 -20.5 20815 63 53 -10.0 8.5 -11.5 21015 70 53 -17.0 0.0 -34.0 21215 62 53 -9.0 -4.5 -22.5 21415 66 53 -13.0 -11.0 -37.0 21615 57 53 -4.0 -13.0 -21.0 21815 62 53 -9.0 -17.5 -35.5 22015 51 53 2.0 -16.5 -12.5 22215 57 53 -4.0 -18.5 -26.5 22415 48 53 5.0 -16.0 -6.0 22615 55 53 -2.0 -17.0 -21.0 22815 48 53 5.0 -14.5 -4.5 23015 48 53 5.0 -12.0 -2.0 23215 53 53 0.0 -12.0 -12.0 Wall offset now 53 cm, with IRHomingValTotalAvg = 32824 TurnToHomingBeacon with IRAvg = 32705, Steering = 0.39 & IRRotate Kp,Ki,Kd = (40,10, 0) TurnToHomingBeacon(RIGHT) Msec Signal Steer Val 25506 174.74 0.94 75 25627 -173.51 0.57 92 25746 -162.99 -0.03 94 25867 -152.65 -0.43 92 25986 -142.47 -0.67 54 26137 -129.94 -0.50 51 26256 -119.93 -1.00 7821 26377 -109.97 -0.99 19453 26496 -99.64 -0.90 33325 26617 -88.96 -0.83 40602 26738 -78.32 -0.72 47367 26857 -67.75 -0.46 55756 26978 -57.49 -0.01 67318 Coarse adjustment finished Rotate back and forth as necessary to maximize received signal strength. Start with CW rotation for trkside == TRACKING_RIGHT, and CCW for TRACKING_LEFT Got 67510, 11448, 75232, 0.71 from IR Detector module Msec IRVal1 IRVal2 ValAvg Steer speed 28098 67460 11364 79224 0.71 -35 28196 66514 11494 78598 0.71 -42 28299 63398 12996 77744 0.66 -47 28397 60976 16642 77342 0.57 -49 28501 57878 23998 78631 0.41 -47 28598 46500 35428 80475 0.14 -37 28702 31442 45008 80086 -0.18 -23 28800 18736 49560 75560 -0.45 -7 28897 13184 51822 69920 -0.59 4 28999 12084 52470 65955 -0.63 11 29102 11924 52404 64633 -0.63 17 29198 11878 52354 64375 -0.63 24 29300 11922 52172 64222 -0.63 30 29399 13192 51606 64378 -0.59 35 29498 16370 50314 65195 -0.51 36 29601 21518 48806 67271 -0.39 35 29698 29220 46094 70776 -0.22 31 29803 37744 42130 75172 -0.05 25 TurnToHomingBeacon exited with Steering = -0.05 Should be close to beacon centerline val avg = 75172, SteeringVal = -0.055 IRHomeToChgStn with detection value = 80398, Steering = 0.09 & IRHOMING Kp,Ki,Kd = (75, 0,40) front dist = 122, avoidance dist = 0 Time BattV Fin1 Fin2 Steer PID_Out LSpd RSpd FrontD RearD 31939 6.86 47052 39000 0.09 -3.27 71 78 122 43 32036 6.77 47008 39042 0.09 -6.98 68 81 123 49 32137 6.83 47626 40062 0.09 -6.72 68 81 116 44 32237 6.75 48380 43116 0.06 -5.46 69 80 114 48 32337 6.82 50606 46486 0.04 -3.79 71 78 114 57 32438 6.85 53028 50760 0.02 -2.46 72 77 111 61 32537 6.85 55452 56032 -0.01 -0.69 74 75 104 60 32638 6.86 57998 61800 -0.03 1.32 76 73 100 64 32739 6.72 60542 68338 -0.06 3.39 78 71 97 75 32840 6.70 64942 74526 -0.07 4.82 79 70 95 80 32940 6.78 71884 79754 -0.05 4.57 79 70 90 75 33036 6.67 81310 84894 -0.02 2.83 77 72 86 81 33141 6.84 90606 92696 -0.01 1.26 76 73 83 89 33236 6.86 98940 101460 -0.01 0.90 75 74 79 89 33338 6.84 108390 112432 -0.02 1.14 76 73 75 90 33436 6.86 117900 124044 -0.03 1.62 76 73 69 104 33539 6.86 133920 136456 -0.01 1.34 76 73 66 110 33640 6.86 157150 150632 0.02 -0.37 74 75 61 103 33736 6.86 185900 168138 0.05 -2.60 72 77 58 109 33837 6.86 221118 193390 0.07 -4.35 70 79 52 123 33937 6.68 262698 222510 0.08 -5.57 69 80 48 123 34039 6.86 296898 256092 0.07 -5.90 69 80 40 750 34136 6.73 343506 290618 0.08 -5.87 69 80 35 750 34239 6.85 481186 345974 0.16 -9.06 65 84 26 819 34336 6.85 851810 480074 0.28 -16.31 58 91 20 819 34438 6.86 1434172 684000 0.35 -23.56 51 98 13 750 34538 6.77 2083914 1004848 0.35 -26.39 48 101 11 750 34638 6.85 2424412 1658876 0.19 -20.54 54 95 9 750 34737 6.84 2468376 2381848 0.02 -8.12 66 83 4 819 34838 6.94 2444718 2432648 0.00 -0.80 74 75 4 819 Charger Connected at 34839 Robot has successfully connected to charger! Reset VL53L0X Teensy to reduce current consumption ChgSec BattV TotalI RunI ChgI RearD 0.0 6.9568 1.2419 0.4290 0.8129 0.1 6.9697 1.2355 0.3968 0.8387 |
Stay tuned,
Frank