Author Topic: CamCalc. The weird lobe-calculator  (Read 27787 times)

Offline MuellerNick

  • Full Member
  • ****
  • Posts: 213
  • Germany // Outback of Munich
    • Motor-Manufaktur
CamCalc. The weird lobe-calculator
« on: September 24, 2013, 09:46:39 PM »
Hi!


Since many years, I'm interested in the theory of cams (the lobes to be prices). I have written some programs for my own use.
About a year ago, I came up with a distinct way to calculate lobes. I couldn't find any references about my way. Only one, that was just half of my solution.
But thinking about programming it, I decided that it will be too much time-consuming.
So I gave up programming that.


Just last Saturday, I stumbled over a programming-environment, that seemed to offer some of the building blocks I would have needed. So on Sunday, I started programming. This evening, I finally got that crap running (the language is quite weird).
The result is quite crude and basic. It still is waaaaay off of my initial idea.


But, I decided to share my result with you. At least as it is now, it is of some help.


The language chosen is Pd or Pure Date. This is an environment for programming music, videos and Midi. Not exactly a match for physics and mathematics. hahaha.
BUT! The environment is free. Have a look at www.puredata.info and download the Pd-extended version.


So first, you need some instructions how to use my crap:
In the upper left, you'll find boxes (for numbers) named:
h (the lift)
Theta (the timing angle)
R (the base circle's radius
and rs (the tip radius)
These are the only fields where you have/should enter values (one more field later).


You enter values by clicking the box, typing the value and then hit return. Or you click inside and drag the value up/down (pressing shift changes the decimals).


Obey the field "resulting chest radius". Its value must be positive!


Now, you can play with your values to get a harmonic lobe.


In the topmost line, in the middle, there is a box titled "Cam angle". When you drag-change its value from 0 to 360°, you will get a (jaggy) plot of the lift. Currently, it will clip lifts above 6 mm. And the plot looks a bit crude. Think I'll make a loop around the math that will update the plot completely as soon as you change values.


Well, that's it for now!


Feel free to make the most nasty comments you want. I know, this is a sketchy hack.


Nick
PS: I have no clue wether up/downloading works. I'll hear! :)

Offline MuellerNick

  • Full Member
  • ****
  • Posts: 213
  • Germany // Outback of Munich
    • Motor-Manufaktur
Re: CamCalc. The weird lobe-calculator
« Reply #1 on: September 25, 2013, 06:16:49 PM »
Found quite some bugs. The language is too weird for me. But I'm trying hard.  :LittleDevil:


Here is a better version:
You no longer can slide the cam angle to get the graph. That only made a mess if you weren't sliding really slow. Now there is a button to click ("Click here ..."). And then you get lift, speed and acceleration. Haven't found a nice way to scale the graphs properly, so it will shoot out of the box sometimes.


Also cleaned it up a bit (and added more mess).


To be able to calculate speed and acceleration, you need to enter the cam-RPM (so that is half the crankshaft-RPM, just as a reminder).


Plan is to actually output G-code to mill the cam. There are two ways to mill one:
* Milling axis parallel to the cam-axis (simple to generate a code)
* Milling axis perpendicular to the cam-axis (more complicated unless you want to cut air for an hour).


Still, comments are welcome. Anonymous downloaders without feedback will be banned!  :LittleDevil:
Nick

Offline smfr

  • Full Member
  • ****
  • Posts: 1203
  • San Francisco Bay Area, California
Re: CamCalc. The weird lobe-calculator
« Reply #2 on: September 25, 2013, 06:39:11 PM »
I haven't tried it, but I like the idea of sharing software that helps us compute machining-related stuff!

I think web technology is now at the point where most of the simulation/computation we need to do can call be done in a web page, for example my Joys Valve simulation: http://smfr.org/sim/joys-valve-linkage/. This makes it super easy for someone to play with it, and the code is easy to grab and modify. I'm not sure how good you are with JavaScript, Nick, but maybe I can help you convert your program to run in a web page.

Simon

Offline tangler

  • Full Member
  • ****
  • Posts: 834
  • Christchurch, UK
Re: CamCalc. The weird lobe-calculator
« Reply #3 on: September 25, 2013, 08:18:51 PM »
Back in 1990 Bob Washburn published a Basic program of mine to calculate harmonic cam profiles in Strictly IC.  Ron Chernich picked this up and re-wrote the program in a web friendly form http://modelenginenews.org/  "Resources Design Center".  I developed my program further in QBasic but as this interpreter disappeared from distribution with Windows I've written the program as an Excel spreadsheet.  For what it's worth I've appended it to this message. There isn't any VB component so it should download without issue.

Rod

Offline MuellerNick

  • Full Member
  • ****
  • Posts: 213
  • Germany // Outback of Munich
    • Motor-Manufaktur
Re: CamCalc. The weird lobe-calculator
« Reply #4 on: September 25, 2013, 10:22:14 PM »
I don't like JavaScript. And I don't like client-side-programming (that includes JS). Only server-side because that's what makes the crap more independent (tested on IE$blabla).
And I won't do any server-side-programming, because I forgot all that crap (Perl).


I compared my results to the ones on ModelEngineNews.
Well … Geometry is the same, but velocity and much more acceleration do differ. I assume MY results are wrong. I'll check … OH wait! I do calc in cam-RPM. As far as I remember, values do match.


Note:
The values are not for rocker arms (one of the next steps) but just for … um … howsitcalled? We call them cup-pushers. The lobe more or less hammers directly onto the valve stem.


New version (I should have done something real in my shop):
Now, you no longer have to trigger the calculation of the graphs. If you drag-change values, things get a bit sluggish (had to insert a delay for all values to be calculated).
Still, I din't find a way how to resize the graphs so they fit. At least not a way how to do that with variables, only hard-coded constants (that makes no sense to me).
Also cleaned up some more mess (and added a little bit more).


Nick

Offline AdeV

  • Administrator
  • Full Member
  • *****
  • Posts: 531
Re: CamCalc. The weird lobe-calculator
« Reply #5 on: September 27, 2013, 01:41:51 PM »
Note:
The values are not for rocker arms (one of the next steps) but just for … um … howsitcalled? We call them cup-pushers. The lobe more or less hammers directly onto the valve stem.

Overhead cam acting directly on the cam follower/tappet?

Do you include a clearance ramp in your cam profile? I've only just seen this thread & haven't had chance to look at/run your code yet; I'm just wondering if I may be able to use it on an engine I'm working on (not a model one...)
Cheers,
Ade
--
I'm just a poor old man. I have no time for law-breakers. My legs are grey. My ears are gnarled. My eyes are old and bent.

Offline MuellerNick

  • Full Member
  • ****
  • Posts: 213
  • Germany // Outback of Munich
    • Motor-Manufaktur
Re: CamCalc. The weird lobe-calculator
« Reply #6 on: September 27, 2013, 06:49:26 PM »
Quote
Do you include a clearance ramp in your cam profile?


Good point!
No, clearance isn't built in.
But it is the very next thing on my list of things to do.
As far as I have seen, the clearance ramp is left out in model IC-engines (I might be wrong). Basically, it is just a new circle a bit smaller than the base circle. I'll have to figure out the details, maybe this weekend.


How do you intend to mill the cam? In segments or with the spindle along the cam axis? For the later, a CNC is almost a must and you need to work with cutter compensation (makes the G-code simpler).


Nick

Offline petertha

  • Full Member
  • ****
  • Posts: 782
Re: CamCalc. The weird lobe-calculator
« Reply #7 on: September 27, 2013, 08:04:46 PM »
Be interested to see what you come up with Nick. I remember looking at some cam equations in an old engine design book a while back for (I think) harmonic cam profile generation, probably similar to what was posted here or Camcalc (which I never got to work properly on my PC). I dont recall though, is there any looping or math iteration/convergence type issues in developing the profile? Just wondering why plain old Excel would not satisfy the task assuming its crunching equations kind of linearly?

Sidenote: I'm in the process of drawing up a single cylinder design for myself as a starter IC project. I got looking at a bunch of model engine plans or reference & noted (so) many cams used simple [base circle / flat segment / nose radius lift] type configuration, generally running against a flat lifter. I have read pros & cons 'opinions' on cam profiles, ease of making vs. performance etc. So I just temporarily put the profile issue aside for now.

But a bigger mystery to me was how to phase intake/exhaust cams relative to each other. I compared designs & the timing seemed to vary all over the map despite similar engine types. I made a spreadsheet that considered these parameters. It spits out resultant cam phasing values, valve overlap, visual plot etc. I'm posting some screen caps as output example for now. I have to go back & check for boo-boos. Just providing a suggestion, maybe Excel could be considered for model cam design as its used widely?
 


Offline MuellerNick

  • Full Member
  • ****
  • Posts: 213
  • Germany // Outback of Munich
    • Motor-Manufaktur
Re: CamCalc. The weird lobe-calculator
« Reply #8 on: September 27, 2013, 08:19:17 PM »
Quote
I dont recall though, is there any looping or math iteration/convergence type issues in developing the profile? Just wondering why plain old Excel would not satisfy the task assuming its crunching equations kind of linearly?


There is no, or better, there is no need for looping. To get the profile, a few equations are enough. Only to get the plot needs looping.
For me, Excel is no software to use. Users would have to buy Excel and I certainly am not among their clients. I have tried a spreadsheet from OpenOffice for other tasks, and I quickly realized that it is just an accumulation of odd features good for ... not for me!


To avoid further confusion, I will have to rename my cam-calculator. CamCalc wasn't the most brilliant idea. ;)
CamBam also isn't a good one. :)
For now, I'll call mine KamKalk, so it sounds kraut-isch. But I hope to find a better name.  :Jester:


Nick

Offline petertha

  • Full Member
  • ****
  • Posts: 782
Re: CamCalc. The weird lobe-calculator
« Reply #9 on: September 27, 2013, 08:58:49 PM »
For me, Excel is no software to use. Users would have to buy Excel and I certainly am not among their clients.

I suppose cost always plays into the decision issue. I use MS-Office every day at work & at home. My kids learn it in school. Now I see its bundled on tablets. If you use it at work, chances are very good you can get a highly discounted home licence, mine cost me $13. Looks like the full Office suite (Excel/Word/Powerpoint/Access) goes for 100-150$ depending on vendor & version.

http://www.amazon.com/Microsoft-Office-Student-1User-Download/dp/B00B1TGUMG/ref=sr_1_1?s=software&ie=UTF8&qid=1380310057&sr=1-1&keywords=microsoft+office

Kind of off topic, but since we are discussing 'hobby expenses'... I finally cracked & decided to buy a certain Bison chuck that I 'needed'. Altough already too expensive for my liking, I then discovered the current price was ~38% higher than catalog price from last year. I asked the dstributer why & they cited 'rising manufacturing costs in certain eastern block countries' . After confirming other distributers, I violated the piggy bank some more & made the purchase. Tools are an investment, right? Chuck was delivered, very nice. Then I noticed manufactured date stamping: year 2009! Apparently these items age like fine wine sitting on a storage shelf.
 :old:

For now, I'll call mine KamKalk, so it sounds kraut-isch. But I hope to find a better name. 
Nick

My surname is Thannhauser, I'm not offended :)

Offline MuellerNick

  • Full Member
  • ****
  • Posts: 213
  • Germany // Outback of Munich
    • Motor-Manufaktur
Re: CamCalc. The weird lobe-calculator
« Reply #10 on: September 29, 2013, 02:29:08 PM »
New version.


Added the clearance-thing:
You need to enter the clearance (labeled "clearance", now that makes sense!) and the clearance-angle. That angle is the length of the clearance-ramp (in degrees, obviously).
This results in two new values:
* New base-circle radius reduced by the clearance (the plain base-circle still is the mayor design-value and used for calculation of speed, lift etc.)
* Radius of clearance ramp. This radius joins the base-circle w. clearance and the flank-radius. These three radii are (as always) joined with a constant tangent.


Added a feature, that the number-field for the flank-radius (rho) gets red when it is negative. That works, but you'll get warnings that the field doesn't understand "color". Maybe it gets red because it gets so upset about that message?
Pay attention, the radius of the clearance ramp has to be positive too. I think it is always positive, as long as the flank radius is.  :thinking:


Also removed most of the sluggishness and things still seem to work!  :whoohoo:


I will have to increase resolution of the diagrams (now 0.1°), as extreme acceleration-peaks simply get lost. You get that, if the flank is very short and the flank-radius is relatively huge (compared to the base radius). This happens with short durations (less than 120° or so; depends on other factors too).


Getting no feedback is motivating!  :rant:
Nick

Offline steamer

  • Global Moderator
  • Full Member
  • *****
  • Posts: 12697
  • Central Massachusetts, USA
Re: CamCalc. The weird lobe-calculator
« Reply #11 on: September 29, 2013, 03:51:13 PM »
Hey Nick

Sorry.....just haven't had time.....

I've used the Modelenginenews program and it works well.....but I don't program.

but I am interested the results!

Watching.......

Dave
"Mister M'Andrew, don't you think steam spoils romance at sea?"
Damned ijjit!

Offline AdeV

  • Administrator
  • Full Member
  • *****
  • Posts: 531
Re: CamCalc. The weird lobe-calculator
« Reply #12 on: September 29, 2013, 08:02:50 PM »
Hi Nick,

Cool!! I haven't had a chance to look at it (either version!!!) yet, but then I am only just starting down this particular road...

I'm hoping to make my own cams for a racing car engine (Jaguar V12), which has 2 single overhead cam heads. I don't yet know how I'll make them; probably rough them on a CNC lathe, harden, and do a final grind on a CNC grinding machine - both of which I have to find & purchase...

I have a million other things to learn/do as well, so it might take me a while to get around to it - I have allowed myself 2 years to do this project.

BTW, for a name, how about Camtastic?
Cheers,
Ade
--
I'm just a poor old man. I have no time for law-breakers. My legs are grey. My ears are gnarled. My eyes are old and bent.

Offline MuellerNick

  • Full Member
  • ****
  • Posts: 213
  • Germany // Outback of Munich
    • Motor-Manufaktur
Re: CamCalc. The weird lobe-calculator
« Reply #13 on: September 29, 2013, 08:24:37 PM »
Quote
Camtastic


Great name!
But it is a "bit" of an exaggeration for the software. At least in its current state.  :???:
Major point is the user-interface. Or better almost complete lack of it. There is a simple way ahead. At least, that will remove all the boxes and lines that do make no sense to a user. This will be one of the next steps ...


Currently, I'm removing clutter and still trying to size the graphs.


Nick

Offline MuellerNick

  • Full Member
  • ****
  • Posts: 213
  • Germany // Outback of Munich
    • Motor-Manufaktur
Re: CamCalc. The weird lobe-calculator
« Reply #14 on: November 23, 2013, 06:00:44 PM »
Long time no hear.  :'(


I stopped development of the prototype with PureData. And switched to Tcl/Tk. My first program with that language and that toolkit. Tcl/Tk is not so bad!
At least, it promises that I can compile for Mac, Win and Linux. Currently, I'm just interpreting on a Mac. So I can only give you screenshots (see appendix).
The scaling of the graphs still is a bit of an issue (doesn't fit perfect, just almost perfect).
(Dynamic) resizing is an other issue.


Code generation still is completely missing, but I wrapped my head around it further more.


Now, I like the name "CamTastic"! Thanks for the suggestion!  :cartwheel:


Enjoy!
Nick

 

SimplePortal 2.3.5 © 2008-2012, SimplePortal