RPM sensing project...need assistance
llema
Posts: 10
Hello all,
I am new here. Just found this place. I have a project which consists of reading RPM of a 2-stroke engine's coil (grounding lead) and subsequently operating a common RC servo. The RPM range is 0-20000. I need the servo to modulate at certain RPM ranges. For example I want the servo to start to move (close a valve) at say 10000 and have it completely closed by the time it reaches 12000 RPM. The numbers are theoretical as testing will be required for optimal performance, but that is the basics of what I need to do. The model in which this is to be used will have an onboard 6.0v DC supply so that shouldn't be a problem.
Can someone point me in the right direction as the which controller I should be looking into and what would be needed as far as hardware addons to accomplish sure a project? You assistance would be greatly appreciated as I am a beginner here. My background is in robotics and industrial instrumentation, but in all honesty I am a little rusty and these new controllers are all new to me! [noparse]:)[/noparse]
Thanks,
Marc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
Post Edited (llema) : 10/15/2008 3:05:27 PM GMT
I am new here. Just found this place. I have a project which consists of reading RPM of a 2-stroke engine's coil (grounding lead) and subsequently operating a common RC servo. The RPM range is 0-20000. I need the servo to modulate at certain RPM ranges. For example I want the servo to start to move (close a valve) at say 10000 and have it completely closed by the time it reaches 12000 RPM. The numbers are theoretical as testing will be required for optimal performance, but that is the basics of what I need to do. The model in which this is to be used will have an onboard 6.0v DC supply so that shouldn't be a problem.
Can someone point me in the right direction as the which controller I should be looking into and what would be needed as far as hardware addons to accomplish sure a project? You assistance would be greatly appreciated as I am a beginner here. My background is in robotics and industrial instrumentation, but in all honesty I am a little rusty and these new controllers are all new to me! [noparse]:)[/noparse]
Thanks,
Marc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
Post Edited (llema) : 10/15/2008 3:05:27 PM GMT
Comments
If so, you should be able to accomplish this will a transistor input hooked up to said ground. It could look something like this:
You may be able to gleen some info from this post:
http://forums.parallax.com/showthread.php?p=691869
I never got things working completely, but I did try that circuit above, and the LED did blink.
Let us know how you progress.
-Parsko
FTR, I have not chosen a controller yet...This is part of the assistance I need. What would be the best choice for this simple application?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
Not sure. It's a personal decision one must make for themselves that will depend on cost, ease of use, etc... All ucontrollers should do you fine for this kind of application. BUT, the Prop is one of the easiest, IMHO. Though, code may already exist for other ucontrollers out there to do just this. If this is your first ever ucontroller project, I'd recommend the Prop, as I think it has a great capacity for future upgrades and projects. But, a PIC, or Stamp, or whatever will do you just fine.
-Parsko
1) It's a powerful, fast microcontroller that's certainly capable of doing what you've stated
2) It can easily provide a display on a TV or VGA monitor of the various parameters used in your program like RPM, servo position, various calculated values, etc.
3) You could easily attach a PS/2 keyboard for setting parameters and controlling the experiments.
This and the display require minimal external components.
4) The Propeller is relatively new compared to the Stamps and many other microcontrollers.
It doesn't yet have the huge body of educational material available for the Stamps.
There are some very good tutorials provided for the Propeller Education Kit which are usable with most of the Propeller boards and modules.
There are some other tutorials on-line in these forums.
5) Conceptually, the Propeller is quite different from other microcontrollers since it has 8 independent processors with individual and shared memory.
This simplifies some otherwise very complex applications where several things have to be going on at the same time. In your case, one processor
would just be measuring RPM and another would just be controlling the servo. A third would be the main controller taking the RPM data and adjusting
the servo position based on whatever criteria you need. A fourth could be generating the video output and a fifth could be managing a PS/2 keyboard.
All of this could be done with a page or two of code (plus library routines for the video, servo, and keyboard) depending mostly on how fancy you want
the display and keyboard to be.
You might browse this and the Completed Projects forums. Some other people have described projects to control engines using RPM information.
Mostly they've been motorcycle engines. I don't have any links, but browsing should also give you some ideas about what can be done.
I was thinking about a similar project (so many ideas, so little free time) My idea was to use an inductive or magnetic type of sensor. Look at this Hall effect sensor for example www.parallax.com/Store/Sensors/PressureFlexRPM/tabid/177/CategoryID/52/List/0/Level/a/ProductID/90/Default.aspx?SortField=ProductName%2cProductName
In the automotive industry, this how RPM is measured, although your method my work, I see the Hall Effect sensor as a better way.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio - the modular Development system for the Propeller
PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!
SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
My application is for RC boats with 2-stroke gasoline engines. The "kill" or grounding lead from the PICKUP coil is commonly used to plug in an onboard tachometer such as a Tinytach, etc. Being able to simply plug into this lead would be SO much easier! Would there be any possibility of plugging this directly into the Propeller?
From what I gather so far I need to convert the pulse from the coil to a pulse that can be inputted into the Propeller...correct? Would the above circuit accomplish this?
I have been reading an awful lot on the propeller and trying to figure out how I could get this all done! Seems like it's doable but I don't know where to start!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
Post Edited (llema) : 10/15/2008 6:46:07 PM GMT
I basically spent all afternoon trying to find sample of RPM sensing projects using the Propeller and can't seem to find anything remotely similar to my project....if anyone cares to help out, please feel free to do so! [noparse]:)[/noparse]
Thanks for putting up with this newbie BTW! [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
There are a multiple ways of determining the motor RPM.· If this is a gas-engine with a coil, then you can use a product such as the "Stator Gator" that will output a single TTL level pulse for every pulse in the coil.· Every pulse in the coil corresponds to 1 revolution of the motor.· You can build your own inductive pickup, but the commercially available Stator Gator does a really nice job with gassers.· If you don't want to inductively read the pulse, then you can consider an optical pickup.· Use an IR transmitter / receiver module and focus the beam on any rotating part (flywheel, clutch, propellor shaft) and attach reflective tape to bounce the beam back.· In either case, your microcontroller would measure the time between the rising edge of the pulse train (for example)·to determine RPM.· I built on-board tachometers for RC Helicopters using these techniques.·
Controlling the servo based upon the RPM is fairly straight forward, and quite separate from determining the RPM.· You need to decide what your transfer function looks like that will be responsible for computing what the servo position should be for a given RPM.· You'll learn what this function looks like from testing.· I'm sure you have some ideas already.· In the end, your function will take an RPM value as input, and will compute a corresponding pulse width (1000us at one extreme, 1500us neutral, 2000us at the other extreme).· Another function can then use this value and drive the output for the servo.· On a PROP, you could use one COG to measure the pulse train from the RPM sensor and compute the RPM and servo position, and another cog to control the output of the servo.· I've done this on a larger scale for another R/C helicopter project.· The PROP is a great micro to use for this project, but you could certainly do it with very tiny and less expensive controllers.· I've taken both approaches for different products.· The PROP is an excellent piece of hardware and is easy to use.·
FYI - a standard·R/C servo needs a pulse every 20ms (50hz).· Your code needs to output a pulse of the duration you want, every 20ms, regardless of whether or not a change in position is desired.· There are objects in the object exchange which will drive servos.· I haven't used these objects, but they should provide a good starting point for you.·
Joel-
·
every journey starts with the first step.
As this is an electronical and software-journey you can start at different points
the starting point will be there where you would like to start
a.) this could be hardware: testing the circuit with an oscilliscope
b.) this could be software a little demo-program configuring an IO-Pin as input and then detecting low/high-level on the Pin
c.) asking a concrete question like
1.) "how can I measure RPM and display it somewhere for testing it"
1b.) can somebody post a commented little demo-program how to measure frequencies of 0-20.000 Hz ?"
2.) "is there any ready to use code for controlling a servo ?" answer: yes there is !
see the obex
obex.parallax.com/objects/search/?q=servo
this search-result could lead to another concrete question like "which servo-code would you recommend for my application ?"
In the Appication-note 001 there is a small democode for frequency-measuring
www.parallax.com/Portals/0/Downloads/appnt/prop/AN001-PropellerCountersv1.1.zip
It uses a VGA-display as output. But it will be very easy to change the output to a TV or a serial-connection
to a terminalsoftware on a PC
Some other objects from the obex that might be interesting as they do measuring times/frequenecies
obex.parallax.com/objects/276/
obex.parallax.com/objects/236/
obex.parallax.com/objects/98/
As long as you ask CONCRETE questions or ask for SMALL demo-programs I think the forum-members will
help a lot
best regards
Stefan
Post Edited (StefanL38) : 10/15/2008 9:13:51 PM GMT
If you need a display, use a Parallel LCD, not a slow Serial LCD. Plenty of code examples for that too.
Piece of cake!
Is it a Zenoah? (20,000 rpm is G260 range) or small bore·Kart or MX bike?
Post Edited (Capt. Quirk) : 10/15/2008 10:47:40 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
Joel-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
I·prefer using a Melexis Hall Effect Sensor ·on the output shaft side of the crank. A very small neodymium magnet super glued or jb weld to the collet within a small 1/8" x 1/8"·counter·sink. Mount the·hall·sensor from a single bolt·bracket from the 4 bolt·motor mount bracket.
Another way is like what Parsko recommended, it's similar to what I have seen in a few inductive pick-ups for small tachometers. Another way I have seen it done on timming lights and cars·is a spark plug wire going through a ferrite torrid similar to this· on page 29 & 32.
If you are interested in the ignition timming, I would use both methods. That way you can accurately measure the time between·ignition and TDC and not bother with a timming light and degree wheel.
Post Edited (Capt. Quirk) : 10/16/2008 7:21:36 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
http://www.parallax.com/Portals/0/Images/Prod/2/281/28195-QuadRover-v1.4.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
The attached image was taken from·page 9 of the PDF.· I was not the one that designed this circuit, but I will forward this post to him.· He might be able to provide more information such as how much voltage the magneto produces, so that you may compare that to the 10kv to 28kv·that you are seeing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.modelgasboats.com - The Online Magazine Devoted to Gas Powered Model Boats!
I don't remember for sure what voltage I was getting from the magneto on the GXH50 engine that the QuadRover uses, but I think it was around 5Kv. The 470KΩ and 220KΩ resistors form a voltage divider, the 3.3nF capacitor and 10KΩ resistor form an RC filter, and the diodes in the BAT54S clamp voltages less than zero or over 3.3 to protect the Propeller. I tuned the circuit by placing a scope probe where the I/O pin would go (labeled "Tach" in the schematic Beau posted) and adjusting the 470KΩ and 220KΩ resistors. The amount the voltage is divide by is determined by the ratio of those two resistors, and the impedance is determined by their sum. Because the magneto produces low current at a high voltage, your sensing circuit needs to be relatively high impedance.
Try building the circuit Beau posted, attached to a scope probe instead of a Propeller pin, and modifying the resistors until you get the waveform you want. You will essentially get a short high-going pulse once per revolution.
- David Carrier
The other thing you need to figure out is what you are trying to get out of the project. If you want to learn how to make an RPM sensor, then you have one path to follow. If you simply want to make USE of an RPM sensor, then you have another path to follow. If you want to learn how to create your own circuit for the microcontroller, that's another branch. And if you simply want to get up and running with an existing design, then that's yet another branch.
Joel-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Ouch, thats not suppose to be hot!··
Michael King
Application Engineer
R&D
Check out Project: PSAV Persistent Sailing Autonomous Vehicle
As you all have pointed out there are many ways to get a 1 / rev signal. I am working on old school stuff so I think I just need a 100K resistor in front of a 4.7V zener on the coil primary. This should clip the 12 volts nicely without causing problems. Remember that all these coils, for magneto, CD, or points and condenser ignitions are just transformers. One should be able to pick up a signal off the primary at a reasonable voltage level. Most of the two cycle stuff I have seen in recent years have a small hall effect coil with some type amp to trigger the primary of the spark plug coil. Back in the mid 90's I built a rpm sensor from an IR module that worked real good. However, now I am lazy and want to hook right to the coil. So we all know we can get a signal to measure one way or another. My question is how to code the frequency sampling on a BS2. I know I am knot in the right forum for this but maybe someone could send me somewhere for some sample code.
Thanks
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pi Guy
in particular, for RPM pickups 'off' a coil, an optoisolator is a very good idea - this will guarantee a protection from high voltage spikes that may potentially kill a microcontroller
see attached schematic of RPM pickup (look at the part of schematic specific to 4n25s optoisolator).
The schematic is of a proven to work engine management system.
ent, 2. it would be cheaper to use.
If you would like, I have a 5 horse engine and a good-as-broken prop to use. The reason I don't mind ruining it is I can no longer use the external resonator on it, so it is incapable of many tasks. Perfect for seeing how dangerous this project is for it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pi Guy