Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: JuneTheSecond on May 17, 2015, 10:45:15 AM

Title: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on May 17, 2015, 10:45:15 AM
As an extension of Rack and Pinion in Transfer rotational movement to linear started by Kiler40,
I made an example drawing for gears and trains of gears.
I used SETATREF function in the shapesheet.
And used Cell.Result property in VBA macro to trigger the endless rotation of gears.
It is because Cell.Result property does not destroy SETATREF formula.
Please enjoy an explaining video in YouTube.
https://youtu.be/rQBqloZa7xE

Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on May 19, 2015, 04:11:50 AM
I've modified the macro to start rotation of gears.
Now gears are rotating 720 steps when VBA macro runs.
Please enjoy a video in YouTube.
https://youtu.be/nGVQlXBzXr4
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on May 21, 2015, 03:35:18 AM
I've added gear tooth using custom line pattern.
Please enjoy as short video in YouTube.
https://youtu.be/AQf9puRvUp8

The problem is sometimes teeth and teeth do not meet.
I appreciate you suggestion.




Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: wapperdude on May 22, 2015, 08:20:30 PM
Hi JuneTheSecond,

Really cool the way the gears interact.

Regarding the gear teeth "meshing", it looks like the pitch of the teeth change with circle diameter.  This will throw off the meshing.  I suspect that the line pattern needs tweaking and use "scaled" property.  I believe that will set a constant pitch between the teeth.

Wapperdude
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on May 23, 2015, 11:19:20 AM
Thank you wapperdude.
I have to study more hard.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on May 24, 2015, 12:54:18 PM
Thank you wapperdude.
I git gear meshing.
Please enjoy a video in YouTube.
https://youtu.be/XZvXhM5y_IY
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: wapperdude on May 24, 2015, 08:54:35 PM
Wow!  The gears mesh perfectly!  Very well done.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on May 25, 2015, 12:27:22 AM
Thank you for your suggestion!
And please enjoy another video.
https://youtu.be/h1489pTf5_c
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: wapperdude on May 25, 2015, 12:51:11 AM
Sweet!  Yes, I did enjoy the video.  Very nice Visio development.

Made me chuckle when you typed in 3 teeth for the one gear.  Like, 3 teeth???  Really!?!  But then, watching the animation and how perfectly the teeth meshed, and seeing the effect that 3 teeth had!   This would be a good demonstration video for showing the effect of gearing.  Your table really facilitates changes. 

This is definitely one of my favorites.

Wapperdude
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on May 26, 2015, 11:28:12 AM
I've modified a little the shape of teeth of gears for better looking of gear meshing.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on May 29, 2015, 06:45:37 AM
I've made a planetary gear.
Please enjoy a short video in You Tube.
https://youtu.be/kiikmrPeS8I
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on June 06, 2015, 10:03:17 AM
Made a new planetary gear. Now outer ring gear is stationary.
Please enjoy a short video in YouTube.
https://youtu.be/9_i19sC1W60
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: Yacine on June 06, 2015, 10:36:04 AM
Sorry, but the only comment that came in my mind is: "You are crazy".
Great job.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on June 08, 2015, 07:32:06 AM
Thank you  Yacine.

Modified Visio drawing, and added video in YouTube.
https://youtu.be/hGkZpxSACHY
This video explains how to increse the number of planets and how to change number of gears.
Please enjoy.

Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: Bald Eagle on November 20, 2015, 02:13:52 AM
Those are really nice gear sets, Mr. Yoda. 

I often (try to) use VISIO to organize my thoughts and make detailed drawings of mechanisms.
Have you thought about developing a curve to accurately reproduce teeth on involute gears?

It would also be interesting to have a readout or label that would show the number of revolutions based upon the gear designated as the drive gear.   

I've only read through a small portion of these forums, and it's always a joy to see your beautiful projects and all of your skill and talent.   Please keep up the good work - it's quite inspiring!
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on November 27, 2015, 02:01:02 AM
Thank you for your comments.

Here is a Visio drawing to make involute curve.

A macro makes curve, when you right click on the shape and select a menu "Draw Involute Curve".
This shape has a control. If you move control, the top pf a line will trace on involute curve between -180 deg and +180 deg.

Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: Visio Guy on November 27, 2015, 10:07:09 AM
Cool! Reminds me of the old Spiral Maker:
http://www.visguy.com/2006/10/19/spiral-shape-maker/
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: Bald Eagle on December 01, 2015, 01:12:40 AM
 :)
You have an excellent mastery of the math, how to translate it into code, and how to execute that in VISIO.
I greatly enjoy your creations, Chris' excellent projects on [t]his site, and the work of many other talented people sharing their work.
Thank you again!
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on December 11, 2015, 12:32:04 AM
And here is a Visio drawing with macro that draws involute gear.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on December 12, 2015, 12:55:12 AM
I found a bug in macro.
Here is a revised Visio drawing.

And applied produced gears to existing Visio drawing of gear set.
Here is a Visio drawing and a short video in YouTube.
https://youtu.be/QDayY1P3fZo
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: Bald Eagle on December 16, 2015, 10:20:49 PM
<whistles>
That's some impressive shape-sheet work I see!
June IS crazy - the good kind of crazy!   ;)
It's a joy to watch him exercise his skill and create things of beauty.

For some reason, I don't seem to be able to get the "draw involute curve" macro to work.

