What's new

Involute Gear Generator

bolsover

Senior Member
Hi All
I've been working on an extension to my Utilities Add-on with the aim of developing an involute gear generator.
Screen shot of what I have now...
Screenshot 2022-06-03 212341.png

There is a way to go... it's not bug free and I want to add in fillets to the tooth root as well as clearance factor. I'd be very happy to get some feedback form users who understand gear geometry and C#. On the plus side, I'm reasonably sure the tooth profile is true involute - or at least as close as Alibre can get using splines.

Anyone interested?

David
 

Attachments

  • Screenshot 2022-06-03 212341.png
    Screenshot 2022-06-03 212341.png
    74 KB · Views: 9

HaroldL

Alibre Super User
That's pretty good.
I don't need to do gears but that is the kind of thing that will elevate Alibre.
A couple of questions - will the preview update with changes to the parameters and will there also be imperial dimensions?
 

Ken226

Alibre Super User
It looks great. Have you compared it's involute profile to that generated by Alibre's included involute script?

How does one go about getting a copy of your utilities add-on?
 

albie0803

Alibre Super User
Be aware that there is a minimum tooth count before undercutting is needed for the mating gear to revolve properly, dependent on the PA.
see https://www.tec-science.com/mechanical-power-transmission/involute-gear/undercut/

Also, being able to over/undersize a gear is often important. This involves addendum modification factors.

I also wasn't aware that the supplied gear script created a true involute curve. I've just compared it to a gear I created from the GearCAD program we have and it looked pretty close.

Being able to input clearance (or backlash) will be important if people want to use these for 3D printing. Backlash has recommended values depending on the Module/DP and the number of teeth for generated and ground teeth, so I'm assuming that printed teeth will require more, depending on the surface finish and accuracy the printer is capable of.

If modelled gears are only for placeholders and commercially generated gears will be used in the final product then the gear OD and the centre distance between each set is all that will be needed for a correct fit, the rest is just eye candy.
 

bolsover

Senior Member
That's pretty good.
I don't need to do gears but that is the kind of thing that will elevate Alibre.
A couple of questions - will the preview update with changes to the parameters and will there also be imperial dimensions?
Hi @HaroldL
The view has to be generated. I'm not sure it is possible to have a 'live' preview (although it would be nice).
At present, I'm concentrating on module (metric) rather than DP (imperial) but in principal, there is no reason why couldn't include that at some stage.
db
 

bolsover

Senior Member
@Ken226
I think the Alibre Script provided gear generator does a good job - but it has some limitations and I suspect many users would like a more intuitive interface.
I've not yet published the involute generator but all the other work I've done is available from Github here..
UtilitiesForAlibre
All the source code is available together with one formal release. I'll be adding in the involute work in due course but want to fix a few issues first.
db
 

bolsover

Senior Member
@albie0803
I've already read though quite a bit of the info on the tec-science web site - all good stuff and certainly gave me a head start on some of the math.
There are quite a few factors I yet need to take care of: over/undersize, undercutting and clearance probably the most important.
At present, I'm concentrating on getting the profile geometrically correct as in your mention of placeholders but with the aim of adding in factors for printable gears.

My usual code development process is:
1 Get working code
2 Get it working reliably
3 Optimise
4 Go back to 1

At present, I think I'm on the verge if 1...
I found a good tutorial on Youtube where some of the math is discussed.
(search for Modeling an Equation Driven Involute Spur Gear in Solidworks by Yang Cao)
The Youtube tutorial is aimed at developing an equation driven gear in Solidworks. Now Solidworks has a facility to generate equation driven curves. Sadly, this is not a feature of Alibre. I also looked at using the Alibre Excel features - but too many limitations. It could almost certainly be done in Alibre Script - but I dislike Python.

So a C# plugin it is.

How it works..
Using a spline for the involute is the best compromise I could find. It is not perfect but probably good enough is sufficient nodes are used.

The first node of the first curve from the base circle is easy. If the gear centre is at (0,0) the first node is at (base circle radius, 0).
Coordinates for following nodes are then calculated using an adaptation of the formulae given in the Youtube tutorial.
Each node is checked to confirm it is within the Addendum circle.
When the routine finds a node outside the Addendum circle, the routine calculates the intersection point of a straight line between the last node inside the addendum circle and the first node outside. This calculated point is then used as the last node of the spline.

The first node of the second curve (other half of tooth profile) is a little tricky but once the correct location has been established (see Youtube tutorial) the remaining nodes follow the same pattern as first curve but with modified formula.

The rest is simple arcs and lines developed from the start/end points of the splines.
Repeat for all the teeth.

As I mentioned elsewhere, I'll publish the code in due course - and will be welcoming contributions.

