Author Topic: Flywheel builder (software)  (Read 16309 times)

Offline tinglett

  • Full Member
  • ****
  • Posts: 255
  • Rochester, MN, USA
Flywheel builder (software)
« on: June 24, 2015, 04:09:22 AM »
I'm mulling around trying to think of where I should go with this.  I know Marv has a website with a pile of software, and there are no doubt others.  When I was creating the flywheel for my pottymill horizontal engine I got particularly interested in software to assist designing flywheels.  And, as I'm into software for a living, but only get to do architecture work these days, I took the opportunity to write a little fun code :).

All I've got so far is a tool for flywheels.  Nowhere near what Marv has.  I decided I wanted it to be a bit interactive, though, and I wanted it to be graphical.  That is, I really wanted to be able to visualize what I was about to create without having to go to the drafting board to draw it up.  That's how this got started.  Add to that was the fact I didn't really want to write a full app, but I did want it to be usable offline.  So I cooked it up as a standalone web page with javascript.  I'm actually quite amazed at how well it works.  The web has come a long way since I did a pile of work with it in the mid 90's.

Ok, enough talk.  Here is a screen snap of what it looks like so you don't need to actually run it:



Right now you have to pick the number of spokes from the little pulldown box (I offer 1(!) to 9), and you need to type numbers in the little boxes to adjust things.  The flywheel instantly redraws when you tab out of a box.  I'd like to make everything drag/drop, and I'll do that, but right now I want it to produce the "right stuff" for machining a flywheel.  I'll add the snaz later.

I've only tested it in the chrome web browser (both Windows and Android work fine).  It works with Internet Explorer 10, but the dotted lines will be solid (from what I read this is fixed in IE11 which I don't currently have).  Haven't tried Firefox, Safari, or other browsers.

Also note that it'll let you type nearly anything and create flywheels that don't make sense.  At the moment I find that rather amusing, but perhaps at some point I should at least highlight that an error exists.

Anyone dare to try it?  I don't have a website to stick it (too bad, that would be easy), but I will attach it here.  Just download and open it in the browser (i.e. drag/drop it onto your browser and it will open).  Internet Explorer will ask if it's ok to run.  For any software folks out there, feel free to browse the code and make suggestions.  It's smaller than you think.  For everyone else, I'm really looking to see if this is useful to anyone, and what you'd really want to see it do.

Todd

P.S. if you want to try this on your Android phone or tablet, the URL will be something like file:///mnt/sdcard/Download/FlywheelBuilder.html  It's more tricky to open since you don't have drag/drop.  I'd expect it to work on an iphone, too, but have no clue how it handles security (i.e. is it ok to run javascript from a downloaded file?)

Offline smfr

  • Full Member
  • ****
  • Posts: 1203
  • San Francisco Bay Area, California