I'm running it in VISIO 2007, on Windows 7 if that matters.
Screenshot of error attached.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on December 17, 2015, 12:08:37 AM
I am sorry I forget that Visio2007 or younger has no RELMOVETO cell and RELLINETO cell.
Please remove Rel2AbsRows in Sub DrawInvolute.

Sub DrawInvolute(shp As Visio.Shape)
   
.............................
   
    ActiveWindow.DeselectAll
    For Each tmpShp In tmpCol
        ActiveWindow.Select tmpShp, visSelect
    Next
   
    ActiveWindow.Selection.Join
    Rel2AbsRows
    ActiveWindow.Selection.FitCurve 0#, visSplinePeriodic
    Set tmpShp = ActiveWindow.Selection(1)
    tmpShp.Copy

..................................
   
End Sub
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: Bald Eagle on January 08, 2016, 12:50:47 AM
Thank you for that,
I hope everyone had a good holiday and vacation time.


I tried to comment out that variable definition, but when I run the macro I get another error, and when I hit debug I get the attached results.   Perhaps I'm doing something wrong or there's more to getting this to run in 2007 than just that one thing.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on January 08, 2016, 04:30:59 AM
Sorry, I forgot that PasteToLocation method is available after Visio 2013.
Please, use Paste method and add 2 lines after like


    'To duplicate involute to same location
    InvoluteShp.Copy
'    ActivePage.PasteToLocation InvoluteShp.Cells("PinX").Result(visInches), InvoluteShp.Cells("PinY").Result(visInches), 0
    ActivePage.Paste
    Set tmpShp = ActiveWindow.Selection(1)
    tmpShp.Cells("PinX").Result(visInches) = InvoluteShp.Cells("PinX").Result(visInches)
    tmpShp.Cells("PinY").Result(visInches) = InvoluteShp.Cells("PinY").Result(visInches)


Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: Bald Eagle on January 08, 2016, 05:39:54 PM
I'm getting there.
I realize code is very difficult to debug when you don't have the luxury of running it on your own computer in the software it's generating the error in, and being able to rapidly follow the string of interrelated errors.
I've had the "joy" of debugging Python code written in an earlier version and then run in a later version.   :|

Currently I seem to be having problems with the DuplicateShapeToSamePlace subroutine.
It looks like you have tmpshp1, tmpShp2, tmpshp, and InvoluteShp as variables, and I'm running into undefined variable errors and a failure to properly call the sub with the required arguments.   

I wish I was more familiar with VISIO's macro language, but right now I'm just hacking and butchering the code.  :)
I did however get it to mostly draw the involute curve(s), although they all look like they got rotated out of tangent.

I'll keep working on it.
Can you tell me how to edit the macro code and then save it, and how to clear the drawing page of the macro-generated involute so that I can save the VSD file and re-run the macro with the new edits?

Thanks!
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on January 09, 2016, 12:54:37 AM
Quote
how to edit the macro code and then save it,
I am using VBA editor belonging to Visio.

Quote
How to clear the drawing page of the macro-generated involute
I almost use undo button to delete shape made by macro.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: pdeepie on July 29, 2016, 12:40:51 PM
Hi Junichi,

Thank you for generating this tool, I have found it very useful.

Is it possible/easy to modify the VBA code to allow the tooth to be slightly narrower than the space, but the module remains the same. I wanted to use this to design a gear train for a wooden gear clock. It has been suggested that the tooth is about 0.02" to 0.03" smaller and then add that distance back to widen the space.

Many thanks for your feedback.

Pete
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on July 29, 2016, 11:26:23 PM
Is there any document theoretically explaining about the wooden gears you mentioned?
I simply feel that there is no change other than a little delay of angle of rotation.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: wapperdude on July 29, 2016, 11:56:09 PM
If I had to make a guess, for wood gears, a tight fit might be a problem.  The change requested will loosen the fit, resulting in more backlash.  Otherwise, the teeth might bind and break off.  Just a guess.

Wapperdude
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: pdeepie on July 30, 2016, 09:45:47 AM
Hello

Thank you for your responses.

W is the measurement of the tooth and the space next to it, measured on the curve that defines  the pitch diameter, PD

Tooth width = (w/2) – 0.03"
Tooth space =(w/2) + 0.03"

Wooden gears cannot be as accurate so its sensible to make the tooth narrower than the space to minimise binding of the teeth.

Thank you
Pete
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on July 30, 2016, 11:33:39 AM
I ask you what will affect to normal gears?
I don't think you need any changes.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on July 30, 2016, 11:12:50 PM
Backlash?
Why you did not point me out the documents?
https://www.quora.com/What-is-the-backlash-in-gears-How-is-it-advantageous-or-disadvantageous
or
http://garysclocks.sawdustcorner.com/fancy-gears.html
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on July 31, 2016, 06:04:02 AM
One easy way is to use menus, shape operations/intersect.
1. Place a normal gear.
2. Place the same gear exactly on the other.
3. Rotate new one a small angle, for example 0.3 deg.
4. Execute this menu operations.
Title: Re: Multi Gears using SETATREF Function and Cell.Result Property
Post by: JuneTheSecond on August 01, 2016, 10:31:49 AM
By the way, I found that Operations functions in Visio 2016 are now very strong.
I am using Visio pro. for Office 365.
Such a complicated shapes in the picture below can be treated with menu Operations/Fragment.