1 ... 3 4 5
unevolved
unevolved SuperDork
2/17/15 6:57 p.m.

I think an LS7366R could work, actually... It can be set up for quadrature, or just standard counting. Like, Ch. A is a square wave from a hall effect or something, and Ch. B just signals direction, so just leave it tied high.

Ok, I give up. Just tried to write out some code, but this forum's software is horrific for code.

Basically, you need two variables, "TimeA", "TimeB", "CountA", and "CountB". At the start of the function, you set "TimeA" equal to micros(), a native function that counts the microseconds since the program started. Poll the counter over SPI for "CountA." Then delay a handful of milliseconds, set "TimeB" equal to micros(), the poll the counter for the second position, "CountB." You've then got four variable that give you a change in angular position over a change in time, and figuring out RPM is easy from there.

If it's a discrete function, you can call it however often you like in your code, rather than have it run all the time.

Just watched your video, good stuff. Looking forward to the rest of them.

fujioko
fujioko HalfDork
2/17/15 7:16 p.m.

In reply to ssswitch:

The desktop computer is 1.2GHZ Shuttle XP with a liquid cooled processor. Its a dual boot and is running FreeDOS with QB. I think the machine is about ten years old and is equipped with two serial ports.... It was free.
I'll get the Arduino code posted before the weekend.

In reply to unevolved:

A dedicated counter/timer chip would be the ideal solution. I did check ebay for the possibility of a pre-built cheapo board, but nothing was available.

Overall, I'm happy with the current setup and is built to my level of understanding. The electronics portion of this project was the hardest to finish... let me explain..

For me, electronics are a bussman's holiday paradox. My day job involves electronics and I don't really like doing electronics at home.... but to advance my hobby sometimes I have to hunker down and get'er done. I find that when it's cold outside, I can dive deep into an electronics project , but as soon as winter breaks I'm back cutting steel with fire and getting my hands dirty under the hood.

The current quandary is all the toys are in a deep freeze and it's impractical to do anything. When it comes to writing code, I like to be fully caffeinated with heavy metal music pumped up to 11. On weeknights I'm not allowed to drink coffee so I'm easily distracted by the internet and I'm apparently rambling on.....sorry.

Anyway, now for something completely different...

Here is a snapshot from the video, In the upper left hand you can see the torque is reading 81 foot pounds. That's outstanding..... especially since the engine isn't rated to produce that much torque. That is a real number, however here is what is going on.

The transmission was in second gear and a large mechanical advantage was created. The torque is being multiplied and the horsepower is being divided. This sucks because it makes the engine look moar wimpy than it really is. Apparently I also spelled torque wrong.

For the high speed tests, I'm using second gear to keep the pump speed (shaft speed) below 2000 RPM. It is unclear if the pump is rated for 4000 RPM and I don't know enough about hydraulics to guess.

RossD
RossD PowerDork
2/18/15 7:40 a.m.

You could write in the code to change the torque and horsepower readings for the gear you're in to get it back to 1:1 ratio.

Edited for the response below: http://www.engineeringtoolbox.com/gear-output-torque-speed-horsepower-d_1691.html

fujioko
fujioko HalfDork
2/18/15 8:43 a.m.

I was wondering if a correction factor could be incorporated into the formula. The reduction ratio is 1.88:1 (Miata 2nd gear). That works out to 43 foot pounds of tq.

With HP, I would need to scale the numbers up, but is that a mathematically legal function? The math certainly works, but since HP is based on pump RPM... would using math be projecting actual HP? This gets a little fuzzy in my head.

With the information on the previous photo, the HP would also be 43.

Am I over thinking this?

Autolex
Autolex Dork
2/18/15 1:50 p.m.
fujioko wrote: I was wondering if a correction factor could be incorporated into the formula. The reduction ratio is 1.88:1 (Miata 2nd gear). That works out to 43 foot pounds of tq. With HP, I would need to scale the numbers up, but is that a mathematically legal function? The math certainly works, but since HP is based on pump RPM... would using math be projecting actual HP? This gets a little fuzzy in my head. With the information on the previous photo, the HP would also be 43. Am I over thinking this?

