|
| 1 | +--- |
| 2 | +title: Skittlebot build journal, 7th May 2017 |
| 3 | +date: 2017-05-07 |
| 4 | +tags: [robot building, piwars, opencv, electronics, power, raspberry pi robotics project, raspberry pi opencv project, gpiozero robotics project] |
| 5 | +thumbnail: content/2017/05/07-skittlebot-build-journal/skittlebot-chassis-thumb.png |
| 6 | +--- |
| 7 | +Skittlebot is designed using the 4Tronix initio robot base. It is built around a Raspberry Pi for remote control, and for experiments with computer vision. |
| 8 | + |
| 9 | +I'd built this initially as a simple Arduino robot in 2016, but now it is time to make it something far more exciting. It's called Skittlebot because it's original goal was to follow a plastic, brightly coloured skittle (bowling pin) around. |
| 10 | + |
| 11 | +It is being prepared for possible entry into the PiWars 2018 competition. |
| 12 | + |
| 13 | +This setup used VNC to control the robot and see the output of the camera. The camera is a Raspberry Pi camera module. |
| 14 | + |
| 15 | +## Progress so far - OpenCV colour tracking |
| 16 | + |
| 17 | +Last night the opencv work to track colour was finally attempted right on the robot itself. |
| 18 | + |
| 19 | +I was able to get the output I wanted - console output, and the display (via vnc) of the tracking, with the tuning parameters. |
| 20 | + |
| 21 | +However, vnc is a little bit iffy here, and stops actually doing screen updates. |
| 22 | + |
| 23 | +I then started to combine it with code to drive the motors. |
| 24 | +The motors and the shared power were unplugged, with the Pi running off a USB supply while I was working on it. |
| 25 | + |
| 26 | +I also seem to have destroyed a memory card yesterday on this set up. |
| 27 | + |
| 28 | +When it tried to drive, the system reset - after a tiny movement of motors. |
| 29 | + |
| 30 | +So - the next step is to look for power issues. |
| 31 | + |
| 32 | +The power issues could be: |
| 33 | + |
| 34 | +- Low batteries - check them all - should add to more than 6.6v. |
| 35 | +- Bad connections - check these - I did undo wiring. |
| 36 | +- The UBEC could actually have gone wrong, as I had USB voltage while the UBEC still present. lets hope not. |
| 37 | +- Under-volting as motor current makes the system drop - the UBEC should help, but it drops at 6.6v. |
| 38 | + |
| 39 | +## Batteries |
| 40 | + |
| 41 | +This is unloaded voltages on an array of 8 AA batteries - these are high voltages for NiMH. |
| 42 | + |
| 43 | +- 1.363 |
| 44 | +- 1.364 |
| 45 | +- 1.365 |
| 46 | +- 1.365 |
| 47 | +- 1.365 |
| 48 | +- 1.365 |
| 49 | + |
| 50 | +About 8v. They are dead or dying alkaline batteries. |
| 51 | + |
| 52 | +## Wiring |
| 53 | + |
| 54 | +Nothing there seems to be wrong, or shorting. |
| 55 | +Lets put batteries in again. |
| 56 | + |
| 57 | +Measure this, and try the simple motor test code. |
| 58 | +-8.18? probes are right. Battery box red terminal on red probe. Whaaat? |
| 59 | + |
| 60 | +Okay - just confusing wiring. |
| 61 | +Powers up - motors turn until I disable motor controller |
| 62 | +Lets see the Raspberry Pi come up... |
| 63 | + |
| 64 | +VNC has reconnected. |
| 65 | + |
| 66 | +Lets try initialising it (I should initialise to stopped early) |
| 67 | +Can I measure the battery output now? 7.34 - still good. (no it wasn't, they were dead) |
| 68 | + |
| 69 | +## Testing |
| 70 | + |
| 71 | +Using gpiozero robot object in the code. |
| 72 | + |
| 73 | +- Initialised. |
| 74 | +- Motor power enabled. |
| 75 | +- Lets try forwards. |
| 76 | +- Reset? Or non responsive after enabling power. Lets switch from vnc to putty. |
| 77 | +- It's not reset - uptime 5 minutes. |
| 78 | +- Just vnc.. |
| 79 | + |
| 80 | +Okay it moves. |
| 81 | +So that is not the reset. |
| 82 | + |
| 83 | +- `robot.forward()` was fine. |
| 84 | +- `robot.left()` was a reset! |
| 85 | + |
| 86 | +Why is that? |
| 87 | + |
| 88 | +- Uptime confirms it is a reset |
| 89 | +- Backwards is fine. |
| 90 | +- Right is ALSO a reset. Is this a big current pull trying to turn? Can we reduce current by reducing speed? The l298 is famously not too clever about this overcurrent stuff. |
| 91 | + |
| 92 | +## Making a lower power board |
| 93 | + |
| 94 | +Lets rejig power: |
| 95 | + |
| 96 | +Ubec to Pi and for L298 digital side. Only motors go from battery directly. |
| 97 | +Create a lower power distribution board (regardless of battery/usb it makes sense). |
| 98 | + |
| 99 | +From bottom to top deck we need: |
| 100 | + |
| 101 | +1. +5v |
| 102 | +2. gnd |
| 103 | +3. line - right - signal |
| 104 | +4. line - mid - signal |
| 105 | +5. line - left - signal |
| 106 | +6. motor left a |
| 107 | +7. motor left b |
| 108 | +8. motor right a |
| 109 | +9. motor right b |
| 110 | +10. motor sense left a |
| 111 | +11. motor sense left b |
| 112 | +12. motor sense right a |
| 113 | +13. motor sense right b |
| 114 | + |
| 115 | +call it 14 (extra one for a sensor?) |
| 116 | + |
| 117 | +Then we bring up 2 sets of 7. |
| 118 | + |
| 119 | +### Right side |
| 120 | + |
| 121 | +Pi Power is here |
| 122 | + |
| 123 | +1. +ve |
| 124 | +2. gnd |
| 125 | +3. motor right a |
| 126 | +4. motor right b |
| 127 | +5. odometry right a |
| 128 | +6. odometry right b |
| 129 | +7. line sense right |
| 130 | + |
| 131 | +### Left side |
| 132 | + |
| 133 | +1. unusued |
| 134 | +2. line sense middle |
| 135 | +3. motor left a |
| 136 | +4. motor left b |
| 137 | +5. odometry left a |
| 138 | +6. odometry left b |
| 139 | +7. line sense left |
| 140 | + |
| 141 | +Wiring is getting too messy. |
| 142 | +Lets swap it out for a picon zero - sounds better. |
| 143 | + |
| 144 | +## Next steps |
| 145 | + |
| 146 | +- Get the wiring working and reliable. |
| 147 | +- Get the power sorted. |
| 148 | +- Make a video of this in action |
0 commit comments