Tag Archives: moteus

Full rotation quadruped build continued

The next step in (re-)building the quadruped with a full rotation leg was getting all the motors ready.  I had to first install reinforcing rings on 6 of the motors:

dsc_0279
My epoxying station
dsc_0278
4x gearboxes with reinforcing rings installed

Then, I needed to lengthen the power leads on 3 of the motors to serve as the lower leg joint.

dsc_0329
Motors with longer power leads

Then I had to assemble all the new legs:

dsc_0557
Upper leg joints mounted
dsc_0558
Lower leg joints mounted
dsc_0563
All three remaining legs built

I mounted them all to the chassis:

dsc_0569
All the legs!

And then re-installed the battery stud and “resting” feet:

dsc_0570

Next up, will be actually powering them and getting it to walk!

Machining a sun gear holder on the Pocket NC v2-50

After doing my first cuts in aluminum, I wanted to actually try and make a real part, to prove that the Pocket NC v2-50 was capable of making things that I can actually use.  My first attempt, was the same part I did my first aluminum cuts in, the sun gear holder from the BE8108 planetary gearbox.

This part attaches to the rotor, the sun gear, the position sense magnet, and has bearing interfaces to the planet input and the back housing.  While not terribly big, the number of features and mating surfaces is relatively large.

First, before we start, here’s a video montage of all the machining, apologies for the bad lighting and focus:

Second, be warned that this is a *long* post!

Programming

As mentioned earlier, I decided to try an approach that would allow the entire part to be machined from a single piece of stock and a single setup.  That is one of the advantages of the 5 axis pocket NC.  Even for parts like this, the 3+2 indexing means that I can access all the faces in one go.  Then to finish it off, at the end I left a thin tab which would be broken by hand and filed away.

Before I get into the details, let me be clear, that this is the first real part I have ever programmed for a CNC and there is a lot I am likely doing in a sub-optimal, if not terrible way.  I won’t document all future parts in this much depth, but writing out my thoughts for this one will, if nothing else, give me a reference to come back to as I find my footing.

I marked all the individual tool paths with an initial bolded number (N:) so that you can correlate them to the video if you like.

Setup

I used 1 x 1.5″ rectangular 6061 stock cut to 2″ in length (so it came approximately 2.125″).  This was placed into the Pocket NC vise longwise, so that the 1″ side just about exactly matches the vise’s set screws.

20190612_sun_gear_stock_setup.png

This part may have *just barely* fit into a 0.75″ x 1.5″ stock, but I didn’t want to risk having so little margin on my first attempt.  I originally chose this orientation because I thought that it would be easier to center by hand, although upon reflection putting the long side against the set screws would allow me to use the narrower 0.75″ stock.

I don’t yet have a reasonable means of cutting stock here, so just had Speedy Metals ship it cut to the correct length.

Back side roughing

1: To start with, I used the 3mm Datron single flute endmill that Pocket NC sells for the bulk roughing of the back side.  The majority of the roughing for that side was accomplished using a single adaptive clear.  The final path looked like:

20190612_sun_gear_holder_back_rough

I started out with the speeds and feeds I had used last time, derived from Ed Kramer’s posts.  Since I was using a 3mm instead of a 2mm end mill, I just upped the stepover to 0.3mm initially and left everything else the same.

This was definitely the tool path that I had the most trouble getting to work — I had a couple of different problems.

First problem – tool pullout

To start with, this tool path worked just fine, if a bit slow.  However, once the path got into more complicated geometry, I had what I eventually diagnosed as a tool pull out event that manifested as the spindle stalling out.  It looked like the tool pulled out about 0.2 – 0.4mm, and then started just hogging through uncut material.  This both caused a defect in the surface and then the spindle to stall out.

My debugging of this problem was complicated by a different issue.  I had not really done any math to select a proper stickout for the tool for this path.  Slightly past the point of pull-out, with my initial 20mm stickout, the machine faulted because on the next pass the Z axis travel limit would have been reached.  However, the fault was so far removed from the program point where the limit would have been reached, I initially assumed it had just pulled out again.  Thus, I made a lot of tweaks, none of which fixed the stickout problem, and some of which may have fixed the pullout problem.

Ultimately, I now believe that the pullout problem was likely caused by the “Tolerance” parameter of the 3D adaptive clearing path in Fusion 360.  My initial settings for this were 0.1mm or 0.15mm of tolerance and 0.3mm optimal load, which I figured would result in a usable amount of error.  However, I hadn’t expected geometries like this:

adaptive_turnaround

When the tolerance was set too large, the tool “cut off” that long piece of material, going from an optimal level of engagement to nearly 100% engagement in a heartbeat.  The v2-50’s NSK spindle doesn’t have a lot of clamping force on the tool, so that drastic change in load must have pulled it out.