if you can accurately measure torque (and convert for gearing) then you can accurately measure horsepower

the formula is as simple as

HP = (Torque (Lb-Ft) x RPM) / 5252

should be easy enough to do on the fly via a code change (drive the hp field from the torque field)

Check out the wiki on HP (Here)

evildky
evildky Dork
2/18/15 3:58 p.m.

This is way over my head but, why did you run a transmission? When calculating your HP TQ numbers are you accounting for the energy lost to turn the trans? Agina way out of my depth I'm just used to seeing chassis dyno's where you measure wheel hp, or engine dynos where the engine drives the dyno cell and the crank HP is measured. I get that the point of reference is all that matters I just missed or simply don't understand why you ran through a transmission.

fujioko
fujioko HalfDork
2/18/15 8:05 p.m.

In reply to evildky:

good question...

Keep in mind the dyno replicates the exact drivtrain that is in my Miata. Any frictional losses on the dyno will also be present in the Miata. I'm going to try and tune the engine for loads common for a daily driver. The transmission also was the easy button for mounting the starter and eliminates the need for a lot of custom parts. This is a different approach to engine tuning because peak power is not the goal.... however I am going to tune for more power. ...should be interesting.

Overall this is a fun project with a little science.

in reply to RossD and autolex:

Ok, so I'm using the same formula that autolex posted. If I drop in some code that divides the torque by 1.88 and multiplies the HP by 1.88 I should have something close to actual? I realize there are some other factors like gear efficiency and whatnot but that is above my paygrade. I'm looking to track improvements to the engine and since the transmission fudge factors will be a constant, I'm inclined to disregard them. The results will be close but more importantly they can be tracked in percent of improvement. Of course if someone knows how to calculate gear efficiency I'll plug that number in as well.

I really appreciate the comments and the help.

erohslc
erohslc Dork
2/19/15 7:49 a.m.

As Autolex said above, HP is calculated from torque x RPM, not directly measured.
It's also the same on both sides of a gearbox or diff (minus internal losses) no matter what ratio.
So you have driveshaft output torque from your load cell, just need driveshaft RPM going into load cell.
The product by formula is HP.
The number 5252 conveniently accounts for all of the measurement units (ft-lb, revolutions/minute, etc.) to give you horsepower (550 ft-lb/sec)

Autolex
Autolex Dork
2/19/15 9:15 a.m.
erohslc wrote: As Autolex said above, HP is calculated from torque x RPM, not directly measured. It's also the same on both sides of a gearbox or diff (minus internal losses) no matter what ratio. So you have driveshaft output torque from your load cell, just need driveshaft RPM going into load cell. The product by formula is HP. The number 5252 conveniently accounts for all of the measurement units (ft-lb, revolutions/minute, etc.) to give you horsepower (550 ft-lb/sec)

This^ Convert to HP directly from the read torque number.

fujioko
fujioko HalfDork
2/19/15 7:33 p.m.
ssswitch wrote: Are you planning on throwing your code up on github or something for people to look at and contribute to? I caught a few typos that won't be too hard to fix, but I'm primarily interested in learning what you've got going on each Arduino.

Hi 'ya ssswitch,

I managed to upload the arduino code to GitHub. The links should be below. The Beavis code is hardware dependent and will only work on a Mega. The Butthead code is set up for a Mega but should also work on a UNO. Both are setup for serial1(mega only)....so you may get an error on verify. There may be some artifacts in the code from past edits. I'm pretty sloppy about cleaning up my messes. The code is far from optimized but should be easy to understand. At some point I'll clean and optimize the code. Take a lookie

The diagram below sort of illustrates the data flow. The serial com's are bi-directional but the system more or less flows in the indicated direction.

Code for Beavis Code for Butthead

