Engine speed governor
rogerfries
Posts: 11
I'm totally new to the world of micro controllers. I do have a programming background and some electronics knowledge. I still have a whole bunch of reading to do on this topic, but I was hoping for some direction.
My project, I have a massive log splitter that I built from scratch It works great except for the engine speed governor. It's the normal belt driven mechanical kind where you set the RPM and it holds it at that RPM. This is fine except that while I'm moving a log into position I want the machine to go 600 RPM Idle then when I hit the lever I want it to jump up to about 2,500 RPM and hold (with a variable engine load) while I'm splitting then go back to idle 30 seconds or so after the split lever is released. This will save fuel, noise and hydraulic temperature. This is significant as it's a 300 CI 6 cylinder engine moving 55 gallons per minute of hydraulic oil. It will also have a hydraulic generator on board which will require precise RPM while it's generating power to maintain 60 Hz. I'm not yet sure what that RPM will be.
So basically I want switches to control 3 selectable RPM's (Idle, Split and Generate). I already have switches mounted on the split lever, I plan to use a gear tooth sensor on the flywheel to determine the RPM and a servo of some type to adjust the engine speed. How difficult is this to achieve with the propeller? What's the beat way to determine the current RPM? I was thinking I'd count the pulses from the gear tooth sensor over say a 1/10 of a second divide that by the number of gear teeth and multiply out to get the RPM, or is there a better way?
Any head start you can give me will be much appreciated!! Again I'm totally new to this.
Here is a video of the machine in action if your interested:
http://picasaweb.google.com/lh/photo/HtEPqyO_BAQaOe0E441Xqg?feat=directlink
Here is my photo Album for this machine.
http://picasaweb.google.com/Roger.Fries/Splitter2002?feat=directlink
Thanks!
My project, I have a massive log splitter that I built from scratch It works great except for the engine speed governor. It's the normal belt driven mechanical kind where you set the RPM and it holds it at that RPM. This is fine except that while I'm moving a log into position I want the machine to go 600 RPM Idle then when I hit the lever I want it to jump up to about 2,500 RPM and hold (with a variable engine load) while I'm splitting then go back to idle 30 seconds or so after the split lever is released. This will save fuel, noise and hydraulic temperature. This is significant as it's a 300 CI 6 cylinder engine moving 55 gallons per minute of hydraulic oil. It will also have a hydraulic generator on board which will require precise RPM while it's generating power to maintain 60 Hz. I'm not yet sure what that RPM will be.
So basically I want switches to control 3 selectable RPM's (Idle, Split and Generate). I already have switches mounted on the split lever, I plan to use a gear tooth sensor on the flywheel to determine the RPM and a servo of some type to adjust the engine speed. How difficult is this to achieve with the propeller? What's the beat way to determine the current RPM? I was thinking I'd count the pulses from the gear tooth sensor over say a 1/10 of a second divide that by the number of gear teeth and multiply out to get the RPM, or is there a better way?
Any head start you can give me will be much appreciated!! Again I'm totally new to this.
Here is a video of the machine in action if your interested:
http://picasaweb.google.com/lh/photo/HtEPqyO_BAQaOe0E441Xqg?feat=directlink
Here is my photo Album for this machine.
http://picasaweb.google.com/Roger.Fries/Splitter2002?feat=directlink
Thanks!
Comments
cool machine. Does the hydraulic have enough power to split it into six pieces at once?
Welcome to the forum and the propeller-world.
Very good introduction telling right in the first posting what your knowledges are.
(Most new users do not include such info)
Surely the propeller-chip can measure and control the rpm
As this is a machine that is used under rough conditions the rpm-measuring should be very robust.
With the hardware-counters of the propeller-chip a precise measuring of frequencies is possible.
There are pre-programmed code-modules (called "objects") in the object exchange
for
- measuring frequencies
- controlling standard RC-servos
and a lot of more things.
Most work of the coding is done but you still need a basic understanding of the programming-language SPIN
to use these objects.
If you start the forum-members here will help you.
You will get a lot of help if you ask concrete questions and include your programs as attachments
You can ask as many questions as you like as long as we (the other forum-members) can see you made a try on your own and are now stuck somewhere.
As you are new to microcontrollers at all I would recommend to start working through the PE-Kit Labs to get a basic understanding of SPIN
In parallel you can play around with the demos delivered with the several objects.
Two very usefuls things are the FullDuplexSerial-driver which you can use to send debug-info back to the PC using the same cable as for programming the propeller-chip
an alternative is the EZLog.EXE from www.hannoware.com with which you can watch and even log the values of variables almost in realtime while your program is running
on the propeller.
best regards
Stefan
Yes this absolutely splits 6 ways at once, if the video link works you need to see the video to fully appreciate how good this actually works.
I'll start searching on measuring frequency. I had been searching on tachometer & RPM without success. Perhaps frequency is the correct electronics term.
I definitely want to start with test projects. The only problem is the proto board I purchased has only solder connections, so I'm a little hesitant to mess it up. I should have bought one of the ones with the solderless breadboard. Perhaps I should buy one of those for testing. I have a bunch of other uses for micro controllers once I get the hang of it. I hear there is a propeller 2 coming out. Need to look into that also.
Thanks!
Propeller Protoboard Designs for the Beginner
Frequency is a more formal term - from radio. But since frequencies go way beyond your useful range, you might find a 'pulse counter' rather than a 'frequency counter' offers a more useful example.
To hazard a guess - 2500 RPM on an 8 cylinder 4 cycle engine would be 8000 pulse ( 2500x8x4), but I could be wrong about how to factor in 4 cycles.
Unless I'd missed it being mentioned, also look at AN001, an app note on the Prop counters. Sometimes it doesn't explain quite enough, but does help get on into each of the options on the counters.
do you have a link to the sensor that you will be using.
I plan to use Digikey part# 620-1326-1-ND. This was recommended by a friend who knows something about this stuff I did not pick it out so there is a good chance it will work, but if I need to use something else no big deal. I just want this thing to be perfect. As I always say, my budget is: "As little as possible, but as much as necessary"
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=620-1326-1-ND
I also like the idea you sent about adding the pin headers. Too bad Radio Shack does not have hardly any parts anymore. I'll have to mail order the pin headers, Gerrrr.
Thanks to you all! I've added the other suggestions to my required reading list. I have next week off hopefully I can get through some of the reading
Here is one suggestion that I would do for the engine governor and that is have an mechical overspeed governor to electriclly connected to shut down down the engine, when the engine overspeeds. I have this feature for my Detriot diesel genset, which uses a Woodward speed control on a old ship that I am helping to restore.
I don't know if i would use that sensor for the actual RPM sensor due to it being used in a outside and messy environment. I would look for a chevy crank or cam sensor they are 5 volt sensors usually or look at this one from Jameco.
http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_512401_-1
it would be easy to mount into a simple L bracket and is 5 volt tolerant and not to pricey.
One question how much force does it take to pull the throttle open on your motor? If you can measure it or it very light then a hobby servo might be able to control it.
Also if you are just trying to maintain the hydraulic pressure would you not want to control the motor based on how much PSI your hydraulic pressure is?
RPM control might be a stable enough control to maintain the pressure you just need to try it and see.
Here are a few object from the OBEX that might get you started.
http://obex.parallax.com/objects/98/
http://obex.parallax.com/objects/387/
Also look for the Count pubs in the link below
http://obex.parallax.com/objects/30/
Hope this helps..by the way I love the machine.
One additional point - Frequency is measured in cycles per Second and RPM is revolutions per Minute. Regardless of how you take off a reliable pulse, the Propeller is fast enough to count just about anything the engine can put out.
While there are hardward counters (two) on each Cog of the Propeller, it might actually be easier to creat a software counter for a first effort. Many hardware devices can be emmulated in software if the processor runs at a fast enough rate. And often, the software model is easier to first understand.
Might I suggest a test bed take your sensor and use a variable speed drill to spin a gear or sprocket and then read that first, then wire a RC servo and then watch as you speed the drill the servo should react to the change.
The best way to monitor RPM on a engine that, you have is to use a Hall Effect switches. They are used on car engines to do same thing that you are wanting to do.
Now, for the speed control part. They make electrically controlled throttles for your engine and I know this because our Detriot genset has one on it. Make sure that you adjust it so the engine cannot go in a overspeed condition. I don't think you want to kill your engine.
Great project, I am actually working on something very similar.
You may find some code that supports this one more easily but I don't know if it will respond fast enough for your application. Maybe someone with some experience with this device can answer that.
Welcome to the forum, best of luck, and keep us posted.
Peter
As RPM decreases the accuracy decreases with a fixed time interval for measurements. For instance, at 600 RPM the output is 10 pulses per second or one pulse per 0.1 second, and only 10 pulses per 0.1 second at 6000 RPM. Increasing the time per reading increases the accuracy but has the effect of making the response to a change in speed much slower.
Counting the number of clock cycles of the propeller clock (at 80MHz) per revolution results in a count of 8,000,000 at 600 RPM and 800,000 at 6000 RPM. This provides a more accurate speed measurement and allows for a much faster response to a change in speed.
I can say it is vary good idea and sounds like a reliable one.
http://en.wikipedia.org/wiki/Nyquist_stability_criterion
It seems you are getting way over the top with high resolution measurement of RPM at 8000000 counts per second or per minute. Please sort out what you are counting in minutes and what you are counting in seconds.
From what I do understand, you can use a Hall Effect Sensor and a single neodymium magnet affixed to either the fly wheel or the pulley on the front of the engines crankshaft in order to count merely each revolution. And sure, you can add more magnets to gain higher resolution - but I really wonder why.
Can a propeller reliably read 8,200 pulses per second?
I really like the idea of mounting magnets at the pump coupling. This would help if/when I decide to change the engine to a diesel.
I feel I need the extra resolution because this engine does see varied load at idle. This machine is self propelled so when I maneuver it usually I do it at idle speed as this is no Corvette. I could I suppose make a star wheel with a bunch of teeth and press it onto my lovejoy coupling then I can decide on a more reasonable number of teeth. I have a CNC milling machine so making a custom gear is no big deal for me.
As for toyota servo, it would certainly be a quality part, but sounds expensive and I don't think I need feedback. Iny idea why I would need or how I would use the feedback?
I also like the idea of measuring the time between the teeth rather than counting the number of teeth over time.
I'm sure there are some nice industrial controls just for this, but this is more fun and I learn something in the process.
Thanks you all! there are a lot of great ideas here
All day long.
Have a look at the following object in the OBEX. I use this object to measure engine and vehicle speed all the time: http://obex.parallax.com/objects/479/
For the measurement of speed by the number of Prop clocks between gear pulses, at 3,000 RPM or 8,200 pulses a second there would be 121.95 uSec between the start of each pulse. In that time the Prop counter would count 9,756 clocks at 80 MHz and at lower RPM the count would be higher so no problem with resolution or accuracy.
Regardless of what method you use to measure speed you will have to take in to account the inertia of the engine itself. No matter how much you change the throttle position, it will take time for the engine RPM to stabilize for that load/throttle setting. You will need to do some experimenting here, but I expect the change in throttle position will need to be proportional to the difference between the actual and set RPM.
The senors and rings part numbers below are from a corvette crank the rings press on the crankshaft so all you would need to do is attach them close to your lovejoy coupling. These are made for an automobile and should handle the vibration and weather you will have your machine in. The a ring and senor from either year are both only about 40 to 50 dollars and would be a time saver over machining your own. And the propeller can read either one and easily. 58x ring at 4000RPM is only 232000 pulses per minute which is 3867 pulses per second. Now if you want to update your throttle 10 times a second then that is 387 pulses that you would have to read each 100 milliseconds and then make a change.The prop can handle that easily. Also you can use a stepper motor to control the throttle ( Dodge uses steppers on their EFI Idel air controls) most of the time you can find a larger stepper for less than a large servo. The hobby servo might be able to control the throttle though. Look up a local hobby shop and see if they have any used servos my local shop has them buy the dozens for cheap.
http://www.gmpartsdirect.com
From a 97 to 03 year vette
12559353 wheel 24x 24teeth on ring
12560228 sensor 24x
From a 04 up year vette
12586768 58x ring 58 teeth
12585546 58x sensor
Just rest assured that the Propeller can easily count and calculate the RPM from all the pulses that you are likely to throw at it.
Some decisions have been made. I am going to use a gear tooth sensor suggested by bennettdan because of it's nice adjustable mount.
http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_512401_-1
I am going to make a gear and press it on to my lovejoy pump coupling as suggested by yarisboy. This is a very easy place to modify and much easier than trying to work with the bell housing. This also totally divorces this from the engine which probably will change soon as soon a donor is located.
The GM gear suggested is a good idea and it's cheap, but I can't find any dimensions for it. I may spend more time modifying this gear than just cutting my own. Any suggestions on how many teeth I should put on my gear? My thought is the more the better, but it seems like it really does not matter.
Now I just need to start wiring this thing up and learn Spin.
I'm going to start with this program that AJM linked in.
http://obex.parallax.com/objects/479/
It seems programming the PID logic is going to be where the real challenge is after trying to read http://en.wikipedia.org/wiki/Nyquist_stability_criterion posted by Loopy Byteloose I needed a drink. All of those formulas are over my head.
I'm going to start experimenting by adding the pin headers to my proto board as suggested by Cole Logan.
http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beginner.pdf
Thanks all. Many good suggestions in this thread even the ones I'm not using right now may get used on my next project.
Happy Holidays!