Here's a copy of the really nasty code I have at present for one of the curves:
C#:
private Array CalculateInvolute(int toothNum)
        {
            var theta = 360 / (double)properties.ToothCount * toothNum * Math.PI / 180.0;
            var centre = new Point(properties.WheelCentreX, properties.WheelCentreY);
            var baseRadius = properties.BaseCircleDiameter / 2;
            var points = new List<Point>();
            var stepSize = 90 / (double) properties.CountInvolutePoints * Math.PI / 180.0;
            var step = 0.0;
            // create the involute points
            Point priorPoint = null;
            for (var i = 0; i < properties.CountInvolutePoints; ++i)
            {
                var point = new Point()
                {
                    X = baseRadius / 10 * (Math.Cos(step) + step * Math.Sin(step)),
                    Y = baseRadius / 10 * (Math.Sin(step) - step * Math.Cos(step))
                };
                point =  translatePoint(point, theta);
                if (i == 0) point1 = point;

                if (IsInsideCircle(centre, properties.AddendumCircleDiameter / 20, point)) points.Add(point);

                if (priorPoint != null &&
                    IsIntersecting(centre, properties.AddendumCircleDiameter / 20, priorPoint, point))
                {
                    var Intersection = new Point();
                    var result = Intersect(centre, properties.AddendumCircleDiameter / 20,
                        priorPoint, point, ref Intersection);
                    if (result == 0)
                    {
                        points.Add(Intersection);
                        pointx = point2;
                        point2 = Intersection;
                    }
                }

                priorPoint = point;
                step += stepSize;
            }

            Array interpolationPoints = new double[points.Count * 2];
            var j = 0;
            foreach (var point in points)
            {
                interpolationPoints.SetValue(point.X, j++);
                interpolationPoints.SetValue(point.Y, j++);
            }

            return interpolationPoints;
        }

David
 

ClaudeG

Senior Member
Hi Boldover,
few months ago, Joko publish comparaison gear generated from 2 differents ways.
Here the pointer to the fisrt one:
 

HaroldL

Alibre Super User
That's a pretty good video and a nice walk down memory lane with SolidWorks. It would be nice if Joko repeated it in Alibre, if that is possible.
 

albie0803

Alibre Super User
Dumb question but where do I unpack it to?
I made a folder here C:\Program Files\Alibre Design\Program\Addons\Alibre Utilities and unpacked the zip file into it.
I then opened up Alibre, opened a new part. No new tab.
went to Add on tab > addon manager, Utilities for Alibre present but not ticked. Ticked the box and OK and got this.

1654724377043.png
 

simonb65

Alibre Super User
@bolsover , I don't see the same issue as @albie0803 and @Ken226 , but I have visual studio with just about every version of .NET sdk installed, so maybe there is a dependency that your average user doesn't have. Also, just copying to the Alibre Add-Ons directory will have potential issues with the UAC and permissions of what users can and can't copy there. Maybe you need to create an installer to ensure all the dependencies from for your addon is installed from your development environment and that any files placed into Program Files have the right access rights.
 

bolsover

Senior Member
@bolsover , I don't see the same issue as @albie0803 and @Ken226 , but I have visual studio with just about every version of .NET sdk installed, so maybe there is a dependency that your average user doesn't have. Also, just copying to the Alibre Add-Ons directory will have potential issues with the UAC and permissions of what users can and can't copy there. Maybe you need to create an installer to ensure all the dependencies from for your addon is installed from your development environment and that any files placed into Program Files have the right access rights.
Hi Simon
Completely agree about installer - looking into that!
I think you are right about dependency issue - I also have many different .NET sdk installed so very likely I have a 'hidden' dependency.
David
 

simonb65

Alibre Super User
I'm sure @Max commented recently on where 3rd party plugins should be placed and how to correctly link them.

He did! @bolsolver, In case you missed the recent discussion, you will need to do this if your install in your own directory (as the addons don't have to be in Alibre/Addons and probably best not to put them there with the new side-by-side versioning installs that v25 introduces!) ...

https://www.alibre.com/forum/index....-before-installing-v25-beta.23440/post-157107
 

bolsover

Senior Member
@albie0803, @Ken226.
Thanks for the feedback. As @simonb65 observed, it's very likely I've managed to introduce some 'hidden' dependency I missed when packaging the project.
I think I need to install Alibre to an otherwise clean machine and do some further testing. Like Simon, my main machine has many different .NET sdk installed and it's probable that there is some issue there.
Putting plugins into the C:\Program Files\Alibre Design\Program\Addons\YourPluginName directory should work but as noted, it's not the 'correct' way these things should be done.

I understand the 'correct' method is to create a registry String key under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Alibre Design Add-Ons
For my Add-On, the name is {305297BD-DE8D-4F36-86A4-AA5E69538A69} and the Add-on files can be in any convenient directory.

David
 

bolsover

Senior Member
@albie0803, @Ken226, @simonb65
I think I have found the problem causing the Add-On load failure.
It is not a missing file but a security issue with files downloaded from the internet.
Now I'm not sure which of the files is causing the issue; it might be one or a few.
The long term fix will be in the form of an installer that can run with admin rights, copy files where needed and create the necessary registry entries.
The short term fix (if you care to try) is to modify the file properties:

The Security: this file came from..., Unblock checkbox needs to be checked.

As I say, I'm not sure which files need this to be checked!

Would be great if you could let me know how you get on.

Thanks, David

SecurityIssue.png
 

bolsover

Senior Member
@albie0803, @Ken226, @simonb65, @Cator
Thanks all for the invaluable feedback.
I've just uploaded a new version with setup executable.


The installer requires admin rights.
I'm sure everyone will be running virus checkers; I use AVG Business. This will check the file and then allows to run.
Everything appears to install correctly.
Files are installed to C:\Program Files\UtilitiesForAlibre and the required registry entry is in HKEY_LOCAL_MACHINE\SOFTWARE\Alibre Design Add-Ons

The installer is a simple Inno Setup program. It also creates an uninstaller so you can easily remove if not requires.
To avoid any possible conflicts, it would probably be best to delete any UtilitiesForAlibre files you may have added under the Alibre Plugins directory.

David
 
Top