The primary UI the Pocket NC presents is a web interface accessible over a virtual USB based ethernet port. I wanted to be able to run mine not immediately near an ethernet jack, but also didn’t want to have to tote a laptop over every time to check on it. I had plenty of raspberry pi’s lying around, so rigged one up as a wifi bridge.
First, I found a random case to print from thingiverse, the TurboPi:
Then I gave it a fixed IP address on my wifi network and set up IP forwarding with NAT.
iptables -A POSTROUTING -o eth1 -j MASQUERADE
Then, I saved that config:
iptables-save > /etc/iptables.ipv4.nat
And restored them in /etc/rc.local
iptables-restore < /etc/iptables.ipv4.nat
Finally, I enabled forwarding in /etc/sysctl.conf
Finally, I added a route on my desktop with the raspberry pi’s address as the gateway. Now I can transparently access the PocketNC from anywhere!
With my efforts to build a gearbox transmission and subsequent plans for a quadruped, there are a lot of parts which just can’t be made effectively from 3d printed plastic. To date, I’ve sent out a few parts of the gearbox to CNC shops, which while effective, has a relatively slow turn around. The best you can get without paying an arm and a leg is something like a week turnaround. One thing I’ve learned from having a 3d printer on site is how transformative it is to be able to have single day turnaround for parts. Thus, I thought I would experiment with CNC machining on a small scale locally and recently acquired a PocketNC V2-50.
Since this is the V2-50 version, it has a 50,000 rpm spindle, theoretically giving it at least passable material removal rates in aluminum. Most of my gearbox parts look like they could be machined in an hour or so.
To date, all I’ve done is machine half of a sun gear holder out of the wax stock that ships with the mill. I took it plenty slow and consider it a success that I managed not to break anything on the first try.
The result is approximately a thousandth off from what I was aiming for on the two critical dimensions I tested, although that probably doesn’t mean much since it was just wax. It remains to be seen what I can achieve in aluminum.
Now I actually need to get the tools and fixturing that will let me machine the other half.
Another of the failure modes observed during the 2019 Maker Faire was in my quickly slapped together leg design. The shoulder joint was required to squeeze two motors together against a strongly tensioned belt, using nothing but a relatively thin section of printed plastic. This caused it to deform, leading to belt tooth skipping, and then eventually to fail, leading to delamination of the shoulder joint.
My plan to resolve this is to switch to a leg design where the upper and lower leg are in series rather than opposing one another. This is more like the Mini-Cheetah design from Ben Katz. This has the benefit of getting the leg out to the side, so the upper leg is free to rotate 360 degrees, only limited by cable harnessing. As seems to be my pattern, I’ll try making something out of 3d printed PETG first, optimize it some, and if I fail there, switch to metal. Here’s a render of the current CAD:
Eric from CireRobotics helpfully pointed out that I’m way over the design limit for the 6mm Gates belt I was using, so I’ll also be trying to bump up to a beefier belt in this iteration.
As seen at Mech Warfare 2019, the existing gearbox motor shroud isn’t really up to the task of supporting the weight of a 20lb robot. While I work on a more comprehensive redesign, I’ve got a short term fix in the form of another 3D print. This is just a simple reinforcing ring, printed at 3mm thick, with the layer lines oriented so that layer separation will not be the primary failure mode. It is attached to the outer housing via a thin layer of epoxy.
Due to the unconventional orientation, removing support was a pain, but doable.
After a concerted push, I managed to get Super Mega Microbot “Junior” walking, for all of 15 minutes, then packed it up and went off to compete in Maker Faire. Needless to say, with that much testing, I wasn’t expecting stellar results, and I wasn’t disappointed. However, I did learn a lot. Here’s some of the things that went wrong:
Gimbal and Turret EMI
For this new revision of SMMB, I updated the gimbal board to use RS485 and support the 5S system voltage. I tested it some, but apparently not enough. While I observed no problems during Thursday or Friday’s testing at the site, during the first Saturday match, after firing the gun a few times, the gimbal went into a fault state and stopped applying power. The control scheme for SMMB relies on the turret being operational, so this not only made it impossible to aim, but also made it nearly impossible to drive.
I did manage to connect to the turret manually after the match to diagnose the problem, and discovered that the IMU had stopped communicating over I2C. I had some half-baked logic to try and recover from that, but it was broken, and the only effective way to recover was to power cycle the whole unit.
Unfortunately, my matches on Saturday were all close together, so I didn’t have enough time to prepare a fix in between. Thus, each match I got one or two shots off, and then the machine as a whole became effectively inoperable.
Likely, something in the new board, either in the layout or the decoupling capacitors, results in worse electrical noise than the old one when the AEG is fired. This shouldn’t be too hard to resolve, either through tweaking the layout, or perhaps moving the AEG control to an entirely separate board.
Walking and Leg Robustness
When I got the gearbox system walking for the first time, I quickly noticed that one or more of the timing belts connecting the lower legs to their motor had a propensity to skip a tooth. Since there is no position sensing directly on the lower leg, when that occurs the gait logic just has the incorrect position, causing the robot to fall over pretty soon afterwards. I had never observed any tooth skipping in my previous direct drive leg, even when jumping for over an hour. The first difference I thought which might be causing the problem was the lower pulley print, which I had initially done at 0.15mm but in the gearbox revision it was at 0.2mm. So I printed a full set at 0.15mm, and swapped them in. However, that didn’t fix it and I didn’t have any more time for mechanical solutions, so I tried to work around it by tuning the gait to be as gentle as possible.
Unfortunately, I wasn’t really able to come up with a gait that both could effectively move on the foam mat in the arena, and not occasionally result in belt skips. Also, as I went along, the skips got worse and worse. I tried upping the tension on the belt, lowering the tension on the belt, walking with a straighter leg and more bent leg, nothing much made a difference.
Finally, before my third match, I did more examining and realized that the shoulder joint was deforming significantly under the tension of the belt, resulting in the timing belt only contacting maybe half the pulley or less, and the rest dangling off. Also, the pulley was out of alignment, so the belt was probably only effectively making contact in an even smaller patch. Unfortunately, there was very little I could do about that aside from hope for the best. As it turns out, that problem, while limiting the gaits I could use significantly, didn’t result in ending my run.
Gearbox Outer Housing Strength
The entire gearbox effort was undertaken somewhat at the last minute, and with little thought to analysis or design for structural integrity. At best, I made a gut check of “that’ll probably work”, and at worst, I gave it no thought at all.
It was an instance of the latter that caused the final and fatal failure in SMMBJ at Maker Faire. In the gearbox chassis design, the lateral servos themselves support the entire weight of the robot. Those gearbox servos transmit the entire load from the front plate of the servo, through the outer housing, then to the back plate, and finally to the chassis itself. The problem in this case is that the outer housing is a 1.5mm thick (or rather thin) PETG shroud printed with layer lines perpendicular to the primary load.
On reflection then it was not too surprising that a 20lb robot walking around was enough to cause a motor’s shroud to separate at the layer lines, which is what ended SMMBJs run. I had a spare motor and could have replaced it, however, it would likely have failed shortly afterwards too, and the shoulder was about to rip itself apart due to the leg tension problems mentioned above. Thus I turned it into a “static display” and switched to a “show and tell” mode for the rest of the event.
Despite those problems, the kind organizers at RTeam awarded me the “Most Innovative” award for trying to push the limits!
Fixing the problems
Clearly, all of these issues can be fixed in a variety of ways, both easy and hard. Keep coming to see my attempts!
Well, Mech Warfare at Maker Faire 2019 has come and gone. Maker Faire was a really awe inspiring event, and RTeam did an excellent job organizing the Mech Warfare competition. There were something like 13 teams with moderately functioning mechs who competed across the 3 days.
Super Mega Microbot “Junior”
My entry, Super Mega Microbot Junior, did manage to walk a bit in 3 matches, but had a previously unseen failure in the turret system that rendered it inoperable a short while into each match. At the end of the 3rd match, one of the leg joints sheared off, and some other of the 3D printed parts were about to fail as well, so I declared it unrepairable at that point.
I’ll write up a more detailed lessons learned and link to the videos of my matches when they get posted. The videos aren’t all that interesting, given that I only scored perhaps 2 hits across all 3 matches. 😉
Alert! I’m at Maker Faire Bay Area all weekend in the Mech Warfare area in Zone 2 (May 17-19, 2019 for you time travelers from the future). Drop by and say hi!
If you were left in suspense last time, yes, the robot can walk! Getting it to do so in a minimal way was relatively painless. What I found, which hadn’t happened in earlier iterations, is that many types of dynamic motions would cause the lower leg belts to jump a tooth. Needless to say, this was nearly universally fatal, as there is no direct position sensing of the lower leg. This robot is heavy enough that my simulacrum 3d-printed timing belt pulleys just don’t cut it.
Well, there wasn’t enough time to actually get better pulleys now, so I just tuned the walking to be slow and gentle enough that nothing went awry. Here’s the first bit of a 13 minute video I took of it walking around and shooting targets.
Now, that that was over with, I had a few minor things to finish up before heading out to Maker Faire. I made some covers for the motors to keep BBs out.
And I made a bracket so that I could attach the front and rear target panels to shoulder joints:
And here’s a glamour shot of the whole thing in fighting form!
Now that it was all ready, time to take it all back apart and pack it for shipping.
As mentioned last time, I needed to build a lot of gearboxes and new leg assemblies in a very short amount of time. So, I got to work.
I made a new fixture for holding stators to be extracted:
I turned down 8 more internal gears. To begin with, my mandrel had warped enough from the first gears that I had to add some heat set inserts to hold a cap to keep the gears on. Then on the last 2 gears, I got greedy, went too fast, and my lathe mandrel melted entirely.
So, I had to spend 12 hours printing another one to finish up the last two internal gears, although their roundness was debatable after their encounter with the mangled mandrel.
I also at this point machined out a bunch more rotors, but didn’t manage to capture any photos.
Now for some assembly:
At this point I was 3d printer limited, and when I got to starting assembly, I only had 7 sets printed. Thanks to some very generous help from Beat and Roxi (thank you triply in advance!) I had a second Prusa MK3 that was also working 24/7 on the problem.
Notice how now I’m up to 8!
When I went to put on the backplates, I discovered that due to tolerance stackup, some of the units were having trouble fitting. To move on quickly, I post-machined all the backplates to move the rotor bearing back a bit with a dremel, and then made a little bit of clearance for the sun gear holder screws.
And then, TADA!
Now, in parallel to all that, I also designed a new leg which would mount to the gearbox output. I wouldn’t have time to get a shoulder bracket made out of metal like I had before either, so I needed to design that for 3d printing too.
I made a few improvements this iteration. The biggest was that I added a tensioning mechanism inside the upper leg, so that tension could be increased after installing the lower leg. The old leg was nearly impossible to assemble without breaking it, and was just as difficult to disassemble. Also, I managed to have an actual order of assembly that was feasible and that an appropriate tool could fit in at all places at each stage of the process.
What I didn’t try to do was to try a more mini-Cheetah like geometry, or really optimize for mass or looks or anything. I was trying to get something which would likely work for the length of a Mech Warfare match in as few drafts as possible.
Of course, the first iteration wasn’t necessarily functional. It came off the press at something like 3am Friday morning. I spent the next 4 hours machining, debugging and squeezing until I found about a dozen problems or things that needed to be fixed. Then, straight back to the printer for a second try, and voila, two was all I needed this go around!
Here is the final part-set with all metal bits installed:
I drew and printed up the shoulder in a separate effort, but managed to capture no pictures of it whatsoever until I went to put it all together.
Now, here is a shoulder attached, with the upper leg motor and upper leg installed.
And from the other side:
And, the entire first leg:
After carefully managing my 3d printing queue 24/7 to get all the legs, shoulders, and gearboxes printed, here’s a picture of all the legs on at the same time!
Now that I could stand up and sit down, I needed to be able to walk reliably for the length of a match. This wasn’t going to be easy because the direct drive motors were always a bit marginal in their power output to support the full robot, so I had my work cut out for me.
The short story is, I tried many things, spent about a day examining high speed video of walking, and made some improvements:
Inverse Kinematics: I discovered that my inverse kinematics were broken when the coaxial lower leg had a non-unity belt drive ratio, which I switched to partway through my mammal leg experiments.
Less bounce: I updated the leg to stay in the world frame until it was fully lifted and to enter the world frame before lowering. This would ensure it had zero lateral velocity relative to the ground when starting and stopping the swing phase.
More less bounce: I added a separate slew time for the lowering part of the phase, this allowed it to lower more slowly for a more gentle landing.
Event more less bounce: I used the moteus servo’s advanced features to lower the P controller term while the leg was lowering, so that it would hit more softly.
Despite all these improvements, the walking was still barely functional. Also, the robot was just too tippy. The servos didn’t have enough control authority for the mass of the machine, and it was likely going to tip over if another mech did so much as graze it. Also servos that were hot for long periods of time kept having their encoder calibration drift. This seemed to occur in a positive feedback cycle… if a motor was a little bit out of calibration, it might be a bit saggy, and thus would need more torque, which would make it hotter, which would make it more out of calibration.
Here’s a quick slow motion video of about the best walking gait I had achieved:
At this point, I was certainly somewhat dispirited. It was pretty clear that this machine could not reliably walk around the arena for the length of a match. But, there was still some time left and I figured I would not give up just quite yet.
In the spirit of failing upward, I decided to try and make a sprint towards a fully gearbox driven machine. Granted, I didn’t really have enough time to pull this off. The first 4 gearboxes I built each required about a day of 3d printing time and took me about 1.5 days of machining and assembly. When I made this call, there were about 8 days before my plane flight to Maker Faire. I would need to make at least 8 more gearboxes, as well as entirely new legs and shoulders, along with spares and then make it all work in an incredibly short period of time.
Before SMMB could function in the Mech Warfare event it needed to be able to start and stop unattended. That meant standing up and sitting down on its own. Being that hack that this was, I went for a two pronged approach.
The direct direct servos I have for the upper and lower legs are somewhat underpowered for this size of robot. Especially so when the machine is fully squatting down. Also, the servos aren’t really encapsulated at all, and there are plenty of leg configurations that can self-intersect resulting in robot harm.
To avoid all of that, I 1) installed a second pair of permanently affixed “resting legs”, that mean the robot never has to squat down all the way. These are just some PVC pipe with squash balls glued on to the bottom. I printed bottom plates for the chassis with small cutouts to hold the top of the PVC pipe.
Next, I added a short startup and shutdown sequence. The startup sequence first moves the motors from wherever they happen to be to some fixed distance above their intended idle position, purely on a servo-by-servo basis. I don’t yet have position feedback making it into the C++ application, but the servos themselves can interpolate form their current position, so this was a fair way to get the whole thing into a known state. The only trick was that I had to linearly ramp up the power applied to the lower leg so that it didn’t get stuck dragging along the ground. A future solution that used position feedback, and thus IK, wouldn’t have that problem. The next part of the startup sequence just smoothly lowers the legs until the full robot weight is resting on them. At this point, the robot is freestanding.
The shutdown sequence only does half of the inverse. It smoothly raises the legs until there is no weight on the robot, then cuts power.
Once I get a robot made fully with gearbox servos instead of direct drives, and positioning sensing working at full rate back into C++, I should be able to undo some of these hacks and get it starting from arbitrary configurations without the help of the resting feet. However, this is good enough for now.