Dyno controller, searching for inputs?

Hi

I am brand new to Arduino(just got it today :slight_smile: ).
My first project is, building a Dyno-controller, for my engine brake, based on the Arduino Duemilanove.
And a big watercooled diskbrake, a torque arm with a weight cell/amplifier that produce a 0-5v output.
Unfortunatly i have no pictures yet.

My plan is to take it step by step, and hopefully learn along the way.

My first task is to get a stable rpm counter, via a halleffect sensor.
Then produce a open loop PWM output, to control a fast acting valve(that control the brake), so that i can keep the engine below a chosen rpm(target),
To determine the target value(0-15000), my plan is first to use a potmeter, just to get started.
But i plan to make a feature later, so i can rev the engine to any rpm, and press a ”hold this rpm” button, then have a ”+” and ”–” button, to raise or lower the target rpm by 100, at each push on the button.(if any of you a great idea for that i will be more than glad to try it out now anyway :wink: )

And i will need an ”auto-sweep” function, that starts at say 1000rpm, holds it there for 1sec(to stable the weight cell), then raise the target by 100rpm's, for each following sec.
Until the rpm drops below 1000rpm's again(or another value), to tell the auto-sweep is over.
Later i will have a software, that will log the values, of the weightcell(nm), and calculate the hp from that.
I was thinking to send the value, to the software, just before every raise of rpm.(as the weight cell is most steady, at that time)

I also plan to use a display, i was thinking 2x20 lines, that can tell me the target rpm, and realtime rpm on the first line, and NM and HP, on the second line, so that i can read the realtime values without any pc plugged in.

Even later than this i will try to make a weather station, to compensate for barometic pressure, humidity and temperature.

But my first task is to get to work, so i can get some readings out.
Not to get the dynofigures, to brag with, at the gasstation, but for adjusting and mapping the engine.

That means that i will start with the revcounter.
I have been searching this forum and found some fine examples, but some of seems to be very accurate and complicated?
This one for example: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274834441
Seems to contain alot more than what i need?

And this: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1281925297
This one looks like it could work for me to, but i was hoping to go open loop?

I have been trying out alot of the different code examples, through the afternoon.
And had a number of led's blinking, trying to change the values a bit, and written a graph to the pc, fun stuff :slight_smile:
but how do string the codes together?

I mean how can i grab the value off a revcounter, to use as a value, in the analog write?(for starters)

When i come to think of it, it's not the value of the revcounter, it's the value of the difference between target rpm, and actual rpm i need to use?
That's not making it easier for me.

But if i can learn how to do the first, i might be lucky enough, to learn the rest.

I hope that one you programguru's can point me in the right direction?

Thanks in advance.

Palle