Re: Flywheel builder (software)
« Reply #1 on: June 24, 2015, 05:02:17 AM »
This is great, and I'm very glad you wrote it with web technology! I think we could build up a nice collection of web-based tools like this, maybe translating Marv's tools one by one (if he's OK with it).

I've done something similar, but to study valve mechanisms: http://smfr.org/sim/joys-valve-linkage/ and http://smfr.org/sim/single-cylinder/.

Simon

Online sco

  • Full Member
  • ****
  • Posts: 1693
  • Location: Northants UK
Re: Flywheel builder (software)
« Reply #2 on: June 24, 2015, 06:42:01 AM »
Todd,

Works just great on Firefox on my Android phone.

Nice work!

Simon.
Ars longa, vita brevis.

Offline vcutajar

  • Full Member
  • *****
  • Posts: 2555
  • Marsascala, MALTA
Re: Flywheel builder (software)
« Reply #3 on: June 24, 2015, 01:27:14 PM »
Todd

It is working on Internet Explorer 11 (with dotted lines) and also on Chrome.

I tried it on the IPad and said "Your browser does not support the canvas element. Sorry, this web page won't work for you."

Still haven't figured out how to use it though.

Vince

Offline chucketn

  • Full Member
  • ****
  • Posts: 399
  • East TN, USA
Re: Flywheel builder (software)
« Reply #4 on: June 24, 2015, 01:47:55 PM »
I like it. I saved it to my desktop and it opened in IE11 just fine. Only problem I have is when I printed the results, it wasn't to scale. 4" diameter came out as 4.75Can that be fixed? I would like to print the result to use as a template on the blank.

Chuck

Offline kvom

  • Full Member
  • *****
  • Posts: 2649
Re: Flywheel builder (software)
« Reply #5 on: June 24, 2015, 02:15:09 PM »
Now to be extra neat provide a DXF export!   :ThumbsUp:

Offline tinglett

  • Full Member
  • ****
  • Posts: 255
  • Rochester, MN, USA
Re: Flywheel builder (software)
« Reply #6 on: June 24, 2015, 02:45:06 PM »
Wow, thanks for the quick feedback!   Good to know it's already working in some browsers, though I need to figure out what's happening on that ipad.  I wonder if it isn't opening in a full web browser (whatever that might mean).

I hadn't thought about producing scale printouts, though I have been careful to try to keep it on a single page so you can print it and bring all the numbers into the shop.  It's possible I could create a "Printer Friendly Version" button that produces that printable version.

I had thought about DXF and a friend already suggested it might produce G-code if it had a little more data about the z-dimension.  I don't think those are crazy ideas...they'd just take time as I don't know either format.

What about the data its producing?  Maybe I should carefully write instructions as to how it is machined using this data.   I have pictures in my pottymill engine build log, but it didn't refer to this sheet.  That might scare something out.  I don't recall needing anything that wasn't on the sheet.

I do want to add some interactive features so you can drag things around.  I also want to add dimensioning lines in the picture, though I might have it draw a second picture so it doesn't get too busy with numbers (or a button to hide/unhide the dimension lines).

The big kahuna feature I want to add is the ability to do curved spokes.  Does anyone have experience with this?  I think I can figure out the math, but am wondering what really needs to be adjustable.  At the moment I'm imagining it holds the hub still while you twist the rim and it curves the spokes to make it fit.  But this may mean I need to allow more flexibility with the hole sizes.  If I recall, Marv's FLYWHEEL assumes 3 holes, and I already expanded that to 4.  I only allow two hole sizes, though, and this may need to be expanded to allow specification of each hole size for all four holes in the web.  That's getting complicated for a user to understand.

Todd

Offline tinglett

  • Full Member
  • ****
  • Posts: 255
  • Rochester, MN, USA
Re: Flywheel builder (software)
« Reply #7 on: June 24, 2015, 02:54:19 PM »
This is great, and I'm very glad you wrote it with web technology! I think we could build up a nice collection of web-based tools like this, maybe translating Marv's tools one by one (if he's OK with it).

I was thinking that's the goal, but Marv is a tough act to follow.  I bet all those programs weren't developed in a day, or a month, or a year! :)  But it would be nice to have a place to organize tools, especially if they can work in-place right off the website.  That's partly what kept me from posting this code.  I wasn't sure if attaching it would work so well for anyone.  I really need a website for it so all you need to do is click and use it.  That site may as well host other related tools, especially if they work roughly the same way.  But I'm not too excited to actually *run* a website :(.

BTW, I tried to carefully write the math so that little javascript knowledge is needed to follow it.  If you know some programming language slightly, it should be sort-of comprehensible.  I noted that Marv did this (at least in FLYWHEEL) and found it valuable as the math might be extracted for some other use or other language down the road.  In the end I decided to do the math in a very different way from Marv's, but the idea of separating the math was a keeper.

Todd

Offline mklotz

  • Full Member
  • *****
  • Posts: 2623
  • LA, CA, USA
    • SOFTWARE FOR PEOPLE WHO BUILD THINGS!
Re: Flywheel builder (software)
« Reply #8 on: June 24, 2015, 03:26:27 PM »
This is great, and I'm very glad you wrote it with web technology! I think we could build up a nice collection of web-based tools like this, maybe translating Marv's tools one by one (if he's OK with it).

I'm perfectly OK with that.  As far as I'm concerned the software on my page that was written by me is a contribution to the hobby and folks may use it in any way that helps them or others.  That's why the source code for any software written by me is included in each distribution archive.

Todd,

A convenient mathematical approach to defining curves of the type seen in curved-spoke flywheels is to use three point Bezier curves.  Such an approach allows one to smoothly and continuously alter the shape of the spoke through an infinite range.

However, the real task with such spokes is to define where to drill the holes that define them and provide the user with a simple machining schedule to use in producing them.

Another program feature that may be of use to some users would be an approximate estimate of the moment of inertia of the flywheel using a unity density for the material.  This would allow users to compare the moments of two designs of interest.  Not a biggy but something to think about in the shower.
Regards, Marv
Home Shop Freeware
https://www.myvirtualnetwork.com/mklotz

Offline tinglett

  • Full Member
  • ****
  • Posts: 255
  • Rochester, MN, USA
Re: Flywheel builder (software)
« Reply #9 on: June 25, 2015, 01:21:23 AM »
Simon,

Finally got a chance to look at your joy's valve linkage and single cylinder simulators.  Absolutely most cool.  We definitely need to collect these at some point.

Marv,

I was initially thinking Bezier curves, but I'm unsure how practical they would be to machine.  You've clearly done some human assisted machining in the past, and perhaps schedules of cuts would do the trick.  But I was thinking my first crack at it might be a bit of a cheat and I'd instead produce two arcs to connect the holes.  That means it would be limited as to what it could produce, but they might still look good enough that you wouldn't think twice unless you were trying to match some photo.

Todd

Offline b.lindsey

  • Global Moderator
  • Full Member
  • *****
  • Posts: 13860
  • Dallas, NC, USA
    • Workbench-Miniatures
Re: Flywheel builder (software)
« Reply #10 on: June 25, 2015, 01:51:23 AM »
Might I suggest a topic in the supporting section under plans and drawings which could be made sticky so as to remain at or near the top of the section.  Something like "Design Programs and Aids."  Don might wish for his various excel worksheets to reside there as well though that can be his decision. Let me know and I can set it up.

Bill

Offline Bearcar1

  • Full Member
  • ****
  • Posts: 829
  • Chicagoland Area, USA
Re: Flywheel builder (software)
« Reply #11 on: June 25, 2015, 03:06:06 AM »
Todd, I am running Safari 6.1.1 and it appears to work correctly. I have not played with it to and length but have changed a few of the dimensions and the graphics do respond. This is a pretty slick little file. Thank you and keep up the good work.  :ThumbsUp:


BC!
Jim




**** NOTE **** edit…. I own an HTC ONE M7 which is an android based device and I just download the file and when I went to open it got the response "your browser does not support the canvas element……. sorry the web page won't work for you" Am I doing something wrong, I am not a high level computer literate. :(
« Last Edit: June 25, 2015, 03:25:15 AM by Bearcar1 »

Offline smfr

  • Full Member
  • ****
  • Posts: 1203
  • San Francisco Bay Area, California
Re: Flywheel builder (software)
« Reply #12 on: June 25, 2015, 04:50:30 AM »
**** NOTE **** edit…. I own an HTC ONE M7 which is an android based device and I just download the file and when I went to open it got the response "your browser does not support the canvas element……. sorry the web page won't work for you" Am I doing something wrong, I am not a high level computer literate. :(

No, you're not doing anything wrong. Your HTC must have a really old version of Android that doesn't support all the features that modern web pages can make use of.

Simon

Offline tinglett

  • Full Member
  • ****
  • Posts: 255
  • Rochester, MN, USA
Re: Flywheel builder (software)
« Reply #13 on: June 25, 2015, 04:54:11 AM »
Jim,

The first thing I probably should know is what browser you are getting under android.  Then I could do a little checking to see why canvas isn't supported.   Rather than have you dig, I'll figure out how to add the browser name and version to the error message so it's easy to report.  I knew this would be a weak spot going with html, javascript and canvas.  Overall the combination seems well supported, but there may be older versions of systems out there that don't handle it.  I'll try to add this reporting tomorrow and post an update to try.  That'll be useful for the same error on the ipad, too.

I should also get this out on the web somewhere.  I was thinking some free space like github for developing it, but it would be nice if the URL were short and memorable so you don't even need to bookmark it.  I thought of modelenginemakertools.com if that doesn't bug anyone here (memorable, though maybe not as short as someone on a tablet/phone would like).  But honestly, I haven't setup a web site in over a decade so I'll have a lot of learning to do.  I'll need to find some cheap service to host it.

Bill,

A sticky post would be useful for pointing to design tools.  I can dream of a collection of tools all in the same space, but that'll only happen in bits and pieces.  A topic like that can help to glue them all together for the MEM folks.  I'm not ready quite yet, but I'll holler when it's useful for me.  It might be useful for others right now.  Point to Marv's stuff, of course, maybe Simon's if he wants, and Don's spreadsheets if he wants.

Todd

Offline tinglett

  • Full Member
  • ****
  • Posts: 255
  • Rochester, MN, USA
Re: Flywheel builder (software)
« Reply #14 on: June 25, 2015, 04:59:51 AM »
BTW, I should say with certainty that old versions of systems certainly won't work.  But it would be nice if I could say where the lines are so you'd know if that's the problem or if it's something else.

Android 2.3, which is getting pretty crusty but for which phones still work fine, would most likely be one of them.  But newer Android's should be ok, I would think.  I'm hoping this won't be a big deal.  I doubt if phones will be that important, but tablets are commonly replacing laptops and I can easily see using one in the shop to replace paper.  But worse case, I was hoping you can print the paper sheet and use it as a guide in the worst case.  Many will probably prefer that.  Save it with the prints for the engine.  That, of course, assumes you are using paper prints.  You might be viewing a pdf on a tablet :).  If you don't do that now, you might find yourself doing it in 5 years.

Todd

 

SimplePortal 2.3.5 © 2008-2012, SimplePortal