dpellegr / PolyGear

OpenSCAD Gear Library
115 stars 17 forks source link

Question: Helix angle divided by two? #6

Closed bneuen closed 3 years ago

bneuen commented 3 years ago

Hi,

I was giving this library a go, and I am liking the results and ease of use. Thank you for putting the time and effort into creating it. However, I had a question about the helix angle, and figured I would post the question here so others could reference it if they had the same/similar question.

I am trying to recreate a couple gears that wore out and broke in a motorized chair for my Dad, and one of them is a helical gear. Referencing the KHK diagram for the helix angle, I measured the width/thickness of the gear, which is about 9.5 mm. I then tried to measure the "run" of a gear tooth (bottom vs top position of the same tooth), and got this to be about 4.5 mm. So calculating the arctan of these, arctan(4.5/9.5), gives 25.346 degrees, so I figure it is somewhere around 25 degrees (though I think using such a method of measuring could introduce a fair amount of error, so I will need to verify actual angle in some other way, but hope to get in the ballpark with this).

However, when I use 25.0 for the helix angle, it does not slope/tilt the teeth nearly as much as the actual gear teeth seems to be (just visually comparing). Even providing a helix angle of 90 produces reasonable teeth, which I would think would be an impossible case (teeth should be horizontal with this angle, right?). In looking at the code, it seems the helix angle is divided by 2 if it is not provided as a list. What is the reason for this division by 2? I assume there is something I am missing.

-Bowe

dpellegr commented 3 years ago

PolyGear assembles the gear by connecting together sections at different distances along the axis. A gear with no helix (or with helix specified as a single number) will only have two sections: the top and the bottom faces. This works fine for a gear with no or little helix, but will create a distortion for larger helices, hence the need of a list (even for constant helix), which will automatically create multiple sections along the gear axis.

The teeth are NOT rotated: their sections are (around the gear axis). That's why even when putting helix equal or above 90 deg the library won't break but will still produce some results.

BUT, there can be a mistake in the code translating the helix to the rotations of the sections, checking is on my TODO list, thanks for reporting!

bneuen commented 3 years ago

Ok, that makes sense. So I think in the case that helix angle is not a list (or not a a singleton), we just want to duplicate it to a be a list of length two. The top and bottom sections of the gear should have the same helix angle as the whole resulting gear. The "shift" or rotation of the tooth section will be already be halved for the top and bottom sections since the height of each section is halved. Thanks for explaining.

dpellegr commented 3 years ago

The case of the helix passed as a single number should be fixed by: https://github.com/dpellegr/PolyGear/commit/42face537ca39d4ae3e7966c62df3b7eb7b2a8cc A consistent application of the helix is shown in crossed_axis_drive.scad in the examples folder.