Micro Sawppy Beta 3 Differential Link

Several design changes in Micro Sawppy Beta 3 (MSB3) allowed me to experiment with different suspension rocker designs: the multi-piece rocker with deployment pivot and the single-piece rocker for straightforward assembly. One of those enabling changes was a rework of the link between the rocker and the differential, continuing the experiment started with MSB1 and MSB2 of using 3D printed living hinges for this critical linkage.

Enabling a single-piece rocker was not an explicitly goal of this rework, that was just a convenient side effect that I took advantage of. The real focus of this iteration was to make the living hinge itself a small disposable component that can be easily replaced. Because micro Sawppy is targeted for an audience with entry-level printers, I can’t assume rover builders can print with flexible filament like TPU. So if I want to use living hinge in my design, I have to account for the fact that beginner-friendly 3D printing materials like PLA will fatigue and break with some regularity.

If the living hinges of MSB1 and MSB2 should break, it would mean reprinting and replacing some very large parts. In contrast, MSB3 hinge is a tiny little part that clips into larger surrounding rigid parts. Furthermore, it is the same part at all four joints. We would only need to keep one style on hand in replacement inventory, which can be used to fix any of the four joints that might break.

An associated benefit is that we can print the hinge with different settings to find the best tradeoff between flexibility and durability. Looking at the hinge in the orientation on the 3D printer bed, it is easy to scale the design’s print height and test how a particular batch of filament behaves. I printed these at heights varying from 2mm to 6mm and I tried the 2mm first. It would be the most flexible, and I wanted to see how long it would last.

The answer: less than 30 seconds! Oh well, at least now I know. For this particular type of material (MatterHackers Build Series PLA) 2mm was too fragile. 6mm was overly rigid and interfered with proper rocker-bogie operation. 4mm seems to be sufficiently durable but it was still too stiff to let the rocker-bogie operate as smoothly as I like. Even though these data points weren’t terribly encouraging, I’m glad MSB3 made it really easy to adjust this particular parameter for experimentation.

But at this point I’m suffering from rover fatigue and need a break. I’ll return to micro Sawppy later (UPDATE: it is later) but right now I’m going to go play with Unity 3D for about a week.

Micro Sawppy Beta 3 Suspension Rocker With Deploy Pivot

One of the main project goals of Micro Sawppy Beta 3 (MSB3) is making a 3D-printed rover design that is easier to build than Sawppy V1. Reducing the number of parts is one way to support that goal, and that’s why making the suspension rocker as a single 3D printed piece was a good thing to try and something to keep as a strong candidate for the final design.

But I’m a tinkerer, and it’s hard to resist the temptation of doing more. Especially for features that are tempting and have a good chance of being actually useful. The Rocker Deploy Pivot (RDP) is one such feature, a hinge on the suspension rocker that lets Curiosity and Perseverance fold up for their trip to Mars. I thought replicating the RDP on my own rover would help make it more portable in addition to the nerd cred factor. If so, that might be a worthwhile gain in exchange for increased parts count and assembly complexity.

Since MSB1 and MSB2 suspension rocker had to be a multi-piece design anyway, I started exploring the idea of building a RDP but it was never functional for those rovers. MSB3 is the first iteration that can practically fold up for transport. Collapsing the suspension like this does not change the length or width by much, but it cuts height by almost half. In this form, MSB3 can conceivably be small enough to be carried in a backpack.

Like many of the mechanisms that are newly designed for MSB3, it is probably bulkier than it needs to be. It added two more M3 screws In addition to the screw holding the rocker bearing. This is plenty strong so I have margin to cut back on the structure, maybe eliminating one of those extra screws and move the remaining screw closer to the pivot point. Both will help reduce bulk and reduce load on its link to the differential.

Micro Sawppy Beta 3 Suspension Rocker (Single Piece)

My rover Micro Sawppy Beta 3 (MSB3)’s suspension bogie attaches to its rocker assembly. Just for the sake of experiment, I designed and printed a single-piece rover suspension rocker. Rovers MSB1 and MSB2 had a complex multi-piece rocker design because its many mounting points were not coplanar and I couldn’t figure out how to align everything along 3D printing layers for maximum strength.

I redesigned the steering servo and rotational bearing mounting mechanisms for MSB3. As a result, it was almost possible to get everything lined up. The lone exception was that the front corner was still not easily aligned with the rest, but it could be a long sloping shape that spreads its load across a large surface area of print layers. It still won’t be as strong as if everything were lined up on the same layer, but it should not be an immediate structural disaster. It will, however, require printing with supports and accepting the rough surface that results.

I could help hide this poor surface finish, by aligning the print so it is on the inner surface of the suspension member. It’s not out of sight, however, since the front corner wheel stick out the front and thus this surface is always visible.

Every 3D printing slicer handles supports slightly differently. This particular test piece was sliced with MatterControl on default PLA settings and auto-generated supports. The flat portions (near steering servo and joint) had a rough surface but at least that section separated cleanly. The angled section (between steering joint and rocker pivot bearing) was a mess. That section of support did not separate at all, the surface visible here is a combination of forcibly tearing plastic apart and cutting the remainder free with a blade. I would not call this a complete success. Nevertheless the result does appear structurally sound. I would be confident using it in a rover design as there’s enough surface area across the diagonal section to hold together well, except under gross abuse.

This experiment proved that a single-piece suspension rocker is feasible. Practical, even. But I was not content to leave it at that and built a multi-piece suspension rocker in an effort to improve rover portability.

Micro Sawppy Beta 3 Suspension Bogie

