Pages: [1]   Go Down
Author Topic: Dyno controller, searching for inputs?  (Read 2406 times)
0 Members and 1 Guest are viewing this topic.
Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I am brand new to Arduino(just got it today smiley ).
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 ;-) )

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?
« Last Edit: August 26, 2010, 11:55:18 am by Palle_B » Logged

Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
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
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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;
}
Logged

0
Offline Offline
Tesla Member
***
Karma: 144
Posts: 9609
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.  
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Tesla Member
***
Karma: 144
Posts: 9609
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://youtube.com/watch?v=1o5JaDIxh5w exhaust dyno
http://youtube.com/watch?v=IUrcVHHD8HA
http://youtube.com/watch?v=FjO4zft1Y9w
http://youtube.com/watch?v=tW3xLR7CGtM
http://youtube.com/watch?v=ccCIbgQsrPA
http://youtube.com/watch?v=WXx0xtMXJzc
http://youtube.com/watch?v=KTIT7vhoUyQ
http://youtube.com/watch?v=uPs-5Qc4_q8
http://youtube.com/watch?v=wc1yY0LGy2A
http://youtube.com/watch?v=crQyMLoxSI8
http://youtube.com/watch?v=aro9JacIBQA
http://youtube.com/watch?v=zh66nCrcvz0
http://youtube.com/watch?v=9n_7yimFdqI
http://youtube.com/watch?v=6XGV_UpO__4
http://youtube.com/watch?v=tRy7Pog8xyE
http://youtube.com/watch?v=wc1yY0LGy2A
http://youtube.com/watch?v=paGAUYcxa28
http://youtube.com/watch?v=chjmtOHeG_g
http://youtube.com/watch?v=qQz0T84Q4zM
http://youtube.com/watch?v=VGIa08wJTGg
http://youtube.com/watch?v=FMokjt_Mz7k
http://youtube.com/watch?v=1W9Mpdh_yq8
http://youtube.com/watch?v=uLoj1DGuyMo
http://youtube.com/watch?v=yUcZiqfoOO4
« Last Edit: August 27, 2010, 11:46:15 am by zoomkat » Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice 8-)

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: http://forum.savarturbo.se/viewtopic.php?t=42360
Its in swedish, but google translate is you're friend smiley-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?
Logged

0
Offline Offline
Tesla Member
***
Karma: 144
Posts: 9609
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Tesla Member
***
Karma: 144
Posts: 9609
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: August 28, 2010, 01:40:52 am by Palle_B » Logged

Pages: [1]   Go Up
Jump to: