Highly Configurable Wheel (One Wheel To Rule Them All)

by CodeCreations, published

Highly Configurable Wheel (One Wheel To Rule Them All) by CodeCreations Apr 16, 2012

Featured Thing!


Updated to v1.33 11/8/12 4:13PM EDT. Vane support by JoeyC.
Updated to v1.32 6/9/12 4:13PM EDT. (+v-grooves +flats)
Updated to v1.23 4/23/12 1:52AM EDT. (240 downloads)
Updated to v1.22 4/21/12 6:38PM EDT. (72 downloads)
Updated to v1.21 4/18/12 1:16AM EDT. (187 downloads)
Updated to v1.2 4/17/12 11:56PM EDT.
Updated to v1.1 4/16/12 7:16PM EDT.

This is very highly customizable wheel in the way of an OpenSCAD file with 46 parameters that provides a limitless set of combinations and wheel designs. I affectionately refer to it as "One Wheel To Rule Them All."

It can be wide, narrow, big, little, fat hub, skinny hub, no hub, through-hole, servo arm mounted, chamfered, multi-tire, modeled tread, optical encoder-slotted, and more. It even accommodates stretched o-ring tires. It just can't be square, because my sources tell me that won't roll well. The code is extensively documented, and traces out helpful information about the geometry of the wheel/tire, as well as encoder slot metrics (e.g. each rising edge is 42.42mm/1.67in in travel).

It includes twelve standard tread patterns (all configurable in often surprising ways), eight core spoke patterns (also highly customizable), configurable support for o-rings, bands, and optical encoder timing slots (directional and non-directional), and a lot more. Plus, I’m still adding features as I think of them.

The images show most of the core building blocks, plus just a few random variations. Some of the settings produce unique and creative designs that don't even really match the descriptions. As an example, see the few spiral designs pictured separately.

To put it a different way, the tread and spoke designs are not limited to what you see. For example, you can easily stretch the length, width and height of each knob, and their relative positions to create new variations.

This design combines all my previous wheel designs and adds a lot of new features. For an easier-to-read version of the instructions, see my blog at http://www.thefrankes.com/wp/?p=2674.


For an easier-to-read and up-to-date version of the instructions, see my blog at http://www.thefrankes.com/wp/?p=2674.

Here it is on github: https://github.com/alexfranke/Highly-Configurable-Wheel

GET THE HIGHEST VERSION NUMBER! You can now find the older versions (for reference) in the git repository -- I'll be removing them from here so people don't get confused and download the wrong one.

In the 1.33 update: JoeyC added some nice features here to support vanes. Thanks!

In the 1.32 update: Added features suggested by JuliaDee: option for v-grooves instead of just, and flatted shaft option (with shaftFlatDiameter parameter). Check comments under Tread Parameters for how to use v-groove. Fixed a bug that cause outer nut trap to not render properly. Fixed a bug that didn't include shaft flats when rendered without a hub.

In the 1.23 update: Fixed a bug that places the trapped nuts incorrectly, without considering shaft size. Added a parameter to offset the placement of these nuts. (Thanks, AUGuru, for both of these!) (240 downloads)

In the 1.22 update: Added credits section to instructions. Fixed some argument/reference issues. Better knob foundation calculation/rendering. Fixed a number of bugs in knob sizing, including the bug indetified by TakeItAndRun, where the knobs sometimes extend into the interior of the wheel. (72 downloads)

In the 1.21 update: Fixed bug that prevented timing holes from rendering properly with spoke inset. Edited comments a bit and cleaned up some code. Combined a few parameters. (187 downloads)

In the 1.2 update: Line style uses spokeWidth. Supports an inner circle using innerCircleDiameter. Cleaned up some unnecessary code. Added spokeInset to allow seperate sized of rim and rest of wheel. Added captive nut option in hub. Added convexity of spoke area (inner and outer).

In the 1.1 update: Hub now supports standard hobby servo mounting arms/horns. Renders flat.

It's important to note that you can configure this wheel to such an extend that it may not be printable at home with extruded plastic printers. In these cases, services such as Shapeways could come in handy.

***Remember to see the website for the most up to date instructions.

Tire Parameters

Often wheels are built around the tires. In this section, specify the properties of the tires you're using, and this will define the diameter of the wheel. If you're using o-rings, the tireCSDiameter should be the cross-section diameter of the o-ring, or if you're using some other flat tire material (such as rubber bands), jsut specify the its thickness. If you're not using any tire at all, set the tireCSDiameter to zero.

  • wheelWidth: The width (or thickness) of the the wheel
  • tireCSDiameter: Cross-sectional diameter (CS) -- How thick is the tire rubber?
  • tireID: Internal diameter (ID) -- How wide is the inside opening?
  • tireStretch: Circumferential stretch percentage (usually 1 + 0-5%) -- How much to you want to stretch it to get it on?

Rim properties

The rim sits at at the outside of the spokes and supports the tires or added treads. Installed tires (such as o-rings, rubber bands, etc) are set into grooves carved out of therim, while trads are added onto it. Keep this in mind when you're using tires -- as an example, the rim height should not be smaller than the radius of o-ring tires.

The rim also supports rotary encoder timing holes for wheel feedback. Use the padding parameters to adjust the location of those holes. See the compiler output for helpful information about the distance indicated by each timing hole. Directional timing holes will produce a second set of holes that are 90 degrees out of phase with the first. This allows you to stack sensors at the same location over the wheel instead of trying to position them along the circumference. Directional timing holes essentially double the resolution. You can also double resolution by looking for both rising and falling edges.

  • rimHeight: The height of the rim portion of the wheel
  • timingHoles: The number of timing holes to carve into the rim
  • timingHoleInPad: The inside padding for the timing holes
  • timingHoleMidPad: The middle padding if direction timing holes is selected
  • timingHoleOutPad: The outside padding for the timing holes
  • directional: A directional encoder renders two sets of slots, 90 deg out of phase

Tread Parameters

In this section, specify the properties of the tire tread you want to render. If you're using a wheel (e.g. o-ring, rubber bands, etc), then use either the "o-rings" or "slots" settings, which will cut a groove (or grooves) in the wheel rim to fit the tires. The othertreat styles will render a tread pattern protruding out from the tire surface by the amount you specify in third part of "knobSize".

Imagine the tire is mounted on a robot and facing straight at you. The "knobSize" parameter defines the size and shape of knobs in an [x,y,z] format, where x goes across the rim, y goes up and down along the perimeter of the wheel, and z protrudes out from the wheel toward you.

The "staggerOffset" parameter allows you to stagger knobs across the tire by an amount you specify. Set this to zero if you want all the knobs lined up along the perimeter and aligned with the edges of the rim.

"numberOfKnobs" specifies how many knobs there are across the tire, and "lineThickness" specifies how thick the lines are from "drawn" tire styles, such as "x", "cross", and "zigX". You can use these pameters together in creative ways -- for example to extend a single tread profile across the width of the tire, or to create a contiguous zig-zag.

Finally, "radialTreadSets" defines how many sets of treads are rendered around the wheel. Each set contains two rows in order to create the staggered effect.

Tread styles are:

  • none: No tread is rendered
  • cross: Each knob is the shape of a plus sign with the specified lineThickness
  • o-rings: Grooves are cut into the rim to accept o-ring tires
  • squares: Each knob is a rectangle, whose size is specified by knobSize
  • spheres: Each knob is a smooth bump, whose size is specified by knobSize
  • cylindersX: Each knob is a cylindrical shape running across the wheel, whose size is specified by knobSize
  • cylindersY: Each knob is a cylindrical shape running along the perimiter of the wheel, whose size is specified by knobSize
  • cylindersZ: Each knob is a cylindrical shape protruding from the surface of the wheel, whose size is specified by knobSize
  • spikes: Each knob is a cone or spike protruding from the surface of the wheel, whose size is specified by knobSize
  • slots: Grooves are cut into the rim to accept flat tires, defined by numberOfKnobs (number of grooves), the first and third numbers in knobSize to define the width of the slots and the depth, and spaceBetweenTires for the distance between the tires and also from the outside edges to the first slots.
  • x: Each knob is in the shape of an "x" protruding from the surface of the wheel, whose size is specified by knobSize
  • zigX: Each knob is in the shape of a zig-zag protruding from the surface of the wheel, whose size is specified by knobSize
  • v: Each knob is in the shape of a "v" protruding from the surface of the wheel, whose size is specified by knobSize
  • treadStyle: none, cross, o-rings, squares, spheres, cylindersX, cylindersY, cylindersZ, spikes, slots, x, zigX, v
  • knobSize: The size of each knob [across wheel, along the perimeter, prodruding]
  • radialTreadSets: How many sets of treads to render around the wheel (2 rows per set).
  • numberOfKnobs: The number of knobs to render per row.
  • staggerOffset: A distance to offset the staggered rows.
  • lineThickness: The line thickness for "drawn" styles, such as "x" and "zigX"
  • maxTires: For o-rings, the maximum number of tires per wheel
  • spaceBetweenTires: For o-rings, the space between each tire, if there are more than one

Spoke-related Parameters

This section is used to define the spoke style of the wheel. Some of the properties are only applicable to certain wheel types, and these properties can be used together in creative ways to create a wide range of tire designs.

The "proportion" property affects how some spokes are rendered. The first number is the proportion of the design from the center of the wheel to the inside of the rim, and the second number is the proportion of the width inside of the wheel. For example, to create spokes that are roughly in the shape of a "U", you can use a "circle" style, and set the proportion to [1.5, 1.0], for cirle spokes that are 150% as long as the distance from the center to the inside of the rim, 100% as wide.

The spoke styles are:

  • biohazard: A biohazard logo-inspired design. Set numberOfSpokes to 3 to mimic the logo.
  • circle: Spokes in a circlar or oval form, defined by spokeWidth and proportion.
  • circlefit: The maximum number of circles that will fit between the center and the rim, with a set of smaller outer circles specified by outerHoleDiameter.
  • diamond: Spokes in the shape of a diamond (rhombus), defined by spokeWidth and proportion.
  • fill: Fills in the spoke area with a solid cylinder.
  • line: Straight line spokes, like you would see on a typical wagon wheel.
  • none: Leaves the spoke area empty and does not make for a very useful wheel.
  • rectangle: Spokes in the shape of a rectangle, defined by spokeWidth and proportion.
  • spiral: Spokes in the shape of a semicircle, defined by curvature, reverse, spokeWidth.
  • spokeStyle: none, biohazard, circle, circlefit, diamond, line, rectangle, spiral, fill
  • numberOfSpokes: Number of "spokes." Set this to three if you're doing the biohazard design
  • spokeWidth: This is how wide each spoke is.
  • proportion: proportion to rim, proportion of width
  • curvature: For "spiral", this is how curvey the spokes are. >0, but
  • reverse: For "spiral", setting this to "true" reverses the direction of the spirals
  • outerHoleDiameter: For "circlefit", the diameter of the outer holes, or zero for none

Hub Parameters

These properties define the hub -- or how the wheel connects to the motor. The default values for the captive nut are precise for a M3 nut and will make the nut a very tight (if not impossible) fit. I prefer this because it allows you to "melt" the nut into place with a soldering iron. However, if you don't have a solder iron or prefer a looser fit, then just adjust the nut diameter and thickness. (M3 hardware is, by default, set to 3mm screw diameter, 5.4mm nut diameter, and 2.3mm nut thickness.) Similarly, the holes for the motor shaft and grub screw are also precise. This allows the holes to be drilled out for a more precise fit. Again, you can adjust these to suit your needs.

The hubZOffset can be used to "sink" the hub into the wheel, and it defaults to half the wheel thickness. For example, when the hubHeight is 10 and the hubZOffset is -2, then the hub will protrude 8mm from the wheel, but the shaft hole will be 10mm deep. The set screw will still be positioned in the middle of the exposed vertical height, and the fillet/chamfer will also be rendered in the correct position. This property is also useful if you want to poke a hole entirely through the wheel. (e.g. If the wheel is 6mm thick, set the hub height to 16 and the hubZOffset to -6, and you'll get a hub that protrudes 10mm from the wheel surface with a hole that extends all the way through the wheel.)

To mount a servo motor, set includeHub to false, set shaftDiameter so that the hole will accommodate the servo horn screw and any bit that protrudes from the top of the servo horn. Then set the servoHoleDiameter to the size of your mounting hardware, and set servoHoleDistance1 and servoHoleDistance2 to the total distance between mounting holes on your servo (not the distance from the center). These sets of mounting holes will be rendered at 90 degree angles from one another. If you only want one set of holes, set one of the values to zero. Adjust the angle of all the holes to avoid openings in your wheel design if necessary using servoArmRotation.

  • includeHub: Set to false to remove the hub and only include the shaft diameter hole.
  • hubDiameter: The diameter of the hub portion of the wheel
  • hubHeight: The total height of the hub
  • hubZOffset: The Z position of the hub, negative numbers from the surface of the wheel
  • shaftDiameter: The diameter of the motor shaft
  • setScrewCount: The number of set screws/nuts to render, spaced evenly around the shaft
  • setScrewDiameter: The diameter of the set screw. 3 is the default for an M3 screw.
  • setScrewNutDiameter: The "diameter" of the captive nut, from flat to flat (the "in-diameter")
  • setScrewNutThickness: The thickness of the captive nut
  • baseFilletRadius: The radius of the fillet (rounded part) between the hub and wheel.
  • topFilletRadius: The radius of the fillet (rounded part) at the top of the hub.
  • chamferOnly: Set to true to use chamfers (straight 45-degree angles) instead of fillets.

Quality Parameters

  • $fn: Default quality for most circle parts.

More from Parts

view more

All Apps

No results.

1 day ago - Modified 7 hours ago


I have converted this to a library (Should tick off one of your TODO list items). Will be published tomorrow. (I'm a new user here so I must wait 24 hours to publish) ... in fact I only just discovered OpenScad a few weeks ago.
I don't yet know if there is a way to direct message in Thingiverse, but if there is, and you would like a preview, then flick me a message, otherwise just keep an eye out for my remix. It will be callled "Highly Modular Wheel (One Module To Rule The Wheels)". ;-)

Cool. We can also add it to this Thing if you want (with credit, of course). Welcome to Thingiverse and OpenSCAD!

17 hours ago - Modified 17 hours ago
bioconcave - in reply to CodeCreations

I would be very happy if you link to it from your Thing (assuming you like/agree with my approach - no obligation of course!).

Although my mod is very straight-forward, it does change the entire nature of how users will use the tool. so I think it's best (at least initially) that the 2 versions are kept separate to avoid confusion.
Secondly, I consider it to be a WIP at this stage, and having separate versions maintained in 2 different places may create extra work for both you and me, and confusion for users if it's in a state of change. It's also possible that feedback from more experienced OpenScad users may result in me making further changes.
For these reasons, I would appreciate it if you hold off from simply cloning it (at least until I'm happy that it's settled in as a stable version).

wow this is wheely cool

Thanks for a great wheel template!
Question: cant i find out how or cant one currently do shaftFlatDiameter from both sides?
Made wheels that went on very affordable BYJ48 Stepper Motor, and it's shaft has flat on both sides.
Filled the othe side with some wood splints :)

Wow, what a fantastic resource. I am floored.
I am sure I will make extensive use of this (in the physics and engineering classroom and in hobbies).

Do you have any plans of making this compatible with Makerbot's Customizer? You already have all of the hard work done, it would really just be a matter of changing the comments for the user controlled variables. This would make it more accessible to people that are afraid to use OpenSCAD! I could help out if you're interested, just don't want to step on your toes!

Hi eriqjo -- I tried that when customizer first came out, but a lot of the things I was doing weren't very well supported at that point. Those limitation might have changed since then, though, and you're more than welcome to take a stab at it. I'd like to keep any updated code here in this location (with the original "thing" as opposed to as a derivative), but we should be sure to give you credit in the code!

is there a way for these files be STL? thank you , good work idea

You can use OpenSCAD to generate the STLs. There are frankly so many parameters and options that it would be impossible to create STLs for them all... OpenSCAD is a free download.

Can it do elliptical gears?

Sorry, I don't have gears in there at this time.

This is a truly excellent tool.  Thank you for sharing it!  Would you be willing to give an update on your project to make this work with gears as well?

Thanks for your comments! Gears have been on the list for a while, but it's a pretty significant feature -- I haven't made a lot of progress on it yet because there hasn't really been a lot of the demand. 

Great job, saved me a lot of time, and some very cool patterns too!

I just had to add one thing for my application. I'm using small slot detectors mounted on the bot sides, too small to go over the wheel, and I needed small vanes inside the rim to trigger the detectors. I added the code for optional generation of the vanes, with the size position and number of vanes all settable.

I was going to post it as a derivative, but I figured you might want to just add the option into yours. Let me know if you'd like me to send you the code.


I nearly forgot to add this, but I remembered this morning. Thanks again for contributing! 

Thanks! And sure, I'm happy to add it -- I'll be sure it gets into the github, too. You can just message me here. 

Probably the single most useful Thing in the Thingiverse, well done and thanks! It's useful way beyond just vehicle wheels as it can be kluged into making pulleys, cranks etc. - would love to see more specifically-designed options for that like v-grooves instead of just o-rings. Also a flatted shaft option would be really really handy.

Okay -- check the latest version. I added both v-grooves and shaft flats. Check comments in the code file under Tread Parameters for how to use v-groove. Use the shaftFlatDiameter parameter to specify the shaft flat.

Awesome, you rock!

Thank you!! :) Excellent suggestions -- I'll work on them.