A quick strength test of SG90 micro servo found that it was pretty fragile, but before I worry too much about mitigating that problem I wanted to get more real world runtime on Micro Sawppy Beta 3 (MSB3) to see if such work is even necessary. In order to get that real world runtime, I should focus on continuing design work on the rest of the rover. Next stop: the suspension bogie.

Most of changes to MSB3 bogie reflects the switch to using TT gearmotors to drive the middle wheel. Compared to those changes, work to accommodate new steering joint and servo mount were relatively minor. The final change was mechanically simple but has a big impact: following the precedent set by steering bearings of MSB3, the bogie bearings mount were also changed around. Now, instead of a M3 fastener running through the center of bearings as a rotational axle, the M3 fastener now securely bolts down the center to be static relative to the bogie and the motion is around the outside.

Again the major advantage is making this rover much easier to build and maintain. We no longer have to worry about the amount of torque used, as it no longer affects smoothness of bearing motion. A rover builder can torqued down these M3 fasteners to their heart’s content and it wouldn’t affect rover behavior.

As part of this change, the C-shaped bracket to prevent bogie over-rotation is no longer a simple clip-on piece of plastic as it was on MSB1 and MSB2. It is now a structurally important part of the rocker-bogie joint, supporting the weight of outer bogie bearing. There’s a good chance this bracket on MSB3 is bulkier than necessary, but I wanted to verify the idea works before slimming it down. It’s already taken way more effort than I thought it would take to get this point.

I need to sit down and simplify the bracket’s geometry. Its shape is dictated by the bogie’s allowable rotational range of motion, and I think that math got away from me. There are far too many numbers and guide lines in the CAD sketch. It took several small test samples to work through this geometry and my mechanical intuition says there should be an easier way. Fortunately the bracket is small and quick to print making iterations fast. Hopefully that mythical “easier way” will come to reality once I dedicate some time to stew on the problem for a bit. For right now, I’m content to use this design for attachment to MSB3’s suspension rocker, starting with the single-piece version.

SG90 Micro Servo Strength Test

The weakest point in my Sawppy V1 rover were its shaft couplers, but that bug also became an accidental feature: when the system is abused, being the weakest link meant it is a sacrificial element to break before anything more expensive would. I am now designing the servo steering mechanism for Micro Sawppy Beta 3 (MSB3) and wanted to know: do I also have an (accidental) abuse-absorbing feature on the little rover?

This was something fairly easy to test and, thanks to the low cost of SG90 plastic gear micro servos, I was willing to sacrifice one for this knowledge. I put together a MSB3 prototype steering assembly and wired the servo to power and control signal, telling to hold straight center. If I wanted to be scientific I would use a torque wrench or something to quantify the forces as I test, but I didn’t have the proper equipment so I just used my hand.

The answer is no, nothing else in this steering assembly for MSB3 will step up and absorb abuse on behalf of the steering servos. It took surprisingly little force from my wrist before I heard something snap. I disassembled the gearbox to see not one but two failures: A tooth is bent (but still attached) on the final output gear, and another tooth has broken off from the adjacent meshing gear.

Since I didn’t use an instrument to quantify the breaking force, I don’t have objective numbers to post here. Subjectively I felt the breaking point was beyond what I would reasonably expect from a little rover in normal roaming, which is good for rovers rolling along minding their own business. But I want micro Sawppy to be something a teacher can introduce to their class, and I didn’t think the breaking point was beyond the capabilities of curious/destructive children, and so the fragility worries me.

I’m sure MG90 metal gear servos would fare better, but would they be strong enough? I’ve already sacrificed a few MG90s to experimentation and I’ll want to set up proper instrumentation before I sacrifice another. And obviously a MG90 is more expensive than a SG90. Is it better to use affordable SG90 servos and replace them as needed? Or is it better to go straight to MG90 for higher durability? Answering this question definitively would require real world usage data. See how often SG90s require replacement, and whether the replacement rate is greater or less than the up front-cost increase of using MG90 servos. In order to obtain this real world usage data, I’ll have to keep working on the rest of the rover.

Micro Sawppy Beta 3 Steering Trim

Getting a pair of bearings aligned with the wheel contact patch is a feature on all Sawppy rovers, so that in itself wasn’t new. But Micro Sawppy Beta 3 (MSB3) did try a new way to mount bearings, and I’m optimistic it’ll make future Sawppy designs easier to build. On top of that steering joint, I’ve also modified the servo attachment for another feature I wanted to put on my rover designs: mechanical steering trim adjustment.

Sawppy V1 had a software-based trim adjustment system, where the center point of each steering servo could be adjusted by modifying a value in a text file. I though it was something that I could set once and forget but I was wrong. The potentiometers used to sense position inside a servo motor drifts over time (and temperature, and humidity, and phase of the moon…) so in reality steering trim had to be adjusted fairly frequently.

For MSB3 the servo horn bundled with a micro servo is mounted on a 3D-printed piece with an arched hook in the front. I could then fasten it to my steering assembly with a single screw. Steering trim adjustment becomes a matter of loosening that screw, sliding to a different point within that arc, and tightening the screw back down.

Another advantage of this design is that, unlike MSB1 and MSB2, the servo is freed from handling any structural loads. It is now responsible solely for steering just as servos were for Sawppy V1. It is a feature I’m glad I could bring to a smaller scale. I thought about going one step further on ease of assembly, and tried a few clip-on servo mounting brackets for tool-less assembly and replacement. (Pictured.) But even though these little servos assert little torque, there is enough to distort 3D-printed plastic and affect steering accuracy so I returned to the concept of a screw-down servo bracket.

But the experience did remind me of one thing about Sawppy V1: I didn’t like using heat-set inserts on shaft couplings because they would slip and break. However, that slippage and breakage did have an advantage when Sawppy is stressed beyond design limits. When a child decided to break my rover, the coupler broke before that abuse was transmitted into the servo. What would happen to this little rover servo?

Micro Sawppy Beta 3 Steering Bearings

The third revision of my little rover prototypes, Micro Sawppy Beta 3 (MSB3), uses TT gear motors and matching wheels for the six-wheel-drive aspect of its rover suspension. Using commodity components solves a lot of problems, but now I have to integrate them. The starting point is a rectangular bracket that bolts onto two top mounting points of a TT gearbox, and angles over the wheel to a hole for a bearing that is aligned with where the wheel touches the ground. (“Contact patch”) This alignment is necessary in order for the wheel to pivot in place. If the rotational axis of the bearing is not aligned, then any rotation would drag the wheel across an arc instead of pivoting on the axis of rotation.

Sawppy V1 had the same steering axis alignment requirement, and I used 8mm shafts running through the center of 608 bearings. For MSB3 I’ve turned that design around: instead of transmitting the rotational force through the center of the bearing, now the bearing center remains static while steering forces are transmitted around it. M3 fasteners bolt a pair of bearings to the front end of the suspension rocker, one top and one bottom. The steering mechanism takes the general shape of a C holding above and below this pair of bearings.

MSB1 and MSB2 ran M3 screw through the center of bearings in their suspension members, but that used the M3 fastener as a rotational axle much like how Sawppy V1 used 8mm shafts. This meant the smoothness of the rotation is sensitive to how tightly the fastener was torqued down. Too loosely, and it rattles. Too tightly, and the fastener would cause the bearings to bind up. Which defeats the purpose of using ball bearings to begin with! I had a few other ideas on how to address these problems, but I decided to try this one first. Inverting the roles was less dependent on 3D printer precision and hence easier to build.

Part of making micro Sawppy easier to build is to avoid similar looking parts that are not interchangeable. For MSB3 I designed the two parts of this steering C-shaped assembly so it can be used on all four corners. That is to say, a builder will print four copies of the same design. Rather than Sawppy V1 which had distinct front-left, front-right, rear-left, and rear-right corner steering components people might (and did) inadvertently swap causing confusion. This is something I wanted to mitigate by stamping reference numbers on parts, but it’s better to design so the user doesn’t have to squint to make out part numbers at all.

In order to make a part usable in multiple directions, it is symmetric front-back as well as side-to-side. Adding provisions to allow the parts to be attached in multiple directions also added unnecessary bulk, and I haven’t made up my mind whether the tradeoff is worthwhile. Clever designers know how to design parts so they are clearly unambiguous, I might want to tackle that as a challenge instead. In the meantime I’ll leave this as-is and proceed to steering servo installation and associated adjustment.

Micro Sawppy Beta 3 Wheel

The major motivation to build Micro Sawppy Beta 3 (MSB3), leaving MSB2 behind, was the increasing complexity of MSB2 wheels and I wanted a rover that is simple to build. Switching to using commodity TT gearmotor plus its associated wheels for the rover’s six wheels goes a long way. By using a gearbox that is already designed to support and drive a matching wheel, we eliminate custom modification and any worries about robustness of said modifications.

When I looked inside a TT gearbox I didn’t see any ball bearings, but I did see support structure that should suffice for a rover at this scale. At a very minimum, the rover would be as robust as every other robot design that use these wheels.

But like everything in design and engineering, there are tradeoffs. The biggest disappointment (and why I was reluctant to use these things to begin with) is that poor ground clearance. Comparing MSB3 against MSB2 and MSB1, we see ground clearance has degraded with iteration. There were good reasons to take each of these steps but it’s not the direction I wanted to go. Even with feedback that this feature isn’t ranked highly on many other people’s rover builds. Fortunately(?) I think this is as far as I have to compromise on this topic, at the moment I don’t know of anything that might further degrade clearance for future rovers.

Another problem is the fact these wheels don’t much resemble real Mars rover wheels. I was really proud of Sawppy’s wheel design and how I was able to scaled down for MSB1 and MSB2, but now I’m leaving them behind. While there’s the possibility to replace these generic wheels with 3D printed rover wheels, it would only be cosmetic. Given the geometry here, I don’t see a good way to restore functional ground clearance. But at least these wheels come with rubber tires, which was one of the biggest non-Mars-authentic feature requests for Sawppy.

A TT gearbox offers three attachment points. Two near the motor and one at the opposite end. While it would be most robust to use all three points, for MSB3 I decided on simplicity and used only the two close to its motor. The mounting bracket is angled to meet up with the steering axis, which is aligned with the middle of the wheel so the wheel could pivot in place.

Micro Sawppy Beta 3

Gaining a basic understanding of how to use the L298N module to control DC motors was an important confidence booster for modifying my little rover plans: Switch the rover’s six-wheel drive from micro servos modified for continuous rotation to a different approach: TT gearmotors that are designed from the start to drive wheels. They even come with one of the most frequent Sawppy requests: soft rubber wheels that are expected to have better traction on earthly surfaces. Steering the little rover’s four corner wheels remain the duty of micro servos, which would be doing their designed job of rotational position actuators.

The first rover chassis to emerge from this new plan is Micro Sawppy Beta 3 (MSB3) shown here next to its predecessors MSB1 and MSB2. Changing the wheel drive mechanism has a huge impact on the overall design, as this family portrait shows. A new rocker-bogie suspension implementation is the focus here, relegating the body back to a simple box as it was on MSB1.

The next few posts will cover some of the highlights of mechanical design changes for MSB3. Changing the wheel drive motor required a completely new steering knuckle design for the corner wheels. Which became an opportunity to design a multi-piece mechanism that would allow me to quickly adjust steering trim at mechanical level. Increasing the number of parts does make the mechanism more complex, but I am optimistic it would actually prove to be easier to build. MSB3 also represented a new way to use 623 bearings that hopefully eliminates the sensitivity to tightening torque. And the revamped rocker features an improved adaptation of the real rover’s rocker deploy pivot allowing the rover to fold up for transport. And finally, the differential linkage is a further evolution of using 3D printing to avoid having to scour remote control hobby catalogues for an adjustable suspension turnbuckle.

This tour of MSB3 starts at the same place as its predecessors, from the wheels. Then we’ll work our way up.

Circuit Schematic of Generic L298N Driver Board

As a learning exercise, I decided to generate my own documentation for commodity L298N motor driver modules available wherever hobbyist electronics are sold. The first step was to catalogue all the components mounted on board, and now I analyze the circuit board layout to see how they are connected together. And as much as I like to do things digitally, for projects like this I really appreciate the flexibility and immediacy of a sheet of paper to scribble on.

I could probably do it with the actual device in hand and a blank sheet of paper, but this time around I decided to create my own visual guide. I took photos that are as directly square-on as I could front and back. I scaled them to the same size, and printed them side by side on a sheet of paper leaving room for me to write notes. Once printed, I folded the paper in half while holding it up to a light source so I could line up the front and the back. Then I started following copper traces and scribbling my notes.

Fortunately this was a relatively simple circuit that mostly followed data sheet recommendations. I quickly confirmed the eight diodes were present to dump excess power into the +12V and GND planes. The two electrolytic capacitors are there for the +12V and +5V power planes respectively. IN1 through IN4 and OUT1 through OUT4 are straightforward direct routes. I also confirmed the optional current sensing resistors were absent, those pins were tied directly to ground. Furthermore, there was no provision to make adding current sensing resistors easy. People who want to perform current sensing are probably better off using another module.

A few traces were buried under components so their paths had to be teased out via probing with a continuity meter. The jumpers on ENA and ENB do indeed tie them high to the +5V power plane. The third jumper enable/disable the onboard 78M05 regulator. When the jumper is in place, it connects the +12V power plane to the input pin of 78M05. Which can then supply 500mA of current to +5V plane. Since the L298 itself draws less than 100mA, the remainder capacity can be tapped via the +5V screw terminal to perhaps drive a microcontroller. When the jumper is removed, regulator input is disconnected from the +12V plane and the +5V screw terminal becomes an input port to accept external power. The LED and current-limiting resistor is connected to the +5V plane and will illuminate when +5V power is present.

Aside from the silkscreened text proclaiming +12V, I found nothing to limit motor power supply to +12V. As far as I can tell it can be anywhere from 7 to 35V when using the onboard 78M05 regulator. If the regulator jumper is removed and L298N is running on external logic power, the lower limit is dictated by the L298N which can function with as low as 4V. The upper limit of a L298N is 45V with peaks of 50V, but the capacitors and 78M05 used on this module are listed with 35V maximums. Personally I’m unlikely to use anything higher than two 12V lead-acid batteries in series, which would be 28.8V fully charged and comfortably under that limit.

As a part of this self-assigned exercise, I also practiced drawing a schematic using the electronics design component of Autodesk Fusion 360. I think I’ve captured all of the information above, though I’m sure this schematic violates a bunch of conventions and make electronic engineer eyes twitch. (I’ve had to read software code written by electrical engineers so I have some idea what the mirror image is like.) And while I try to put lots of comments into my software source code, I haven’t learned how to best document a schematic. Until I learn more about that world, this blog post represents my best effort for this round.

Armed with this knowledge, I felt confident enough to embark on designing a micro rover to use TT gearbox with its DC motor, leading to Micro Sawppy Beta 3.

Components of Generic L298N Motor Driver Module

The internet is a great resource, but sometimes I want the experience of doing something on my own. This is why after buying a batch of generic L298N motor driver modules, I decided to sit down and understand what I have on hand instead of just downloading someone else’s documentation.

The main attraction with the big heat sink is the L298 itself, specifically the L298N variant. Flanking it, four on each side, are small modules labelled “M7”. Since the datasheet said an array of four diodes each are required for A and B sides, seeing eight of something on the board makes them candidates for those diodes. A search for “M7 Diode” indicates they are 1N4007 diodes.

A single rectangular package is etched with ST logo and designation 78M05. Its datasheet describes it as a voltage regulator delivering 5V at nominal 500mA. Input voltage can be up to 35V, but must be at least 7V. Two cylindrical assemblies are likely electrolytic capacitors. The numbers indicate 220uF at up to 35V, matching the maximum limit of 78M05. L298 datasheet required a capacitor between motor voltage supply and ground, and another capacitor between logic voltage supply and ground, so that fits.

Two blue screw terminal blocks on either side are motor output connections. They are labeled OUT1 and OUT2 on one side and OUT3 and OUT4 on the other, designations straight from the L298N data sheet. Also straight from the data sheet are control signals IN1, IN2, IN3, and IN4. There are jumpers on ENA and ENB. My hypothesis is that they are tied to +5V to stay in the enabled state by default, allowing motor direction control going full speed forward, full speed reverse, and brake stop. If an application wants control over enabled state, we can remove jumpers and connect the enable lines for PWM speed control.