Despite that as my ultimate conclusion, I still ran all the rest of my paths a bit slower at 30k rpm 600mm/min and a stepover slightly under 10%, so 0.25mm for the 3mm endmill because that was what I did my final testing for this problem with.  I wanted to get a part in this round, not necessarily optimize speeds and feeds.

Second problem – Z axis travel

As I mentioned above, the second problem I had here was that the Pocket NC Z axis travel was insufficient to reach past approximately the midpoint of my part with a 20mm stickout.  In fact, I had to increase the stickout all the way up to 28mm before I could complete this toolpath.  I didn’t experience a whole lot more chatter after that change, and my surface finish was equally mediocre before and after, so it was probably reasonable at least for cuts that were this gentle.

The rest of the backside

The remaining pieces of the backside were:

  • The central cavity
  • The planet input bearing interface
  • The back most visible surface
  • The “bearing lip” for the planet input bearing
  • The back surface that mates against the rotor

2: First, let’s tackle the central cavity.  I roughed out the cavity with a bore toolpath.  I used a relatively small initial bore diameter, then did multiple stepovers to reach the desired diameter.  I later realized this was moderately inefficient, and I should just do a bore of a single diameter and let adaptive clearing handle the rest, but I didn’t bother updating this path with that strategy.

I was pretty apprehensive running this boring operation, as clearing out a cavity is what broke my first endmill.  I ran this at a very conservative 0.2mm depth per turn, and at 30k rpm with 400mm/min cutter speed.  Also, I discovered that I needed to manually set the top height a bit above the start of the cut to get the cutter to actually start its helix before engaging.  With the default 0mm offset, it ended up plunging straight in and sounded terrible.

Even with the helix moving before engaging, it still sounded pretty bad, but did make it through.  I guess using an actual drill is probably the only way to achieve this depth of cavity on the Pocket NC without having significant chatter.  Fortunately, I didn’t really care about the surface finish, and the chatter didn’t seem bad enough to break anything so I just ran with it.

20190612_sun_gear_back_central_rough.png

3: Then I used a 2D face to finish the back most surface:

20190612_sun_gear_back_finish.png

4: Then I used a 3d adaptive to finish clearing out the bulk material from the central cavity.  This is what I should have just let remove all the material after the initial bore:

20190612_sun_gear_back_roughing_cavity.png

5: Next I used a 3D parallel to finish off the rotor mounting surface.  This was a little bit tricky, as at this point in the program I have the beginnings of a “tab” beneath the part that I don’t want to dig into.  Thus I defined a boundary as a sketch in the model for all the things that I wanted to keep away from that tab.  Here I used used it as the “Machining Boundary” with the “Tool inside boundary” option and added a random additional offset set to make the simulation not get into the tab.

20190612_sun_gear_mounting_back_finish

6/7: Finally, for the back side, I used two 2D circular paths to get the planet input bearing interface, and the “lip” behind it, to their proper diameter.  I used a 3mm stepdown for both, although for the best finish the 3mm endmill is long enough I should have just done it in a single cut.  I also used the “Wear” tool offset compensation, so that I could enter small offsets into the Pocket NC tool diameter to dial in the exact dimensions I wanted.

20190612_sun_gear_back_bearing

The front side

8: For the front side, I initially did as much as possible as I could do with the 3mm end mill.  So, that started with a roughing of the non-cavity pieces.  This used identical parameters to what I settled on for the back side roughing.

20190612_sun_gear_front_roughing.png

9: Then I used a 2D face to finish the front most surface.  This is both ways and has a 0.5mm stepover.

20190612_sun_gear_front_finish

10: I used a bore path once again to carve out an initial hole in the front cavity up until the narrower part of the hole.  For this one, I also used a few stepovers, here spaced at 0.25mm and also manually set the top height 0.5mm above the hole.

20190612_sun_gear_front_central_hole_rough.png

11: After that, I used another bore to get the narrower hole in the middle.

20190612_sun_gear_front_central_hole_inner.png

12: A 2D parallel finished up the front surface.  Nothing actually mounts to this, but I figured I might as well make it flat.  As with the facing, a 0.5mm stepover was used.  I ended up just selecting everything but the back flat face as a “Avoid/Touch Surface” set to avoid to keep the path from trying to get there.  I also didn’t do anything special to keep this away from the tab, which resulting in it digging a bit into that region.  I was mostly worried about engaging the full width of the cutter, but it didn’t cause too big of a problem, and the 2d parallel path did that a bit anyways as it worked its way around the central post.

20190612_sun_gear_mounting_front_finish.png

13/14: The last two things that I did with the 3mm flute were finishing the interface to the rotor bearing, and the bearing lip using 2D circular paths.

20190612_sun_gear_front_bearing.png

Front side – 2mm end mill

The other features I needed to do on the front side were all too small to complete with the 3mm end mill, so I switched to a 2mm single flute Datron with 5mm long flutes for the subsequent operations.

15: First, bores opened up the four bolt mounting holes that connect the part to the rotor.  For these, I used just a single boring pass, but manually set the height to be a bit above and below the part.  Above so that the helix would start before it engaged, and below so that I’d be sure to actually get all the way through the part.

20190612_sun_gear_radial_mounting_holes.png

16: A 3D adaptive removed most of the remaining material in the front central cavity:

20190612_sun_gear_front_central_hole_rough_2mm

17: And a 2D contour removed the final bit of material:

20190612_sun_gear_front_central_hole_finish.png

18: The last thing I did in this tool setup was to clear away the remaining outside material that was above the tab, as all the “heavy” cutting is done.  This was done with a single 3D adaptive clearing, with the depth of cut set to 3.5mm so it finished in a single stepdown.

20190612_sun_gear_outer_rough.png

Chamfer milling

Now that almost all the material is removed, I switched to a 90 degree chamfer mill.  This I just got from Shars, part 416-3509.  I wanted to break all the sharp edges I could and also needed to cut the countersinks for the mounting bolts.

19: First, the front chamfers.  I used a 2D contour with 0.25mm of “Chamfer Width” and 0.25mm of “Chamfer Tip Offset”:

20190612_sun_gear_front_chamfers

20: Then, while still on the front side, I did the countersinks.  For these I also used the 2D Contour toolpath.  I used as many stepovers at 0.2mm as I could fit in, which worked out to 7 in this case.  Since these chamfers were modeled, I left the “Chamfer Width” and “Chamfer Tip Offset” at 0mm.  In hindsight, I probably wanted some tip offset still, as it left a tiny flat at the start of the chamfer.

20190612_sun_gear_front_countersinks

21: The last thing I did with the chamfer mill was the back chamfers, which were done identically to the front ones, just with a different “Tool Orientation” selected to come from the back side.

20190612_sun_gear_back_chamfers.png

Finishing up and parting off

22: At this point, I switched back to the 2mm end mill from before with the same stickout to get ready for parting.  First, I used a careful selection of boundary to remove all the material laterally, except for the final parting tab with a 3D adaptive.  Because this is reaching in far, and the shank of the tool would otherwise rub, it spends some time carving away at the base of the stock to give room for the shank to reach in.

20190612_sun_gear_leave_tab.png

23: Now, as much of the outer surface is exposed as is going to be exposed, so this is where I stuck my finish pass for that surface.  I used a 3D contour, which let me restrict its operation using the same machining boundary I used before so that it didn’t run itself into the tab.

20190612_sun_gear_outer_profile_finish

24: And finally, I used a 3D adaptive to clear away all but about 0.2mm of the remaining material in the tab.  The selection of tab width was one I was concerned about, never having done this before.  Too thick, and breaking it off would be annoying.  Too thin, and the part might fall off while the mill is still engaged and spinning.  In the end, the 0.2mm was totally reasonable to bend off by hand, but still seemed relatively well fixed as the mill worked under it.

20190612_sun_gear_thin_tab.png

The final result!

Some pictures of the final part:

dsc_0335-e1560375798649.jpg

dsc_0338

Clearly, there are plenty of areas for improvement.

Surface finish: As seen in the close ups, the surface finish, is at best, “mediocre”.  I didn’t really try to optimize this, but did try to avoid obviously loud chatter.  Perhaps I can run some of the paths with the same tools but at smaller stickouts, or perhaps tweak the RPM to find areas of stability to improve things?  Also, my choice of finishing paths seems to have left a lot of circular swirls on the front side.  I should probably switch to something circular there instead of linear so that the center stud doesn’t cause so much heartache.

Back cavity finish: In this iteration, I didn’t actually do a finish pass on the interior surface of the back cavity.  This is a precision surface that the sun gear fits into, so I definitely need to do that and tune it in.

Accuracy: The bearing surfaces’ accuracy is probably best described as “meh”.  I tweaked the tool diameter offset until I could fit the bearings on, but the difference between “won’t fit on at all because it binds near the base” and “fits pretty loosely around the whole thing” was not really controllable.  There was a moderate taper between the near end of each surface and the far end, despite doing several “spring” passes.  I suspect this is just an inherent limitation of the Pocket NC.  I believe it only has steps for 0.0002″ in position and isn’t that rigid either, so the tool deflection is pretty measurable.  Probably the best I could do would be to run those paths with a smaller stickout tool in the hopes of minimizing deflection based error.

