Skip to content

Commit 8dcb565

Browse files
authored
Merge pull request #147 from orionrobots/import-2018-build-journals
First piwars 2018 build journal converted - video linked too.
2 parents b85d8ec + 97551cf commit 8dcb565

13 files changed

+771
-3
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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
240 KB
Loading
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: My Raspberry Pi computer vision robot Skittlebot works!
3+
date: 2017-05-14
4+
tags: [robot building, piwars, opencv, electronics, power, raspberry pi robotics project, raspberry pi opencv project, gpiozero robotics project]
5+
thumbnail: content/2017/05/14-skittlebot-video/skittlebot-working-screenshot.png
6+
---
7+
I now have my Raspberry Pi based computer vision demonstration robot working! This is a big step forwards, as I can start looking at more interesting projects and competitions with it.
8+
9+
## Specifications
10+
11+
- 4Tronix PiCon Zero
12+
- Raspberry Pi 3
13+
- V1 Camera module
14+
- 4Tronix Initio chassis
15+
- Logic power is a USB power bank
16+
- Motor power is 6xAA batteries
17+
- Raspberry Pi image created with PiBakery - and using precompiled NUmpy and OpenCV libraries
18+
- Programmed in Python
19+
20+
## Updates since last time
21+
22+
I've rewired to use the PiCon Zero instead of the L298n and all that point to point wiring. This has made it a lot neater, and there's less to debug.
23+
24+
I've also separated the Raspberry Pi power out to a USB power bank. This means I can run the Pi without the motors, and I can also run the motors without the Pi. This is a good thing, as it means I can debug the motors without the Pi crashing. It also means that large current issues won't reset the Raspberry Pi.
25+
26+
## Video
27+
28+
The Skittlebot video tells the story of it's creation, and adaptation from the Arduino robot, along with the first tests of the computer vision system.
29+
30+
<iframe width="560" height="315" src="https://www.youtube.com/embed/z14HcflsRW0" frameborder="0" allowfullscreen></iframe>
31+
32+
Skittlebot was built when I found that armbot was too big to come to PyCon Uk 2016. It uses a camera and visual processing to locate coloured objects, and knock them over. See how I built it, see it running, why I made it and how the code was written.
33+
34+
The video mixes footage that was unreleased from multiple sessions, and includes the point where I'd shaved my head for a while!
35+
36+
## Code
37+
38+
The software uses PiCamera, Python and OpenCV.
39+
40+
The code is at <https://github.com/orionrobots/skittlebot>.
913 KB
Loading
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Turning Skittlebot into a PiWars Robot
3+
date: 2017-10-13
4+
tags: [robot building, piwars, opencv, electronics, power, raspberry pi robotics project, raspberry pi opencv project, gpiozero robotics project, piwars, robotics competitions]
5+
---
6+
Skittlebot based on the Initio chassis may actually be a little slow to be a piwars bot, but it's certainly a great platform to get the basics down.
7+
8+
So the plan is a set of experiments, to get the code going, get the Raspberry Pi and power in a good state, then look at making it all faster and lighter.
9+
10+
this plan is likely optimistic, but lets get as many ideas down as we can first.
11+
12+
## Major areas to cover
13+
14+
* Remote - I have a Playstation Six Axis controller. Getting this paired with the device, and repeatable so I have code + PiBakery recipe is expected.
15+
* Straight Line autonomous - build a rig similar to the straight line at piwars - get SkittleBot good at touching no sides and going as fast as it can along the line - not that there IS a line to follow on the floor too - which may be easier than other sensors.
16+
* Camera - the over the rainbow challenge, and the rear ultrasonic sensor.
17+
* Spec out replacement chassis - customised:
18+
* 3D printed, off the shelf, toy hack or CNC carved?
19+
* Faster motors.
20+
* Line follower modules.
21+
* Power - separate Pi and motor (as SkittleBot already does).
22+
* Make the bottom half only first - get this right, with a simple bracket for the pan/tilt mechanism I already have.
23+
* Test driving WS2801's from a Raspberry Pi.
24+
* Replacement top
25+
* Get styling here - something unique to orionrobots - possibly doing a few thick structural 3D print areas, but many thin/hollow areas that are purely for style.
26+
* Consider the WS2801 6 Status LED's at this point.
27+
28+
## Remote
29+
30+
The SixAxis controller is Bluetooth. There is a [PiBorg guide](https://www.piborg.org/rpi-ps3-help) on connecting them up. Lets follow that - and get it driving over bluetooth.
31+
32+
Consider the inputs library? <https://pypi.python.org/pypi/inputs>
33+
34+
A bit less heavy than pygame - but not sure it'll work with the ps3 sixaxis. This library has come from Zeth, a rather instrumental part of PyCon UK!
35+
36+
The PyGame route: [PS3 controller with PYGAME](https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=147234)

0 commit comments

Comments
 (0)