The third screw terminal block has three posts labeled +5V, GND, and +12V. GND is obvious enough, and given the presence of 78M05, my first guess is that the +5V terminal gives the option of tapping its output to drive our microcontroller. But it is also possible it is a +5V input to bypass the 78M05. There is a jumper nearby to disconnect something, possibly the 78M05? A small surface mount LED and accompanying current limiting resistor probably indicate power on one of the power rails. Finally the +12V label is mysterious, since everything I see with a voltage limit can go up to +35V and I see no reason to constrain it to +12V.

Looking over the list of expected components, I am left with two missing: there are no candidates for current sense resistors. Time to trace through this circuit and see if I can find them.

Trying Generic L298N Driver Board

I started researching using a L298 as motor driver because it is an established known quantity. After looking over its specifications, I realized it is not the best match for the TT gearbox DC motors I plan to use: the L298 is specified to work anywhere from 4 to 45 volts, but the little 130 DC motors used in a TT gearbox are usually listed with a nominal operating voltage of three to six volts. I should be able to avoid damaging the little motors as long as I keep the PWM duty cycle low. So I’ll continue investigation. Even if these aren’t the best drivers to use for my micro Sawppy, they might be useful for larger motors in larger Sawppy rovers.

During my research of L298 I came across reference to an Arduino motor control shield built around one of those drivers. It looks great, but a single shield with a single L298 can only drive two motors at different speeds. A six-wheel drive rover will have six motors. I could pair up front and back wheel motors if my rover chassis is front-back symmetric, but that still requires four different speed controls. I looked to see if the Arduino shield is stackable, but unfortunately the motor control pins are fixed so stacking them would only result in more motors running at the same two speeds.

Both Adafruit and Sparkfun appears to have moved beyond the classic L298 for their motor driver boards. I’ll look at those drivers modules later, for now I’m focusing on L298 so I headed to the cutthroat market of lowest-bidder generics, just as I looked there for my micro-servos and TT gear motors. A query for L298 on Amazon (*) returned many vendors all selling what looks like clones of the same product. A pattern repeated on AliExpress as well. I purchased from the Amazon lowest bidder du jour (*) for a closer look.

And just like with micro servos and TT gear motors, I couldn’t find much on the history of this particular driver module design. Somebody must have built and sold the first one, but now that it has since been copied infinitely I had no luck finding the source. Since this has become a generic fungible item, none of the vendors I checked bothered to supply documentation. They probably assumed a people can find it online somewhere and I’m sure I could. However, I’ve made a conscious decision not to. As an educational exercise I’ll try to decipher this module on my own.

Alrighty, what’s on this thing?


(*) Disclosure: As an Amazon Associate I earn from qualifying purchases.

Notes on L298 Dual Full-Bridge Driver

My little rover project switched away from modified servos with unpredictable motor drivers to pure DC gear motors. The good news is that this switch allows me to take control of the motor driver. The bad news is that… well, now I have to control motor drivers myself.

For this exploration, I’ll start with a classic the L298. These are featured in countless tutorials for turning digital logic into physical motion with motors and solenoids. It is not the latest technology, it is not compact, it is not efficient, but I expect L298 (or clones) to be available anywhere maker electronics are available. It’s such a classic that in the official ST Electronics datasheet PDF, diagrams are blurry as if scanned from paper instead of generated directly. At least the text is clear, but it is also amusingly dated “Jenuary 2000” so maybe we’re looking at a document with OCR-enhanced text (with OCR errors) and old scanned diagrams.

When used to control DC motors like my current project, a L298 is usually put to work running two motors. There are two sides “A” and “B” each with its own control signals and output pins, though both share common power supply and ground pins. Motor can be driven at up to 45V with occasional spikes are allowed up to 50V. Electrical current is up to 2A with occasional peaks of 3A. Steady state, that multiplies out to 45V * 2A * 2 motors = 180 Watts, a respectable chunk of power which explains why there is a big metal tab for heat dissipation and datasheet says operating temperature may rise to as high as 130°C.

The chip itself requires 5V input for internal logic, separate from the motor power supply. For digital logic purposes, anything under 1.5V is treated as logic low. This is relatively high threshold and is intentionally done to to mitigate electrical noise coming from motors next door. Fortunately that should not present problems for newer 3.3V microcontrollers like ESP32, Teensy and newer Arduinos. Data pins draw up to 100uA which shouldn’t be a problem to pair it with modern chips with far less amperage capacity than old school 8-bit chips.

Figure 6 explains how our microcontroller controls motor behavior. Direction is commanded by raising one input high and pulling other low. If they are equal, we get motor brake which we are warned must still not exceed 2A. If enable is low, the motor coasts independent of input values. Reading this chart, I understand that proportional motor speed control is accomplished by putting a PWM signal into the enable pin, alternating between applying power and coasting. However, I don’t see a recommendation on what my PWM frequency should be.

A web search found this electronics StackExchange answer that claims single-digit kilohertz would be sufficient. However, there’s also a contradiction in an answer that first claims PWM is done on the control input lines and enable is simply tied to high (always enable), but then links to the Arduino motor shield with L298N where the schematic clearly has PWM input lines going to the enable pins. Strange! I’ll follow Arduino precedent and send PWM control to the enable pin.