Single run: I did this first part executing each tool path singly with my hand on the estop the whole time.  After I get the back cavity bore path working, I’d like to try one with the only intervention being at tool changes.

Summary

Wow.  This was significantly more involved than I expected, although most of that was due to debugging the tool pull out and the Z axis limit problems.  Even still, I spent a good week getting the tool paths programmed and tested.  I hope that with practice, I’ll get to where I can turn these around more quickly.  Especially since this was the “easy” part I had!

 

Stripping the coaxial quadruped for parts

To switch to the full rotation gear design, I needed to get all my gearbox motors, some bearings, and a lot of other bits and pieces disassembled and ready for re-use.

dsc_0219
The remaining 3 non-broken legs from Maker Faire

Taking everything apart took a surprising amount of time, nearly a full day.  Each leg resulted in quite a collection of fasteners.  Seeing them all in one place made me realize how complex this has become!

dsc_0221
One leg’s worth of parts

I’ve also got the full set of parts printed for the full rotation legs:

dsc_0217

Now I just need to get to assembling and reworking to get them all installed!

Working around motor shroud failures

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.

dsc_0108
The two halves of the reinforcing ring

Due to the unconventional orientation, removing support was a pain, but doable.

dsc_0109
A reinforced motor

Making things walk – and failing

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.

To be continued…

 

Standing up and sitting down

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.

dsc_2362

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.

 

pre-charge circuit

Next up in Super Mega Microbot 2’s existence is being able to run untethered.  Before that can happen, I need to be able to plug in a battery, and hopefully not have everything explode.  As seen with the IMU junction board, even minor inductive links can result in chips getting toasted.  I had thought that just adding sufficient capacitance to each of the point-of-load converters would resolve the issue, but in fact that almost made it worse.

Thus, I built a simple pre-charge board that I could put in line with the main power.  It has two big FETs, one power resistor, an ATTiny44, and the random regulators and glue necessary to make it work.  The microcontroller has one job.  On power on, it waits a bit, energizes the “pre-charge” FET which has the power resistor in line.  Then, a short while later, it energizes the main FET through which all power will flow.

dsc_2319
The pre-charge board as back from MacroFab
dsc_2320
Wired up for testing

I did some minimal qualification testing first with a single motor which went fine.  Then I tested it against the whole quadruped, where I scoped the output ground line.  Here, you can see that the output ground line initially rises linearly with the ramp up rate of the lab supply I was using to test.  Then, about 80ms later after the ATTiny has powered on, it energizes the pre-charge FET and the output ground asymptotically approaches the resistance of the power resistor.  Then again, at 100ms after that, the main FET is engaged and the output ground voltage drops all the way to 0 (or close enough modulo the FET on-resistance).

precharge_whole_robot_startup

After that, all that was left was to try it with a real battery:

 

Spoiler alert: It didn’t smoke.

 

rpi3 interface board

Now that I have a chassis that can walk a little bit, I need to get the onboard computer working.  To do that, I needed to update the raspberry pi 3 daughterboard I built for the previous turret for the new bus voltage and communication format.

The rpi3’s UART is incapable of controlling the direction line on the RS485 transceiver, so I added a small STM32 micro in line to control the transmit / receive direction.  It adds a little bit of latency, but testing the firmware I was able to get it down to only a byte’s worth or so.

Here’s a quick render:

rpi3_hat_r2

And a shot of the actual board:

dsc_1703

Unfortunately, I managed to omit a necessary pullup on the enable line of the primary buck converter.  To get things moving along, I blue-wired it under the microscope:

dsc_1710dsc_1707

And here’s a shot of it installed on the rpi3 b+:

dsc_1716

Sources:

First walking with gearbox chassis

Short recap: After building the quadruped with near-direct drive motors, I discovered that the lateral servos had insufficient position control authority to keep the robot standing up.  Thus I embarked on a now month long quest to design and build an integrated planetary gearbox.  At this point, I have enough gearboxes built for all the lateral servos, so it should be able to walk, right?

And tada!  It can!  Well, at least a little bit.  I’ve only spent a short while with the gearbox based chassis, and have a lot of work left to do.  However, here’s a quick video showing it walking around, slipping on a ruler, and almost falling over a few times.

 

Wiring up the gearbox chassis

Now that I had a set of 4 at least minimally working lateral servos, I needed to wire up the chassis so that everything had power and data.  Here are some pictures of that process:

dsc_2285
Two legs installed
dsc_2287
Four legs installed
dsc_2290
Joint cable routing
dsc_2292
Times four
dsc_2293
Suspended from the test fixture
dsc_2296
Four sets of busbars, the junction board, and a shore power battery simulator

Next up is making it do something!