You are missing a swastika wheel

Um... Yes, that's correct. I don't plan on adding that design.

you said it can't be square. it can if you set $fn=4!

Ha! Awesome!! 8-) 8-)

Maybe there's a better way to do this. I'm real new to SCAD. I added a variable (setScrewNutOffset) to the "Remove the captive nut" section on the hub code. When set to a really large shaft diameter, the captive nuts were getting lost. Playing with a large shaft to build a wheel to mount on the outside of an outrunner brushless motor.

// Remove the captive nut
for( i=[0:nuts-1] ) {
rotate([ 0,0, (360/nuts)*i ])
translate([diameter/setScrewNutOffset,0, height/2 - (height+hubZOffset)/2]) {
rotate([0,-90,0]) {
captiveNut( nutSize, setScrewDiameter,
depth=height/2+1, holeLengthTop=hubWidth/2,

holeLengthBottom=hubWidth+baseFilletRadius );

This is now fixed in v1.23.

Thanks! Like the offset idea too. I haven't printed any wheels yet, still just playing around. I need to get the calipers out and measure a few components, and browse McMaster for some o-rings around the right size.

If you run out of things to do, being able to put some sort of knurled texture inside the o-ring grooves to prevent slippage would be cool. Like I said I haven't printed one so it might not be a real problem on an RPed part.

I got my o-rings on ebay a while back. I've been meaning to get down to the home center or auto parts store and see if there are any very commonly used sizes... I imagine they'd be cheaper if they're more easily available. I haven't had any problems with mine slipping, but let me know if you do. I have stretch set to 1.015 I think, and they hold pretty tightly.

A friend at the local hackerspace suggested pinball machine o-rings, saying they're a lot stretchier and would probably grip a lot better. I haven't tried them yet, but I'll report when I do.

Interesting -- What shaft sizes? I can take a look at the code and see if I can fix it. If it's not just covering up a bug, I can add your offset idea to the next version.

I'd also love to see some pictures of what you end up with -- so please don't forget to share!

Something in the 25mm range. I was just experimenting with the 1.22 settings. Love the concavity settings for the spokes.

In this case, I set my setScrewNutOffset to 2.375 to keep the hole in the middle of the hub ring. I kind of like being able to set it. On a thicker hub I might want to put it more towards the center.

Yeah, that's a bug. I'm not correctly considering the shaft hole size when I'm placing that trapped nut. I'll fix that and add your offset idea as well -- I'm thinking offset from center, where
lt;0 goes in and
gt;0 goes out.

That wheel looks pretty darn cool! 8-)

Nice Work!

While playing around with the settings I found a little bug.
These settings will create knob thread patters that extend to the inside of the wheel's rim:

treadStyle = "x";
knobSize = [5,4,10]; // The size of each knob [across wheel, along the perimeter, prodruding]

ng set to 10)

I think what happens is that the support that accounts for the bending of the rim should NOT be scaled with the hight of the knob.

One suggestion: an option to move the nut(s) for the set-screw(s) to the inside of the wheel, hiding them from view, making the hub look prettier.

ing at your code for module diamondSpoke, I finally understood how to use the assign command in a smart way.


This is now fixed in v1.22.

Thanks for your comments and your sleuthing! I'll take a look at this tonight and see if I can come up with a fix.

I'm not quite sure what you mean by moving the nuts to the inside. The whole "hub" in this case is actually on the inside. Do you mean there should be options for a prettier "hub" on the outside of the wheel? That's a pretty good idea... I imagine it would make it harder to print at home, but it c
ould actually serve as a platform for bridging if the spokes are inset or concave... I'll have to fiddle with that idea, too.

FYI, I'm also planning to try to add gear teeth at a tread style, but I need to do a bit of research first. When I do this, I'll add a captive nut hub style as well -- sort of the way the large gear works on Greg's extruder...

Captive nut option for any of the hub holes (including servo horn ones) would be very cool indeed. If you're making a wish-list, a hub to retain a bearing (like a 608) would be nice also.

I'm going to see how some spiked wheels print and work this weekend for a robot that I need to run on low pile carpet. I'll probably stick to o-rings for anything that's designed for hard surfaces. I've always wanted to see how one of those Cause of the Week wrist bands work for tires also.

AUGuru -- my kids and I picked up a pack of six of those "cause of the week" style wrist bands at the craft store over the weekend. The new filament came in this week, so I got a chance to try it out, and the traction seems excellent! I posted the one I did as a derivative here: http://www.thingiverse.com/thing:22535http://www.thingiverse.com/thi...

Wristband Wheel

Yeah, let me know how the printing goes. You can definitely configure your way out of a printable object with this due to overhang limits, but there's always shapeways! :)

I'll add bearing retainer and servo horn captive nuts to the list, too. Thanks for your input on this! Wrist bands == another genius idea. I'll have to try that one, too.

Servo horn nut traps are in there now, as well as a large extruder gear style one, and some other stuff. See the comments for details. Bearing retainer is still on the list.

Nice! A Lot of work has been put into this! Do you plan to put it on github so we can follow the updates if there are any? Thanks for sharing!

Or, you know, you could just have an awesome thing and stay up on the home page by it being popular. That's another way to do it. ;)

That's a great idea -- I should probably do that. Thanks! I'll try to get it out there tonight.

thingiverse should let you subscribe to thing updates. There should also be a "what's updated" list like the "what's new" section. That would definitely encourage contributors to continue refining their things. /rant

Having said that, you can get more screen time on the thingiverse home page if you add your other things to this thing so that this becomes a derivative of those. Bonus traffic from people who stumble on your other things and click through when they see there's a derivative. #workthesystemyo

and if I were you, I would add one per every time your thing drops off the front page until all of your things are added... maximum top page views.

WOW! Thank you for the effort that went into this. This is going to be my new go-to for hobby robot wheels. Live the tread options. Going to have to see if I can recreate Pololu track hubs with the offset pattern.

What do you think the best hub option would be for attachment to generic 360 degree servos?

I went ahead and posted the work on both the the spoke insets and concavity. The inner circle is also in this latest update.

Okay -- it supports servo arms now. :) Be sure you have the file with v1.10 at the end, and see the last paragraph of comments under the hub section.

Servo arm support looks great! It can be a bit tricky to make sure the "bolt circle" is big enough to support the mounting holes with some spoke patterns though. Forcing a solid circle of a certain diameter (minus hub and mount holes) would be a nice feature. Aother would be the ability to make the spoke section thinner than the wheel width, with variable offset. If I knew SCAD at all I'd try this myself, and this could be a good reason for me to try to learn :)

I actually already have the thinner spoke section in the works -- two different methods: The first sets an inset for both the inside and outside of the wheel (this would accomplish what you suggest), and the second method will make the wheel body concave. They're it's not quite read yet, though -- hopefully soon...

I had the same thought about the inner circle when I ran into problems fitting the fillet on some wheel styles. All add that feature to the list.

Cool -- let me know how the pololu track experiment goes.

Yikes! I forgot all about servos! I'll add an option for common servo arms tonight after I finish my taxes :/ Thanks for the heads up on this one!

This looks wheely interesting