Another use for the enable pin is in the power up/down sequence. Enable pin should be pulled low before motor supply is turned on, and should be low before motor supply is turned off. Speaking of power, when driving inductive loads (and motors certainly are) a 4-diode network is required to dissipate power that might feed back to the circuit from these coils.

I saw several mentions of a current sensing resistor, and I see a “Rs” in all the schematics, but there’s no specification for resistance value or any other information beyond that they should be grounded as close to L298’s GND pin as possible. No reference for how L298 interprets current as a function of ohms resistance. Eventually I figured it out: the current sensing pin is only a provision for those that want to add a current sensing circuit to their design elsewhere. The L298 itself doesn’t care, and that’s why ohms are not specified in this datasheet. It’s going to be implementation-dependent so time for me to get my hands on an implementation.

TT Gear Motor Teardown

Commodity TT gearmotors became the center of my attention once I decided to switch to using DC motors for driving wheels on my little Sawppy rover project. Where did this form factor come from? Why do people call them TT? Why are most of them yellow? I don’t have answers to those historical questions, but I will see if I can build a little rover with them.

The adventure starts with buying a batch and taking one apart to see what’s inside. I’m not sure if the commodity TT gear motor market has diversified implementation like the micro servo market. If this experiment with TT motors go well, I expect I’ll buy more batches in the future for more little rovers and I’ll open those up to look for differences. Right now I could only speak to this one.

Externally, we see three mounting points. Two mounting holes go through the entire gearbox, next to the two screws holding the gearbox together. A third mounting hole is on a thin tab at the end opposite from the motor. There are two attachment points to the output shaft, which appears to be symmetric and have identical detent patterns. Turning the output shaft by hand, I can see the other output shaft moves in sync, but that doesn’t necessarily mean it is a single piece.

While the output shafts appear symmetric, the rest of the gearbox almost but not quite symmetric. The motor is offset by a little over a millimeter away from the camera in these pictures. On the side facing the camera, we see a little nub above the axle, whereas its opposite side is smooth.

The motor is held in place by a band of clear elastic plastic held by hooks molded into the gearbox exterior. In this particular unit, the clear plastic has partially melted into the yellow plastic and had to be peeled off with pliers before I could stretch them for removal. Once the clear plastic is removed, the motor can slide out. (To release just the motor, it is not necessary to remove the two screws seen in this picture.)

The motor looks very much like a commodity form factor used in many battery-powered toys. In disassembly and hacking circles I frequently see it referred to as “Mabuchi motor”. But just like “JST connector” this is not precise enough. Mabuchi Motor Company has a large product line, most of which aren’t this thing. I found references to this sized motor as FA-130, but with such commoditization I’m certain the majority aren’t genuine Mabuchi products. There’s certainly no Mabuchi logo on this particular motor.

What’s important for the purposes of project creation is that this is a common form factor. And thanks to its use in products like the Tamiya Mini 4WD product line, we can get motors with a wide range of performance characteristics. Same external motor dimensions, but different tradeoffs for torque vs. max speed, etc. At least that’s the theory, I won’t know for sure until I try buying one of those Mini 4WD Hop-Up motors and try installing it in one of these gearboxes.

With the two screws removed, I could open up the gear box and see the gears inside. Pulling the gear train apart, I find four separate components.

My first observation is that all the gears appear to have different diameters. I’ve seen a few TT gearbox modding guides that claim I could select different gear ratios by flipping some gears around, but I don’t see how that is possible when the gears are all different diameters. I’m either overlooking something, or this unit is the wrong variant for that mod to work.

My second observation is that the output shafts poking out on both sides of the gearbox are indeed part of a single piece shaft. There are no ball bearings here but at least they are supported on both sides of the shaft. However, since the output shaft is very clearly asymmetric, I should pay attention to which side is used as the main weight bearing member. Looking at this teardown, I have a clear preference for the side further from the camera in these pictures. That side of the shaft has far more support, in the form of a plastic tube approximately 8mm long. The side closer to the camera (and laid flat against the surface in these pictures) has only a thin wall of plastic for support.

I wonder if there’s a situation where the opposite is true? Perhaps when torque is a concern and we want to be closer to the final output gear, in order to minimize torque imposed on the shaft? I don’t think that’s likely at this power level, but I’ll keep an eye open for the possibility.

I didn’t need to take apart this DC gearmotor to use it, but having seen its insides I feel more confident approaching the task of mechanically adapting it to rover duty. In the meantime, I have a parallel adventure of learning how to drive these motors electrically.

Notes on TT Gear Motor

I’m now looking at DC motor with gearbox for rover locomotion. I started my little rover project with the intention of using micro servos all around. For six wheel drive, they would be modified for continuous rotation. This is a tradeoff: we gain a servo’s existing H-bridge circuit with proportional control, but we take the risk of putting a physical load it is not designed for. Unfortunately I found a problem with my Beta 2 chassis: some of these inexpensive micro servos lack useful proportional control. If I can’t depend on a servo’s existing circuitry, I might as well switch to a different gear motor: the TT gear motor.

Similar to micro servos, the TT gear motor has become a commodity item. Made by lots of manufacturers and sold by lots of vendors. (*) Where did this design start, why is it called “TT”, and why are they all yellow? Sadly I found no satisfying answers to these historical questions. Searching on the internet was made difficult by their name, which tends to return results relating to a real car, the Audi TT. Did this gearmotor start life in a toy car modeled after the Audi TT? So many questions, so few answers.