Why use a hall effect sensor at all. Depending on the engine, and ignition system, you could
a) connect to the coil like a display tach, count the pulses and do the math (there is a sample interrupt driven counter on this forum, just search for tachometer)
b) most CDI boxes have a tach out signal, which is usually a 12v square wave, which you should be able to reduce to 5v with either a simple voltage divider, or a regulator (I'm trying a regulator for the Data Acquisition system i'm building using the Mega board (more inputs, and more memory)
c) use a magnetic switch, with a magnet on the flywheel, you then feed the switch cycle into the interrupt handler, count and display RPM every X ms (I'm planning on using 250ms interval for display, but you could go more granular

Here is some code (taken frm the referenced post to the forum, and made into an object). Note, I still have to adjust the "pulses per rotation" for my 6Cyl motor, but if you use a mag switch, then you have 1 pulse per rotation.

// Tachometer hooked up to interrupt 0 Digital Pin 2 on All boards.
unsigned long tachCount; // Global scoped within the object.

// Interupt function. Can't be part of the object.
void tachPulse()
{
++tachCount;
}

Tachometer::Tachometer()
{
pinMode(2,INPUT);
attachInterrupt(1,tachPulse,RISING);
tachCount = 0;
_time = millis();
}

void Tachometer::tachprocess(unsigned long time)
{
int rpm;
unsigned long deltat;
if ( (millis()-_time >= 100) )
{
// rpm = number of interrupts counted in 100ms
// *10 to make per second
// 60 to make per minute
// /2 for 2 pulses per rotation (4 cylinder)
// /10 for some reason???
rpm = (((tachCount
10)*60)/2)/10;
Serial.print("$TACH:");Serial.print(deltat);Serial.print(":");Serial.println(rpm);
//Do things with the RPM value here (update display etc)...
//

tachCount = 0;
_time = millis();
}

}

void Tachometer::tachSetup(unsigned long time){
_time = millis();
attachInterrupt(TACHINT,tachPulse,RISING);
tachCount = 0;
}

Why use a hall effect sensor at all. Depending on the engine, and ignition system, you could...

One good reason would be to have a dyno setup that required no electrical connection to the car electronics. Run the car up until the car tach indicates something like 2000 rpm, then use that for a calibration point for the dyno program rpm monitoring.

Thanks for youre inputs.
The reason for usng a hallsensor is like Zoomcat says.
I will have all the wiring on the bench, so that i can test other engines with no electronics/rev counters.

And i have about 40 hallsensors lying in a box on the shelve, that was handed to me, as the previous owner never used them anymore.
I plan to use 1 pulse pr rev.

Bullethole:
I have tried to upload the code you provided, just to test.
But it says "error tachometer has not been declared" ?
Now where/how can i declare it?

And again thanks alot for youre help.

Palle

Somewhat off topic, but some dyno videos of Honda S2000s (I've got a rio yellow 2005) which show dynos in operation.

TR SDX S2000 Exhaust - YouTube exhaust dyno
- YouTube
Banco de Potencia Honda S2000 - YouTube
- YouTube
Re: Sickest S2000 Ever! Ryan's Beautiful Machine @ Harman Mo - YouTube
- YouTube
2003 Honda S2000 Dyno Run - YouTube
Turbo S2000 s on Dyno - YouTube
2003 Honda S2000 1/4 Dyno Run - YouTube
My S2000 on the dyno - YouTube
s2000 dyno - YouTube
2002 HONDA S2000 dyno pull - YouTube
AP2 Honda S2000 Dyno - YouTube
- YouTube
- YouTube
2003 Honda S2000 1/4 Dyno Run - YouTube
Comptech S2000 Dyno Run - YouTube
S2000 dyno - YouTube
Turbo S2000 Dyno - YouTube
S2000 Dyno - YouTube
2000 Honda S2000 Dyno Test - YouTube
Honda S2000 Dyno - YouTube
JE Import Turbo S2000 dyno - YouTube
AP2 dyno - YouTube

Nice :sunglasses:

I only viewed a couple the videos for now, and i saw that it is inertia dyno's(the ones i saw anyway)

The bench i'm building is a brake-dyno inspirated from this tread: Egenbyggd bromsbänk - Sävar Turbo Site
Its in swedish, but google translate is you're friend :wink:

I have been cracking my head lately, with how i get the value for the pwm output?
At first i tried to take the difference in % between target and actual rpm, to create a PWM value, but i don't think that's gonna work?
Because it should hold the engine "down" on the target, if the rev's rises above target, it should brake until the target is reached, and hold it there?

Anyone with a great idea here?

Looks like a Prony Brake setup. As to determining the rpm, you might search for a tachometer or rotary encoder code for detecting a rotation event and some timing code to determine the rpm.

http://www.google.com/search?hl=en&as_q=Prony+brake&as_epq=&as_oq=&as_eq=&num=100&lr=&as_filetype=&ft=i&as_sitesearch=&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=images

Yes. it is a kind of prony brake.

For calculating rpm, i have been trying ALOT of codes out, found on different places, most of them seem to work just fine.
I haven't decided yet, which codevariant it's gonna be.
But im pretty sure, that this isent my biggest problem, i'm really thinking hard about, how to determine the open loop pulsewidt, to control the brake?

I have been looking for some motor controller codes, but i don't think i have found any, that i can use?
That can very well be, because i don't understand the codewriting, good enough yet, to see them through.

You might look at servo controls and setups. A servo is given a target position to maintain, and adjust itself based on feedback to maintain the target position. In the arduino, you need to determine a current rpm value from some type of input, and compare it to a desired value probably input from a pc running the dyno application. Based on a +- numeric value deviation from the desired value, a direction (and magnitude) value generated to control a servo or motor controller which will control the brake. Probably need to determine the mechanical method to control the brake (servo, linear actuator, etc), to determine the software that will be needed.

Again thank you for the pointer.

I have been looking alot at this one: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1281130816
But i dont think its open loop, and the pwm control part is, a bit over my head just yet.
I can feel that i'm catching on, a little at the time, but the math pieces, with khz, rpm and dutycycles is a bit confusing for me, for the time being.