So... the way the dyno is setup, I'm pulling the RPM off the engine then dividing it by the gear ratio for shaft speed. The shaft speed RPM and of course the torque is what I'm using to calculate HP. I'm using the standard formula for HP. It's all good. I'll apply a correction to the code to get the numbers looking like they should.

Thanks!

fujioko
fujioko HalfDork
3/29/15 11:04 a.m.

Figure it's about time for a project update. Among other things, the issue of noise needed to be addressed ... ummm, yeah this thing barks out a penetrating drone that is apparently irritating. I have asked around the neighborhood and although the dyno can be heard, no one seems bothered by the noise. It's hard to gauge if folks are being polite or they really don't care. I have been mindful and shut down the dyno no latter than 8 pm and I generally wait until after 11am on weekends to start all the ruckus. Anyway I got word through the grape line that someone was not happy with the noise .... so I finally had to make things right.

The result of my efforts is a remarkable reduction in noise, therefore I can probably run the dyno a lot latter in the evening. The exhaust is now pointing into a mini forest and hopefully I'll be irritating the squirrels and whatnot as apposed to any neighbors. We'll see.

Some pictures to look at while you wind away your Sunday afternoon.

The exhaust system had to come off the dyno in order to fit a proper muffler. A Thrush Turbo muffler was sourced locally for $29.00 a few odds and ends brought the bill up into the $40.00 mark.

While the exhaust was off, I took the opportunity to relocate the wide band sensor. The exhaust manifold appeared to be getting really hot during tests and relocating the sensor probably was a wise move. The unused bung on the manifold was temporally capped. eventually a thermal couple probe will be installed.

Bzzzzzzt!

The muffler is a game changer.... Now I can run the lab 24/7.

Either torque is still spelled wrong ...or it's the correct European spelling. Needless to say, after a major software revision, some things didn't get fixed.

This is actually a screen shot of a test in progress. The dyno is running a simulated 15.7 mile road test. The engine sees loads that are identical the loads recorded on the B3 Miata. It's fascinating to watch the dyno in playback mode.

The tests are repeatable and fuel usage varies + - 2 grams. Whoo hoo!

Yet another berkeleying computer....

Ok, so this computer is the multifunction Odometer. It keeps track of miles and triggers the device formally known as Mr Fusion. It's all good.

Anyway, the miles are recorded for both a simulated 4.10 and a 3.90 axle ratio. When I do a MPG calculation, I can plug in mileage from either axle ratio. The tests are based on the 4.10 axle. Plugging in 3.90 numbers ain't exactly kosher but it gives a close estimate of what the MPG difference would be.

The dyno gets 53 MPG on a simulated 15.7 mile jaunt. Obviously that number doesn't jive with the B3 Miata, however the Miata MPG's are real world and include idling while the barista @ Tim Horton's prepare my morning coffee.
What appears to be a Meth lab is actually my science rig. Fuel consumption data is calculated using cutting edge technology. At some point I'll release the video on how it all works.

Stay tuned!

ssswitch
ssswitch Reader
4/13/15 9:36 p.m.

You guys have Tim Hortons now?

I dig the giant calculator. Thanks for posting the code!

fujioko
fujioko HalfDork
4/14/15 5:17 a.m.

Based on some pretty fuzzy observations, I think SE Michigan has just as many Tim Hortons per square mile as the Toronto area. The coffee is delicious and addicting.

JmfnB
JmfnB GRM+ Memberand MegaDork
3/17/19 9:23 a.m.

Wait... You are in Jackson? 

Hey neighbor! 

Doc Brown
Doc Brown Dork
3/17/19 11:18 a.m.

I changed my user id to Doc Brown but I'm still in Jackson.  Hey neighbor!  

1 ... 3 4 5

You'll need to log in to post.

Our Preferred Partners
G8YtUMlJKe9PwimY0vhQB3Sh5uHEUyoBRMpSm9b5PvNuf2cWfo7IWJwjEVXj6EvD