The only bit of information I found hinting at a source was a mention on the product page for Solarbotics Gear Motor 3 which superficially resembles the TT gearbox. However, it is not called TT there, and it is not yellow, so clearly this is not the entire history.

Based on the original design by Mark Tilden for use in the B.I.O.Bugs & RoboSapien, these motors are the next generation with a variety of improvements such as dual output shafts and a lower current motor.

Product Description for Solarbotics Gear Motor 3

I found no corroborating information beyond that snippet of text.

Anyway, back to the device itself: we can see it uses a much larger motor than the one inside a micro-servo, which may be (but not necessarily) more powerful. A larger gearbox also implies larger and more durable gears. But the most important part is that these are used to drive the wheels in a robot kit. For example, Servo City’s Runt Rover series use this type of motor for their wheels, albeit in black instead of yellow. The fact they are designed for wheels makes me more comfortable I’m using mechanical parts for their designed task. Which was a worry for (mis)using continuous rotation micro servos for micro Sawppy beta 1 and 2 rover wheels.

And thanks to the popularity of this form factor, we have an ecosystem of variants in the same size and fit the same axle. The standard gear ratio is 1:48, but other gear ratios are offered for those who want to make different tradeoffs between speed and torque. High torque gearboxes need to more durable, but not to worry, this form factor with higher gear ratios are also available with all metal gears in products like Adafruit #3802.

A particular wheel design is most commonly associated with this gearbox, but there are alternate wheel choices to fit onto that axle. The axle is large and simple enough that we can probably FDM 3D print our own wheels as well. That output shaft is symmetric so some robot kits put two wheels, one on either side. But I usually see the other end either left unused or used for an encoder wheel for low resolution wheel odometry. (*) If we want higher resolution encoders, we can buy variants with an encoder on the motor.

This all looks very promising so I bought some TT gearmotors for experimentation. First order of business: take one apart to see what I’m working with.


(*) Disclosure: As an Amazon Associate I earn from qualifying purchases.

DC Gearmotors For Little Sawppy Rover

Based on my experience modifying wheel drive motors on my little rover Micro Sawppy Beta 2 (MSB2), I decided it was trending towards a rover design that would be too difficult to work on. If I, as the designer of MSB2, am tearing my hair out struggling with wire routing, how can I realistically expect beginners to work with this thing? I think MSB2 succeeded at being really cute, unfortunately the beauty was only skin deep and its core difficulties are not what I want.

But while I stopped further work on MSB2, I wanted to continue the task I was in the middle of: trying out the idea of using DC gearmotors. The micro-servos I used in MSB2 taught me that my original idea for driving little rover wheels were unreliable. While we could modify micro servos for continuous rotation, there’s no guarantee their control circuits would give us usable speed control. Sometimes they don’t! In order to guarantee a little Sawppy rover could be reliably built, I must take motor speed control into my own hands.

