geared part

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: geared part

jon_bondy
I'm struggling with getting the gears to work out correctly. I've
provided a test jig, below; the scan of the part is overlaid with the
[red] gear design that I am playing with.

I keep fiddling with the number of teeth and the mm_per_tooth, but when
I get the tooth spacing right, the radius of the generated gear does not
match the radius of the part.  Any insights would be appreciated.


The library comes from here: https://www.thingiverse.com/thing:5505

The PNG file comes from here: http://www.jonbondy.com/scan0001.png


use <publicDomainGearV1.1.scad>;

// lay scan of part under design for comparison
translate([0, 0, -10]) scale (0.1675) surface(file = "scan0001.png");

module myGear() {
     // 25 teeth visible
     nt = 100;
color("red")
     translate([63, -25, 0])
         rotate([0, 0, -39.6])
#        gear(mm_per_tooth = 5.4,
             number_of_teeth = nt,
             thickness = 3.7,
             teeth_to_hide = nt - 25,
             pressure_angle = 15,
             clearance = 0.1,
             backlash = 1
             );
     }

myGear();


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: geared part

cacb
In reply to this post by jon_bondy
On 02.06.2019 16:18, jon wrote:

> The part I'm trying to duplicate looks like this:
> http://www.jonbondy.com/scan0001.jpg
>
> I ended up scanning it so that I could try to take off the dimensions
> more accurately (the original scan is much higher resolution).
>
> Now I want to lay the scan under my part, in OpenSCAD, so that I can
> manipulate the design until it conforms to the scan.
>
> Best I can do is surface() the scan file as a PNG.
>
> I wonder how often it would be useful to put an image file down just as
> a template
You can generate models directly from images, see attached generated
OpenSCAD script generated from a manipulated version of your file. I can
also generate a similar AngelCAD script from the same image, the
resulting STL is essentially the same.

To make it really useful you need to use the higher resolution image.
The high contrast background is very important, black on white is the
right way to go (or white on black). You also have to pay close
attention to shadows, try to eliminate them as much as possible. A
flatbed scanner can be a good tool. It is also important to have a
margin around the model on all sides.

I took your image and sized it up, manipulated gamma to improve the
contrast, added a margin, made a negative and reduced the color depth to
2 colors only. The result is shown in the attached small thumbnail.

 From the larger version of that image, the .scad file was created. If
you have high resolution scan conforming to the above requirements
(never mind the image processing), the complete gear can probably be made.

Carsten Arnholm

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

