Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Gear Lab - Cylindrical, Bevel, Face Gears
antlu65
Member Posts: 59 EDU
Yup, it's another custom feature for gears. I had previously used Neil Cooke's excellent 'Spur Gear' feature [Link], but I wanted the ability to generate bevel and face gears as well. I only learned about Bob Tipton's great bevel gear FS after I had nearly finished this. I fear that my "Gear Lab" custom feature is largely rehashing what has already been done, but I thought I'd share what I have in case anyone does find a use for it.
Here is a brief description of the feature set:
Here is a brief description of the feature set:
--- Gear Lab ---
* Generate cylindrical gears (spur, helical, herringbone, internal) with involute teeth.
* Generate bevel gears (straight, spiral, herringbone, internal) with spherical involute teeth.
* Generate face gears (straight, spiral, herringbone) with trapezoidal teeth and varying pressure angle.
* Position generated gear by specifying primitive geometry (a face, a face and vertex, an edge and vertex, etc.)
* Generate and position a gear by selecting a 'parent' gear created by this custom feature. The 'child' gear will have parameters and positioning set to fit the parent gear. Can enter an angle offset, or align to other geometry primitives.
* Generate and position a gear by selecting a 'parent' gear created by this custom feature. The 'child' gear will have parameters and positioning set to fit the parent gear. Can enter an angle offset, or align to other geometry primitives.
* Adjustment settings: bore + keyway, tooth chamfer, root fillet, tip/root/side adjustments, minimum land.
A few additional comments:
- most inputs are unitless and represent multiples of the gear module; consequently, changing the module will scale the entire part (with a few minor exceptions like the bore/keyway options).
- the pressure angle input is specifically for *normal* pressure angle (I believe the 'Spur Gear' feature uses transverse pressure angle for its input).
- the type of gear is determined by the bevel angle 𝛿 (𝛿 = 0 for cylindrical gear, 𝛿 = 90 for face gear); the face gear produced here is for meshing with cylindrical gears; the code can handle creating a face gear for meshing with bevel gears (𝛿 = 90 with spherical involute teeth), but I wasn't sure how to elegantly present that option to the user, so I left it out.
- the helical/spiral teeth are right-handed for positive values, and left-handed for negative values; the spiral bevel and face gear teeth follow a logarithmic spiral; could implement additional spiral patterns if requested, or zerol teeth.
- when using the "Inherit from Parent Gear" mode, valid unselected parent gears are highlighted in cyan; the currently selected parent gear is not highlighted.
- when specifying a Shaft Angle for a bevel gear pair, the resulting shaft angle may be slightly different from your input - this is because gear teeth are restricted to integer values. But for common usage where both bevel gears have the same bevel angle, this won't be an issue.
- the "minimum land" input in the Advanced Settings enforces a minimum tooth tip width (top land) to prevent teeth narrowing to a sharp point at high pressure angle.
- most inputs are unitless and represent multiples of the gear module; consequently, changing the module will scale the entire part (with a few minor exceptions like the bore/keyway options).
- the pressure angle input is specifically for *normal* pressure angle (I believe the 'Spur Gear' feature uses transverse pressure angle for its input).
- the type of gear is determined by the bevel angle 𝛿 (𝛿 = 0 for cylindrical gear, 𝛿 = 90 for face gear); the face gear produced here is for meshing with cylindrical gears; the code can handle creating a face gear for meshing with bevel gears (𝛿 = 90 with spherical involute teeth), but I wasn't sure how to elegantly present that option to the user, so I left it out.
- the helical/spiral teeth are right-handed for positive values, and left-handed for negative values; the spiral bevel and face gear teeth follow a logarithmic spiral; could implement additional spiral patterns if requested, or zerol teeth.
- when using the "Inherit from Parent Gear" mode, valid unselected parent gears are highlighted in cyan; the currently selected parent gear is not highlighted.
- when specifying a Shaft Angle for a bevel gear pair, the resulting shaft angle may be slightly different from your input - this is because gear teeth are restricted to integer values. But for common usage where both bevel gears have the same bevel angle, this won't be an issue.
- the "minimum land" input in the Advanced Settings enforces a minimum tooth tip width (top land) to prevent teeth narrowing to a sharp point at high pressure angle.
I've attached several animated gifs below to briefly demonstrate some of the features. Please let me know if you find it useful, have suggestions, feature requests, bugs, etc.
Gear Lab [Link]:
Gear Lab [Link]:
Tagged:
11
Comments
IDK if it's something up with my onshape account, but I can't seem to add it to my toolbar
* Performance improvements. Patterning the gear teeth using face patterns (instead of patterning bodies and using union) has significantly improved feature regen time. Unfortunately, there is currently an issue applying face patterns to root fillets. I have submitted a support ticket with Onshape Support to hopefully have this addressed.
Just wanted to say I've been testing this feature out on a side project and I really love it! really good work. If you're interested, I could put together a short list of ideas for improvements that have come to me while using it.
The behavior of helix angle when working with bevel gears is incorrect.
This is a tremendous tool, thank you so much for your work. I noticed that the root fillet does not seem to work when using bevel gears, so I wanted to bring this to your attention, @antlu65. Once again, thank you for your impressive contribution.
I have just played with Gear Lab, works nice!
Question, why is the bore size limited to 20mm?
How can I get the circle in line with the teeth?
Otherwise you need to create a second "gear" feature and use the "inherit from parent gear" option at the top to create a compatible gear.
But then realized that it's the bevel angle that is going to set the ratio: 45 deg requires two identical gears, try setting the parent gear to something else (like 30deg) and you will see the number of teeth adjust accordingly (an error message would be helpful here).
A good tip is that you can edit the first gear feature with the "final" button enabled to see how the changes to the first one affects the second.
That said I'm really not an expert on gears so you might want to do some reading on how all of this works if you want to get predictable results. I'm sure there's a formula you can use to figure out the exact bevel angle for the ratio you want (rather than trial and error) but I don't know it off the top of my head.
Cheers
The second gear is at a shaft angle of 90 degrees. If you measure the angle to Plane Right, you will find a deviation of 0.48 degrees. Am I doing something wrong or is this a bug?
https://cad.onshape.com/documents/4c1b2ce320fa110a0ca8f463/w/5e6302cd6c8930343255eeff/e/d4d1e2babd737630f0351ea9?renderMode=0&tangentEdgeStyle=1&uiState=66ace3b8b8a9a71aec60098d
Yes, this is because the way Bevel hears are defined here is fundamentally flawed. And it is very clear whoever made it failed to account for basic trigonometry, resulting in a deceiving behavior that fools the user into thinking they got what they want, but in fact the result could be catastrophically malformed, failing to be assembled without the most forgiving of geometric tolerances. Depending on your inputs, you can easily get misalignments of multiple whole degrees
The root of the problem lies in the "Bevel angle" input field. That should simply not exist. Whenever two gears mesh, bevel or otherwise, the fact that the number of teeth has to be an integer number imposes a restriction upon the possible gearing ratios as being only fractions that can be written between the numbers of teeth of the 2 gears. (common sense, I know) you can't have a sqrt(2) gear ratio, nor can you have a ratio of pi
The problem is that they let you define both the bevel angle and the number of teeth at the same time for the first gear, which sets an extra constraint upon the other gear. The internal angles of the pitch cones must add up to the shaft angle (so that they can be tangent, otherwise they would wither collide or not touch at all). When you add another gear, you are asked to input a shaft angle, and now the number of teeth field is completely ignored (try it, use inherit on a bevel gear and set the number of teeth to 1000, it will ignore it). Now once you've specified a shaft angle, the script must find a suitable fraction teeth_new/teeth_prev but also make sure the angles shaft_angle = bevel_prev + bevel_new
Now we are unable to satisfy both conditions at once. because bevel_new = shaft - bevel_prev and the ratio between number of teeth and bevel angle must be directly proportional if the gears are to have the same module, but now we need to write
teeth_new/teeth_prev = (shaft - bevel_prev)/bevel_prev
and pull out teeth_new = teeth_prev*(shaft - bevel_prev)/bevel_prev
and now we are screwed, because we are multiplying the number of teeth by an arbitrary ratio of angles, and whenever the angle part of the expression does not divide perfectly and does not yield an integer, the script will approximate with the closest integer number of teeth, compromising the shaft angle because it is no longer allowed to come back and change bevel_prev as it's part of an object that already exists.
The reason why the bevel angle is catastrophically bad is because for any integer gearing ratio, the bevel angle for the gears has the expression
shaft_angle*arctan(teeth_new/teeth_prev)/(2pi) and other than special cases like 1:1 or 1:2, the bevel angle is irrational when expressed in degrees. In order to not compromise the shaft angle, the user must separately calculate and then input an irrational angle up to the highest precision floating point will allow. Because of that, I think it is blindingly obvious that including bevel angle was design mistake.
S O L U T I O N:
Get rid of the stupid bevel angle altogether. As an engineer, you never care about the cone angle of 1 gear, as you never want a single gear working in isolation. Remove that option, and have you define the shaft angle on the first gear already, and then input the field teeth and teeth_other
then when generating the child gear, the only remaining option should be the align angle. You could also optionally have a read-only field that displays the current transmission ratio. because that is also important, but it would be bad if we let the user input a ratio because for some ratios that are close together the number of teeth required to write that decimal ratio as an integer fraction can vary wildly.
This problem is so bad that personally I've given up completely on using this featurescript for making bevel gears because it simply cannot be trusted if it can randomly "bend" the shaft angle by a few degrees.
Also the helix angle on bevel gears with different numbers of teeth is wrong as I've stated a few comments above but the developer doesn't seem to care to fix any of these issues. I would be willing to look in the code myself and gladly submit a patch or pull request, but they also chose to make it closed-source. Too Bad !
I'd recommend using this featurescript instead:
https://cad.onshape.com/documents/db73276df7574c7e29b36a0a/v/75ffeaca38e6357b4b1f0b3e/e/8939b2d6675e0257aaa00fdf?jumpToIndex=1529&showReturnToWorkspaceLink=true
It always obeys the shaft angle, doesn't mess up the helix angle, and most important of all, it actually lets me properly align the bevel gears with their common cone point, as opposed to the base of the first gear, which you always need to then move with a transform to get something usable.
(idk if it's necessary to say this but I wasn't in any way endorsed to recommend that add-on over any other as an alternative, it's just the one I found to be the most sane to use and had never given me wrong results)
There is a catch, though, there are such things as internal bevel gears and it cannot generate those. Gear lab can, and this is why I still have it installed because very rarely I've needed such a gear, but I always just open up desmos and calculate the numbers of teeth and bevel angle myself, verifying that the expressions above have integer solutions so that I know it won't mess it up with any rounding.
Honestly, I had completely forgotten about this for the past two years - apologies to everyone who had left comments that went unanswered. I appreciate you being my guinea pigs, and apologize for any frustrations caused by incorrect results produced. This was strictly a learning project - I was learning how to use OnShape, how to write basic FeatureScript, and how to derive basic gear equations. I am not a professional, nor have I ever claimed to be such - I'm just some random scrub on the internet. Use this feature at your own risk . I used this feature to produce some cheap 3d-printed gears for myself - I would not recommend that you use this to design the geartrain for your personal time machine or main battle tank.
@lazar_mihai: your criticisms are valid and appreciated. Were I to create an updated version of these scripts, I would certainly use your posts as references for improvements. But, I would suggest that your tone leaves much to be desired. Please take that into consideration if you continue to post in this thread.
There are certainly many areas that could be improved:
(1) Split the feature into smaller features for each gear type, instead of trying to cram them all into a single, monolithic feature
(2) Do not forcibly adjust the user inputs for bevel angle and tooth count in paired bevel gears, especially without notification - that only results in user confusion and frustration
(3) Math errors in the source
(4) Workflow needs to be improved
(5) There are certainly more…
If there is interest in updates, then I would consider investing time in an updated version written from scratch. Thanks to everyone for their input and consideration. I shall try to be more responsive in future.
I affirm the issue Lazar brought up r.e. the bevel angle. I was able to resolve my issue by going to this calculator:
https://www.otvinta.com/bevel.html
Importing the number of teeth I want and my desired shaft angle, and then picking any face width. Adjusting the face width didn't seem to affect things. Then, I took the bevel angle output from that calculator and input it into OnShape. Onshape is still reporting shaft angles about five thousandths of a degree off from perfectly level, but I think that the manufacturing processes I'm using are not up to producing this level of precision anyway, so this is good enough for me.
The ideal would be if the featurescript could be updated to automatically calculate the bevel angle. The trigonometry for it does not look that difficult:
The known terms are E, z1_m, and z2_m. We just have to solve for the two smaller angles. I have forgotten the trigonometry that can be used to do this, but OnShape knows how to do it for me!
https://cad.onshape.com/documents/7cdf7f6e4d2f3a54505e4354/w/ba750b40c81df34fce85dc6c/e/6bd6eab9eb8b7e7a3625c895?renderMode=0&uiState=6716ebe4a1a9462e4e2bccae
If you look at the sketch I made, I tried to replicate the diagram shown in the image.
The two driven dimensions are the bevel angles of each gear. You can see that the sketch matches the gears pretty much exactly if you roll to the end of the document. If I input the angle between the vertical line and the the right side of the triangle as the bevel angle of the first gear, then I get a perfect 90 degree angle on the shafts. I don't know how to create driven angles in OnShape, and I can't figure out how to edit gearlab, so I guess doing this by hand is necessary for now. But if someone could update this FS to do this automatically that would be cool.