This decision started when I removed all electronics from MSB2 wheel servos, using them as just a motor with a gearbox inside a micro-servo sized enclosure. (FYI Adafruit product #2941 is exactly like this, no modification required.) Even though I’m throwing out half the device, it’s still a very inexpensive way to obtain a small DC gearmotor thanks to the large volume market of generic commodity micro servos. But if we are going to use a small high volume commodity DC gearmotor to drive little rover wheels, there’s actually a better option: TT gear motors.

These DC motor + gearbox units are ubiquitous like generic micro servos, mass produced by many manufacturers at high volume and low cost. It is available as Adafruit #3777 but they are definitely not the only retailers. (*) I first learned they existed when I saw them pop up in multiple projects submitted to a Hackaday contest, and a little background research unveiled how widespread they were.

Since I’ve decided to add the complexity of DC motor driver modules, these TT motors immediately jump to the top of the list. Unlike micro servos, TT gear motors were designed for driving wheels.


(*) Disclosure: As an Amazon Associate I earn from qualifying purchases.

Micro Sawppy Beta 2 Wire Channels Are Too Hard To Work With

My little rover project Micro Sawppy Beta 2 (MSB2) turned out to have (effectively) three speeds: stopped, full speed forward, and full speed reverse. MSB2 originally intended to get its six-wheel drive from inexpensive micro servos modified for continuous rotation. This approached worked for its predecessor MSB1, but MSB2 used servos from a different manufacturer and their feedback control circuit had very poor (or poorly tuned, or nonexistent) proportional control. As a result it was nearly impossible to drive MSB2 at partial throttle.

Given this setback opportunity to try other ideas, I started modifying all six wheel drive servos. I unsoldered the flawed control circuit board and soldered wires directly to the motor input terminals, intending to route those wires to a motor control H-bridge circuit of my own choosing. This would mean I’m only using the mechanical portions of the micro servos, effectively turning it into a DC gearmotor.

But I only got halfway. Unsoldering the board and soldering motor wires is well within my comfort zone, but wrangling with wires got very tedious and frustrating. In order to replace the three-wire continuous rotation servo wires with two-wire motor control, I have to struggle with the intricate wiring channels I’ve designed into suspension components. In fact I have to struggle with it twice: once to remove the wire, and once to add the replacement.

That’s when I realized MSB2 has failed some very important project objectives: making the rover easy to build, easy to diagnose, and easy to repair. For the three wheels I managed to convert, it took far more time to wrestle with the wires than it did to perform soldering, and that’s just wrong. I want a design where, if a servo dies, it can be quickly replaced to get the rover back up and running. The wiring channels may give us a tidy looking rover, but not one easy to work with. As a result I’ve decided MSB2 is going down the wrong path and stopped work on this iteration. But I am thankful for the cute little rover, it taught me the tradeoff for tidy wiring and gave me motivation to examine using DC gear motors to drive a little rover’s wheels.

Micro Sawppy Beta 2: The Runaway Rover

Once I built up my little rover Micro Sawppy Beta 2 (MSB2) I observed that its steering servos were acting differently from the batch I used for MSB1. Beyond the clearly visible physical differences, these servos also had different control logic that can get into a never-ending oscillation.

A contributing factor here (if not the main factor) is that this micro servo’s motor control logic is far too eager in its corrections. It applies too much power and, if that power is not absorbed by damping, we have over-correction which repeats the cycle. In theory the motor controller uses power in proportion to the error in position. If the target position is close, it should use less power than if the target was far away. This particular servo control board has poor (or at least poorly tuned) proportion control. It seems to use the same amount of power whether the target position is close or far away.

The occasional oscillation is moderately annoying for rover steering, but at least it is usually damped out when the rover is sitting on its wheels. I didn’t experience the full impact of control algorithm used in these micro servos until I converted them to continuous rotation for rover’s six wheel drive. Now the poor proportional response manifests in a rover that I can’t run at partial power. I could make MSB1 crawl slowly up obstacles, but MSB2 didn’t want to crawl slowly like a real Mars rover would. It is either stopped or booking across the landscape at full speed.

In this scenario I suppose I could also apply damping by increasing the workload. Which means either adding friction to the drivetrain or making the rover heavier. This is assuming the motor will exhibit proportional behavior at higher load levels, which is possible but not yet proven. But despite the light weight causing other problems, I didn’t like the idea of adding friction or weight purely for the sake of ballast. So I am going to explore a different venue by removing the flawed servo control board. I’ll have to find some other motor controller and use only the mechanical portions of these micro servos as a DC gearmotor assembly.

Micro Sawppy Beta 2 Has The Shakes

The robot arm I built as a test mockup for my little rover Micro Sawppy Beta 2 (MSB2) was a simple manually-posed affair. I wanted to get a better feel of how such a thing would articulate before I put in the work to motorize it, and I had no suitable actuators on hand anyway. In fact, I had no idea what I would use for such a project, since I found problems with the micro servos I’m already using in this project.

There are a few robot arm designs built around the same small affordable micro servos. For example, the MeArm is a super minimalist robot arm designed to be assembled from laser-cut pieces. I’ve seen a few MeArm in person and based on how they moved, I could tell there are some challenges to use them effectively. One problem I witnessed was that, under certain circumstances, a particular servo would get into an oscillation bouncing on either side of the target position. Unable to ever reach that position and hold it steadily.

I built and ran MSB1 without seeing such behavior and had been feeling pretty good about things, but MSB2 used a different batch of micro servos from a different manufacturer. With this batch, I saw the same oscillation I saw on a few MeArm affecting MSB2 steering and I think it’s coming from certain servo control boards. Or at least I don’t see how it could be caused by my mechanical design changes between MSB1 and MSB2.

The comments on my tweet support my hypothesis: this batch of micro servos have some shortcomings in its feedback control logic to cause this behavior. I think it is very likely a deliberate engineering tradeoff decision dropping some feature to make it cheaper, given that these micro servos were built to minimize cost. There were multiple suggestions to add damping which does indeed mitigate the problem. For MSB2, this oscillation only occurs when I hold the steering mechanism up in the air. Once I set down the wheel, friction between wheel and ground adds enough damping to stop the oscillation.

I’m feeling particularly irritated at this servo behavior, because it turned my beloved feature into a bug: the smooth low friction rotation enabled by ball bearings is a contributing factor for this oscillation. If I didn’t use ball bearings and had high friction steering, this oscillation would probably not happen. But annoying as this was for steering, it became a disaster for driving.

Micro Sawppy Beta 2 Robot Arm

My little rover Micro Sawppy Beta 2 (MSB2) has a mock RTG in the back, and in the front I installed a mockup for a rover robot arm. Even as a non-motorized mockup, it was more than Sawppy V1 ever got! A Sawppy arm was always on the to-do list but I never dedicated the time to make it happen. In the absence of my own efforts, I’m happy to see some other Sawppy builders have added robot arms to their rovers. Like CJ’s arm documented here on Hackaday.io and on YouTube.

And this rover flexing its arm on Twitter.

Both of these robot arm projects followed the mechanical geometry of real Mars rover arms, which makes me happy in a “These are my kind of people!” kind of way. I haven’t studied the arm as much as these other Sawppy builders had, so I decided to start simple and small with MSB2. I designed and printed a very simple arm as practice. I didn’t have any kind of actuators on hand that would work at such a small scale, so this arm is limited to manual articulation. (I could pose it like an action figure, but no remote control or autonomy.)

Still, it was instructive to see what kind of motion is possible with this mechanism. I knew two things from the start: it needed to go into the stowed position and it needed to extend out to act like it is retrieving a Mars sample. Once I started playing with it, though, I learned two other things.

The first lesson is that this draft had only a subset of range of motion as the real thing. I couldn’t replicate the sample storage movement sequence shown in a NASA tweet illustrating how Perseverance will transfer core samples to the carousel handling tools and sample tubes. The second lesson is that I had a vague idea to build a rover that can be friendly and wave “Hi” to people, but this arm could not bend the way I wanted because it would collide with the left front wheel steering servo. I’m glad I learned these lessons on a simple test arm, before I spent the effort to motorize my arm. What I could use for arm actuator is a problem itself, as I encountered a problem with the micro-servos I’ve been using.