scan0001_b.scad (7K) Download Attachment
scan0001_b_small.png (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: geared part

shadowwynd
In reply to this post by nophead
I agree with the Scan--> Inkscape--> OpenSCAD path, and have done it often.

Tips:

If possible, use a copy machine or a flatbed scanner.  Ideally, a copy
machine that can output to PDF is ideal.  Scan at the highest resolution
possible.  It is a good idea to put a "reference" on the copier/scanner bed
with the item (something small and easily measurable, like a credit card -
e.g.  85.6 mm × 54mm ).  This way you can make sure that the scale is right
in inkscape.  Scanning it directly as PDF helps guarantee that the sizing is
correct, if scanning as a JPG or other image file you certainly need the
credit card trick as well.

Sometimes scanning in black/white instead of color or greyscale can be
helpful as well.   Sometimes painting the part black with acrylic paint can
help, the backer on most copiers/scanners is white.  Inkscape's bitmap to
vector tools work best when there is a strong contrast between "part" and
"background".

Open Inkscape, import the image or the PDF file.  Use the built in tools to
check the scale of the imported part, adjust size of imported part until it
is accurate.   Path-->Trace Bitmap or use the "Paint Bucket" tool to turn
the image to a vector.  Use the Extensions-->Modify Path-->Flatten Beziers.
Export to Openscad path (using the plugin above) or save as "DXF" and then
import into OpenSCAD.



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: geared part

jon_bondy
In reply to this post by cacb

Carsten:

I KNEW someone had already solved this problem!

I scanned the object at high resolution on my scanner, but the light source was to one side, so there are shadows.  I'm not sure how to eliminate them other than to photograph the object using a circular light source. 

And the reason I am making a 3D printed copy is that some of the teeth were ruined, so even if I could take a perfect scan, the resulting OpenSCAD object would just be equally flawed.

I would prefer to actually model it, so I can modify it.

Jon

On 6/2/2019 11:16 AM, Carsten Arnholm wrote:
On 02.06.2019 16:18, jon wrote:
The part I'm trying to duplicate looks like this: http://www.jonbondy.com/scan0001.jpg

I ended up scanning it so that I could try to take off the dimensions more accurately (the original scan is much higher resolution).

Now I want to lay the scan under my part, in OpenSCAD, so that I can manipulate the design until it conforms to the scan.

Best I can do is surface() the scan file as a PNG.

I wonder how often it would be useful to put an image file down just as a template

You can generate models directly from images, see attached generated OpenSCAD script generated from a manipulated version of your file. I can also generate a similar AngelCAD script from the same image, the resulting STL is essentially the same.

To make it really useful you need to use the higher resolution image. The high contrast background is very important, black on white is the right way to go (or white on black). You also have to pay close attention to shadows, try to eliminate them as much as possible. A flatbed scanner can be a good tool. It is also important to have a margin around the model on all sides.

I took your image and sized it up, manipulated gamma to improve the contrast, added a margin, made a negative and reduced the color depth to 2 colors only. The result is shown in the attached small thumbnail.

From the larger version of that image, the .scad file was created. If you have high resolution scan conforming to the above requirements (never mind the image processing), the complete gear can probably be made.

Carsten Arnholm

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: geared part

cacb
On 2019-06-03 03:47, jon wrote:

> Carsten:
>
> I KNEW someone had already solved this problem!
>
> I scanned the object at high resolution on my scanner, but the light
> source was to one side, so there are shadows.  I'm not sure how to
> eliminate them other than to photograph the object using a circular
> light source.
>
> And the reason I am making a 3D printed copy is that some of the teeth
> were ruined, so even if I could take a perfect scan, the resulting
> OpenSCAD object would just be equally flawed.
>
> I would prefer to actually model it, so I can modify it.

My cheap flatbed scanner does a decent job since the light source it
very close. But the object has to be reasonably flat on one side and you
have to do a bit of image processing anyway so it isn't simply a
one-button-push process, but if you know what you are doing it can
sometimes be done successfully.

I agree you would want to model it, for the reasons you give. But a
model generated from a scan can still be useful as a reference, you can
for example subtract your model from the scan-model to see if the teeth
and holes line up properly without having to print and discover they
don't :-)

Carsten Arnholm

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: geared part

adrianv
In reply to this post by jon_bondy
jon_bondy wrote

> I'm struggling with getting the gears to work out correctly. I've
> provided a test jig, below; the scan of the part is overlaid with the
> [red] gear design that I am playing with.
>
> I keep fiddling with the number of teeth and the mm_per_tooth, but when
> I get the tooth spacing right, the radius of the generated gear does not
> match the radius of the part.  Any insights would be appreciated.
>
>
> The library comes from here: https://www.thingiverse.com/thing:5505

From what I can tell your main problem is the lack of a systematic approach.
I think fiddling with the parameters and hoping to get it right is a recipe
for frustration.  I used the following method:  I located the center base of
the two edge teeth, and the center base of a middle tooth.  I used those 3
points to draw an arc (using the arc function from BOSL2) and I added a line
to the BOSL2 code to display the center, radius and arc angle.  Then I put a
point at the tooth tip and computed the tooth height and adjusted the radius
by half that amount to get the appropriate circle that defines the gear (the
circle at the midline of the teeth).   Then I computed the number of teeth
based on the angle of the arc, and finally the mm_per_tooth value based on
the circumference and the number of teeth.   I think it looks reasonably
decent for a first effort.  I compare it here to the model Carsten posted,
scaled to be 120mm wide, since that seemed to be your scale.   The scad file
is attached.  

I tried to do the same thing using MCAD, and even with the fix posted in
this thread, I couldn't get it to work.  Not sure what I was doing wrong
there.  I checked BOSL and found that it's actually a descendent of the
public domain gear library.  It produces the same result but without the
deprecation warnings.  

geartest.scad <http://forum.openscad.org/file/t2477/geartest.scad>  
<http://forum.openscad.org/file/t2477/gear.png>








--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: geared part

jon_bondy
Thank you all for your help and comments.  I've learned a lot about a
variety of techniques

In the end, I managed to come up with gear parameters that matched the
part, more or less.  Basically, I set the tooth width to match the part
and increased the number of teeth to control the radius.  A little bit
of tweaking got it pretty close.  I'm printing a test part now.

On 6/3/2019 5:55 PM, adrianv wrote:

> jon_bondy wrote
>> I'm struggling with getting the gears to work out correctly. I've
>> provided a test jig, below; the scan of the part is overlaid with the
>> [red] gear design that I am playing with.
>>
>> I keep fiddling with the number of teeth and the mm_per_tooth, but when
>> I get the tooth spacing right, the radius of the generated gear does not
>> match the radius of the part.  Any insights would be appreciated.
>>
>>
>> The library comes from here: https://www.thingiverse.com/thing:5505
>  From what I can tell your main problem is the lack of a systematic approach.
> I think fiddling with the parameters and hoping to get it right is a recipe
> for frustration.  I used the following method:  I located the center base of
> the two edge teeth, and the center base of a middle tooth.  I used those 3
> points to draw an arc (using the arc function from BOSL2) and I added a line
> to the BOSL2 code to display the center, radius and arc angle.  Then I put a
> point at the tooth tip and computed the tooth height and adjusted the radius
> by half that amount to get the appropriate circle that defines the gear (the
> circle at the midline of the teeth).   Then I computed the number of teeth
> based on the angle of the arc, and finally the mm_per_tooth value based on
> the circumference and the number of teeth.   I think it looks reasonably
> decent for a first effort.  I compare it here to the model Carsten posted,
> scaled to be 120mm wide, since that seemed to be your scale.   The scad file
> is attached.
>
> I tried to do the same thing using MCAD, and even with the fix posted in
> this thread, I couldn't get it to work.  Not sure what I was doing wrong
> there.  I checked BOSL and found that it's actually a descendent of the
> public domain gear library.  It produces the same result but without the
> deprecation warnings.
>
> geartest.scad <http://forum.openscad.org/file/t2477/geartest.scad>
> <http://forum.openscad.org/file/t2477/gear.png>
>
>
>
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: geared part

jon_bondy
I'm almost there.  Everything lines up, except that the gear teeth are
about 50% too short.  Any ideas?  Again, I'm using this gear library:

https://www.thingiverse.com/thing:5505

On 6/3/2019 7:31 PM, jon wrote:
> Thank you all for your help and comments.  I've learned a lot about a
> variety of techniques
>
> In the end, I managed to come up with gear parameters that matched the
> part, more or less.  Basically, I set the tooth width to match the
> part and increased the number of teeth to control the radius. A little
> bit of tweaking got it pretty close.  I'm printing a test part now.
>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: geared part

adrianv
The code I posted used that very same library and made teeth that appear
exactly the right length.  Did you try that?  If it doesn't work, it seems
like it must mean the template is wrong.  

You don't indicate what parameters you're actually using so it's pretty hard
to guess what's wrong with your model.  


jon_bondy wrote

> I'm almost there.  Everything lines up, except that the gear teeth are
> about 50% too short.  Any ideas?  Again, I'm using this gear library:
>
> https://www.thingiverse.com/thing:5505
>
> On 6/3/2019 7:31 PM, jon wrote:
>> Thank you all for your help and comments.  I've learned a lot about a
>> variety of techniques
>>
>> In the end, I managed to come up with gear parameters that matched the
>> part, more or less.  Basically, I set the tooth width to match the
>> part and increased the number of teeth to control the radius. A little
>> bit of tweaking got it pretty close.  I'm printing a test part now.
>>
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
12