Building a robot YOU can drive around MY shop Pt.5
Chat successfully drove the robot for the first time! They managed to form a democracy and didn’t destroy anything of value! That doesn’t mean that y’all aren’t a handful and don’t need babysitting though…
This was streamed on Twitch on Dec 21, 2020.
Special thanks to Greg Needel of REV Robotics and @Esden for the robotics care packages!
00:00:00 Stream starts
Stream Starts! Happy Solstice!
We have a whole bunch of regulars in chat!
Hopefully we’ll do a long stream today, Scotty is really looking forward to diving into the robot proper.
Robogreg enters the chat. Scotty does a very quick introduction.
No Ambrose today.
00:02:56 Shenzhen BBQ Bicyclemen anecdote
Interacting a little more with chat, Scotty agrees the BBQ bicyclemen are awesome.
Apparently local government is cracking down on them so they come out later.
Some of the best Shenzhen streetfood is found through these services though so it’s a shame they’re dissapearing.
00:04:08 VODs and what to do with them
VOD Talk and what to do with them!
Scotty professes to having been lazy and not downloading the VODs from day 1 so some of them have gone.
If anyone has any early VODs downloaded, Scotty would love to have them!
The vods will probably go onto a new YouTube channel.
After a suggestion in chat about youtube-dl, Scotty explains he uses twitch-dl
twitch-dl works ok but he wants it to automatically mirror everything and needs some additional glue. Scotty is looking for some python help for this.
Ideally he wants to contribute a patch to twitch-dl to mirror stuff back.
00:07:06 Scotty’s truck stuck in a ditch
A lot of snow has dissapeared in the Pueblo but Scotty went down the one road that still has snow and he got stuck in a ditch so there was no stream yesterday.
Scotty shares a photo.
With a winch, kittylitter and a tree, they spent 2hrs recovering his truck.
00:13:39 Workshop tour
After talking about Python for a bit and setting up his iPhone to use as a camera, Scotty gives chat a little workshop tour.
There are idea’s (not plans) for a Casey Neistat inspired TV on the door with a webcam to make door look transparent or DIY-Perks inspired LED window light as there are no windows and it’s not very good for mental health.
00:20:56 Robot recap and tool recommendations
Let’s get into robots!
Scotty is trying to pick and choose what to show on stream to make the streams interesting.
He runs through the next steps, what he already did, and some other plans for the robot.
Scotty will have to drill and tap holes into the aluminium base plate to install standoffs for the raspberry pi.
He first figures out where to put the raspberry pi and the power switch so he can mark where to drill and tap on the plate.
Scotty explains how he outfitted his shop. Going from 0 to a good shop in a short ammount of time meant he had to lean heavily on good recommendations (a lot from Adam Savage) rather than going through the organic growth process over many years.
00:28:55 Securing the power switch and Pi
After setting up the robot on his workbench and moving cam and audio over, Scotty begins by punching the holemarks he did earlier.
Ideally, Scotty would need an M2.5 tap but he doesn’t have one. He resorts to using M3 instead.
Scotty has his ducks in order and begins drilling the aluminium for the Raspberry Pi standoffs.
First drillbit doesn’t do much, perhaps dull? 2nd bit works like a charm.
after freehand drilling the mounting holes for the pi standoffs, Scotty punches the holemarkers for the switch on the aluminium edge
These mounting holes are also freehand drilled.
Scotty doesn’t have a tapping tool for a blind hole (hole with no exit) so he’s trying to drill a little farther to account for space for shiops and shavings to collect.
With the holes drilled, it’s time to tap but there’s a problem.
Scotty drilled 3.2mm so M3 tap won’t work. He needs to step up to M4.
Scotty first drills out the holes in the powerswitch mounting bracket to accommodate for the new size bolt.
Chat discussing tapping guides and shares Adam Savage’s tapping guide
Powerswitch holes are done!
Scotty fixes the powerswitch to the base.
Scotty interacts with chat a little, accepting praise.
He says he’s considering working with someone, offering a paid position on the StrangeParts Team for sourcing parts
Scotty spends a lot of time sourcing and some projects get delayed because of sourcing.
If sourcing sounds fun, let Scotty know through Discord!
Sourcing is a mixture of tracking stuff down on the web and talking with people to find specific items.
Scotty can spend half or whole days on this and is looking for someone to help out.
Find us in Discord or on firstname.lastname@example.org
Going through parts bins, Scotty looks for bolts, washers and nuts for the Raspberry Pi and PWM Hat
Scotty doesn’t tap these holes, they’re countersunk only.
He fixes bolts through them with a nut.
01:22:42 Anecdotes on unit testing and datacenter fires
Scotty gives us a story about his previous job at Google.
Triggered by @tzarc in chat explaining they were busy with unit testing.
Meanwhile, Scotty gets the Raspberry Pi installed on the standoffs.
After changing camera angle, Scotty tells chat another Google story about an SRE early in the company history.
The story goes that an SRE figured out a fire was going on in a datacenter based on harddrive failure monitoring alerts.
Talk morphs into how servers get names and what they do but, Scotty has more or less completed the powerswitch and Raspberry Pi steps!
01:35:36 Securing the battery
After connecting all the pieces of hardware, Scotty notices he needs some way to secure the battery.
He cuts some velcro to size and drills a couple of holes.
Flipping the robot over to reveal the bottom, Scotty starts to tap the holes but disaster strikes!
He snaps his first tap.
After redrilling new holes, he taps one normally and the second with a drill (not enough clearance for the tool)
Scotty lines up the velcro but decides to retrieve some scrap wood to use as a backing to drill holes in the velcro.
Hits his head pretty hard and loses an earphone in the process.
After regaining composure, the velcro straps are fixed to the base and the battery is secure!
Scotty takes a few minutes to catch up on chat, get his desk setup sorted.
He shows chat a view of outside.
02:10:26 Soldering, connecting and powering, oh my!
With a lot of the base components connected up and fixed to the robot base, Scotty moves to solder components to the PWM Hat.
Chat moves to clip Scotty hitting his head.
While Scotty solders the pin headers for the motor controllers, he answers workshop questions posed in chat.
After a little research and consultation with Greg, it’s decided not to power the PWM Hat as it doesn’t separately power the motors.
Scotty puts the hat on the pi and hooks up the motors to the hat.
HE solders alligator clips on to the end of the battery power cable, powering the whole thing!
Unsure of what it will or won’t do when he powers it on (It should do nothing) Scotty makes sure the robot isn’t on the desk.
He accidentally flips it on when manoeuvring the bot – nothing happens.
02:39:01 Configuring connectivity to the robot
The robot is now safely stored away on a box so Scotty can now begin the programming process.
OR so he thinks, first he needs to ‘configure to brake’ (a motor setting to stop the bot from coasting)
Referencing hitting his head, Scotty notes he has blurry vision.
While updating the robot with various installs to support remotv etc, Scotty goes through the rest of the steps and documentation to prepare anything he may have missed.
It seems the ADAFruit PWM is supported OOB which is a bonus!
Once all the various packages and parts are loaded, Scotty can start to setup the controller.conf file
Through various troubleshooting cycles, Scotty eventually figures out he’s missing the Adafruit_PCA9685 package for python
03:07:26 Configuring robot motion controls
Oh my god, something moved!
One motor moved when Scotty pressed “forward”!
Through trying random actions, Scotty notices he likely needs to setup/code/program/”tell it” to use more than one wheel.
It takes a small while – Scotty needs to read through a lot of documentation and work out which avenue is best to pursue.
Eventually opens adafruit_pwm.py to look at motor control code
In a copied file of the original config, Scotty starts to experiment and tune the config to figure out how to control motion.
It’s a very trial and error based process with a lot of interaction with chat and looking through either libraries or examples along the way.
Topdown cam is moved so chat gets a good view of the robot while Scotty tries changing variables.
After figuring out what max “forward” and “backward” values are, Scotty calculates the “stop” value and tests his findings.
Setting all motors “backwards” reveals a caveat – opposite motors need to be driven in opposite directions. If they all spin clockwise, the robot will go in circles.
To make things easier for humans as direction + speed is dictated by on a numerical scale from 92 to 520, Scotty makes a convert map to map -100 to 100 on that scale.
Now instead of remembering 92 to 520, Scotty can code using -100 to 100.
Scotty, referencing Agile Spike Work, explains to chat he’s just worrying about getting a thing to do something. It doesn’t have to be pretty or valuable, just as long as it works, he can “refactor” or make it better in future iterations.
He quickly created a custom module with updated commands for “forward” and “backward” but this seems a little too fast
a moire suitable speed is dialled in pretty quickly and now Scotty can make progress quickly.
After deciding which buttons will be turn and strafe, Scotty consults a diagram on how to drive mecanum wheels, the associated configs are input but it appears the way mecanum wheels are setup, left and right were reversed.
directions are reversed and normality is restored.
Turning left and right was easy to configure as that’s tank driving.
04:01:38 Giving the robot an eye
Raspberry Pi Camera? And declare victory and unleash it upon the world?
Scotty wants to find a way to let someone else drive the robot safely so he goes to find his raspberry pi camera and lenses.
Scotty grabs a Pi Cam HQ and a 6mm wide angle lens.
It’s installed quick enough but there’s no obvious way to mount it so Scotty drills a new 1/4″ hole
The raspberry pi camera is attached directly to a bolt which is bolted through the bottom plate with a nut, no threading required.
Scotty enables the camera in the pi config
Answering a pressing chat question on OBS noise filters (RN Noise in OBS) Scotty troubleshoots why the camera isn’t immediately working.
chat offers additional troubleshooting steps, Scotty obliges and proves the camera works by taking a still.
Weirdly, camera image just “starts” on remo.tv All Scotty has to do is fix focus.
04:29:24 Chat is unleashed upon the robot
We have focus! The robot has an eye!
Scotty drives the robot first, he does intend on letting chat try it but Scotty wants to be first.
“What could possibly go wrong?” as chat are given the link to the robot
Apparently, control is shared between everyone on the link, there is no “time slicing”
Chat starts pushing a chair around the workshop.
Pan/Tilt options are mentioned, Scotty has servos, he needs to print brackets.
Chat would like a ball to play with.
Chat is given one of Ambrose’ chew balls but the robot is too large and runs it over.
Chat successfully scare Scotty by knocking a waterdish.
Scotty is trying to figure out time slicing to limit control to 1 user at a time
Summing up chat’s achievements, Scotty commends us;
“You’re successfully controlling a robot. YT have formed a democracy and you haven’t yet destroyed anything of value. This is going well.”
Scotty wants to hookup Text to Speech (TTS) but will need a speaker to do that
04:43:52 Improving on the camera’s location
Chat knocks the camera again and needs to be saved by Scotty.
To stop this from happening again, Scotty moves the camera back by drilling another hole through the base plate.
04:50:51 Chat form a democracy
Robot boots again with improved camera position
Scotty looks but can’t find a speaker to add to the robot now.
Chat manages to tangle the robot in Ambrose’ leash
Scotty lists he would like to add headlights, a speaker for TTS and Pan/Tilt for the camera.
Chat manage to knock over a broom in the storage room
Going through his Arduino kits, Scotty has a look to see if there is anything of interest for the robot.
Answering chat, Scotty confirms the plan is to have channel point redemption setup private control of the robot for a given amount of time.
Sadly, the arduino kits didn’t contain anything interesting to add to the robot.
Meanwhile, chat manage to push a ladder in wood storage so far that it wedges between a rack and the wall, thereby trapping the robot.
Scotty refocusses and starts figuring out how to connect the robot to a bluetooth speaker for TTS.
Robot is rebooted after installing bluez-tools and comes back online, blind. Once again, camera just “starts” working without a real cause.
While troubleshooting Bluetooth woes, the robot appears to “stuck” on a command and needs to be rescued.
Scotty notices chat unplugged one of the motor power wires, or perhaps he did, it’s unclear.
chat gets a third person view of themselves stuck on the broom handle.
05:20:11 Adding Alexa as a bluetooth speaker
@boxkid suggests checking raspiconfig for bluetooth settings.
Scotty checks this but chat interrupts claiming success – they switched the robot off by backing into the power switch.
After rescuing chat again, there remain config problems with bluetooth on the raspi
Scotty starts to wind down as he reboots the robot one last time after trying another bluetooth config change.
Scotty cleans up his shop as he leaves stream running and the robot in the incapable hands of chat.
Scotty ends Stream as chat powers down the robot.
05:48:10 Winding down