Author Topic: Dynamic balancer with arduino ???  (Read 7635 times)

0 Members and 1 Guest are viewing this topic.

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Dynamic balancer with arduino ???
« on: March 31, 2018, 08:57:35 pm »
I want to make a dynamic balancer with an arduino nano. I'm expecting RPMs of up to 100k, could be less depending of how things turn out.
At first i thought that i could maybe use bits and bobs of other people's code but i'm looking at a few examples right now and i don't like what i see.
I tend to do stuff my own way so bear with me.
Basically what i have is a shaft that's magnetized so i'll have hall sensor to sense shaft position, and calculate RPM.
What i want to do is to count the time it takes to make 5 (or 10) revoliutions and to calculate the RPMs. Immediately after that i'll have 5(or 10) revoliutions to read the vibration sensor data.
And with all that i'll then calculate the offset and amplitude of vibration.

Basically what i want to say is that i have the basic idea in my head but i'm not yet at a level where i can just dump it into arduino IDE and have it work.

What's the best way count the time for each revoliution? I'm thinking about an interrupt to up the rev counter and maybe micros() to count the time but i'm not sure how well it would work inside and interrupt.
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Online MasterT

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Dynamic balancer with arduino ???
« Reply #1 on: March 31, 2018, 09:47:53 pm »
RPM measurements is essentially frequency reading. There are libraries to do that on arduino.
1. Set Timer1 to clk=1, running 16MHz
2. Two interrupts, one OVF - timer1 overflow, and input change another for hall sensor.
3. You getting data in pin change interrupt like TCNT1 + N (ovf)  x65536, where N(ovf) is number of overflows since last PCINT.
 

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Re: Dynamic balancer with arduino ???
« Reply #2 on: March 31, 2018, 10:08:24 pm »
RPM measurements is essentially frequency reading. There are libraries to do that on arduino.
1. Set Timer1 to clk=1, running 16MHz
2. Two interrupts, one OVF - timer1 overflow, and input change another for hall sensor.
3. You getting data in pin change interrupt like TCNT1 + N (ovf)  x65536, where N(ovf) is number of overflows since last PCINT.
To be honest i have absolutely no idea what you just said  ???  I'm pretty much new to arduino because i've never had the need for anything like this.
I'll include the code i've written so far, it's very crude but shouldn't be too hard to understand.
Code: [Select]
const byte zerox = 2; // interrupt pin  2
const byte vibsense = 0;  // vibration sensor
unsigned long postx = 0;
unsigned long prevx = micros();
unsigned long timex = micros();
unsigned long revtime = 0;         //
unsigned long peakval = 0;         // peak vibration value
unsigned long peakpos = 0;         // peak vibration position
unsigned long vibval = 0;          // vibration value
unsigned int revcount = 0;
volatile byte state = LOW;
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))    //   ADC oc
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))    //    ADC oc

void setup() {     // dynamic balancer V1.0
  sbi(ADCSRA, ADPS2);     // ADC oc
  cbi(ADCSRA, ADPS1);     // ADC oc
  cbi(ADCSRA, ADPS0);     // ADC oc
 
 pinMode(zerox, INPUT_PULLUP); //pulled down by LM393.
 attachInterrupt(digitalPinToInterrupt(zerox), timecount, FALLING);
 
}

void loop() {
  if (revcount >= 5 || state == LOW) {     // count time for every 5 revs.
    revtime = (timex - prevx)/5;           // calculate time for one rev
    prevx = timex;                         //
    revcount = 0;                          // reset rev counter till next 5 revs.
    state == HIGH;                         // to prevent false revtime.
  }
  vibval = analogRead(vibsense);           // saves peak position and value
  if ( vibval >= peakval ){
    peakval = vibval;
    peakpos = micros() - timex;
  }
 
}

void timecount() {
  timex = micros();
  revcount ++;
  state == LOW;         
}
The code is probably horrible but i'm willing to learn.  ;D
edit: changed the code a little
« Last Edit: March 31, 2018, 10:21:04 pm by Refrigerator »
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Offline ChunkyPastaSauce

  • Supporter
  • ****
  • Posts: 539
  • Country: 00
 

Online MasterT

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Dynamic balancer with arduino ???
« Reply #4 on: April 01, 2018, 12:14:26 am »
I see you have analogRead in the code, be aware that many hall sensors output digital signal. It 'd help to give more accurate advise, if you describe what kind of arduino do you use, and what RPM & vibration sensors are,  links to datasheet
 

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Re: Dynamic balancer with arduino ???
« Reply #5 on: April 01, 2018, 08:28:29 am »
I see you have analogRead in the code, be aware that many hall sensors output digital signal. It 'd help to give more accurate advise, if you describe what kind of arduino do you use, and what RPM & vibration sensors are,  links to datasheet
i'm using a 4 pin hall/gauss sensor that outputs an analog differential signal, which goes straight into an LM393, which then triggers the interrupt.
The hall sensor is only there to let me know when the shaft crosses the zero reference point.
The ADC runs at a sample rate of ~58k samples per second, which at, let's say, 60k RPM gives me a reading every ~6.2o, which should be enough imo.
ADC reads the vibration sensor value from a piezo transducer.
Ps: one thing i'd like to know is that when an interrupt happens while arduino is executing code in void loop() does it then resume where it was before the interrupt of does it restart void loop() ?
« Last Edit: April 01, 2018, 08:43:58 am by Refrigerator »
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Dynamic balancer with arduino ???
« Reply #6 on: April 01, 2018, 04:15:42 pm »

From your first post is sounds like what you may want to do is is figure out is something like where to add weight and how much to something like a car wheel.

If this is the case, you do not care about the frequency.

Start with the vibration sensor data. Now what you want to do is create a pulse based on rotation that you can adjust to get it to match a value of vibration sensor data.

This leads to if you can control the rate of spin. If you can not then you need to generate a counter that runs at many times the index pulse of rotation. For example to get to a degree you need both vibration data for each degree and the value of the rotation. This is probably out of capabilities of the arduino.

So you have to use other way.
If you know the time between each rotation pulse you could compute the time to a rotation angle.
If you know the time a  vibration sample was taken you could even compute between vibration samples.

This leaves the need of a master time to rotation pulse & master time to vibration sample.

The simple thing would be to have the rotation pulse start the vibration sample collection. Hardware would be best as software adds unknown time.
You could have the rotation pulse start a counter & at a specific count of that counter change a pin to tell the ADC to start sample.
Changing the match value then changes when in rotation the sample is taken.

So match count value changes rotation angle of vibration value.
If the samples of vibration data samples are at a fixed rate & you know rotation time you have all the facts you need.





 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: us
Re: Dynamic balancer with arduino ???
« Reply #7 on: April 01, 2018, 04:30:00 pm »
Even on a racetrack you probably don't see more than 2K rpm at the wheel. He said up to 100K rpm, so we must be talking about something small. Even small things are dangerous if they fail at those speeds.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Dynamic balancer with arduino ???
« Reply #8 on: April 01, 2018, 05:12:45 pm »

Think you will find that as vibration sensor gets better the need for speed decreases which also leads to better rotation angle sense. Making the whole thing safer.

Does not take much speed to reach faster then a bullet.
Helicopters get into problems with speed of sound at the tips of the rotors.
You for sure do not want to be around for a failure.
 

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Re: Dynamic balancer with arduino ???
« Reply #9 on: April 02, 2018, 02:20:19 pm »
Looks like i failed to mention what it is that i'm balancing. I happen to have a couple turbochargers that need rebuilding. One thing is that after rebuilding it's crucial to properly rebalance the turbo. To do this professionally costs 50€ so i thought that it would be the perfect opportunity to try and make myself a dynamic balancer.
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Dynamic balancer with arduino ???
« Reply #10 on: April 02, 2018, 05:51:12 pm »

Does not take much speed to reach faster then a bullet.


Speed of sound is 1087 fps.
The 55 gr .223 Remington bullet has a muzzle velocity of 3240 fps or about Mach 3. 
The much heavier 200 gr .338 Lapua Magnum bullet has a muzzle velocity of about 3300 fps, it carries a lot of energy down range.

Many rifle bullets tend to be moving pretty fast.  Even the 168 gr .308 Winchester is in the range of 2600 fps - more than Mach 2.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Dynamic balancer with arduino ???
« Reply #11 on: April 02, 2018, 07:33:34 pm »
Looks like i failed to mention what it is that i'm balancing. I happen to have a couple turbochargers that need rebuilding. One thing is that after rebuilding it's crucial to properly rebalance the turbo. To do this professionally costs 50€ so i thought that it would be the perfect opportunity to try and make myself a dynamic balancer.

With all due respect don't be silly. for a one off job get it done professionally, there is a reason they charge it is because they have the kit and it costs a lot of money. if you want to investigate making a balancer sure but don't do it for a quick hack to save a few bucks.
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 951
  • Country: pt
    • My AVR tutorials
Re: Dynamic balancer with arduino ???
« Reply #12 on: April 02, 2018, 08:13:43 pm »
You need to spin it up, and you need around 100 liters of air at at least 3-4 bars on the exhaust side, and you need to supply oil pressure to the turbo, heated oil at that, at around 3-4 bars as well, and you need to make manifolds to supply the air into the exhaust inlet, expect to spend at least some 500€ for all that if you dont already have a spare air cylinder, hydraulic pump with electric motor, plumbing, various fittings, and some decent carbide burs and a die grinder, there is also static balancing that should be done, and the wastegate needs to be set, so pressure sensors are needed as well, if it is a variable geometry turbo you will also need to set and calibrate the vanes opening and motion from 0 to at least 19 in.Hg.

EDIT:

Why dont you just buy the assembled CHRA's pre-calibrated? If you run the turbos at stock pressures and below the surge lines the chinese CHRA's can last a long time, unless you are doing hybrids and using billet compressor wheels, none the less 50€ is relatively cheap to have it all calibrated by a 3rd party, if it blows up in 2 days you have someone to blame for.
« Last Edit: April 02, 2018, 08:44:52 pm by senso »
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3238
  • Country: gb
Re: Dynamic balancer with arduino ???
« Reply #13 on: April 02, 2018, 08:45:36 pm »
Looks like i failed to mention what it is that i'm balancing. I happen to have a couple turbochargers that need rebuilding. One thing is that after rebuilding it's crucial to properly rebalance the turbo.

Only if you are replacing the compressor or turbine.  If you can reuse the original parts then the original balancing will be valid.  I've rebuilt a few turbos (i.e. new bearings, thrust and seals and they have worked without any problems for years.  I do ensure the compressor is replaced in the same location w.r.t the turbine.
 

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Re: Dynamic balancer with arduino ???
« Reply #14 on: April 03, 2018, 05:32:09 am »
Looks like i failed to mention what it is that i'm balancing. I happen to have a couple turbochargers that need rebuilding. One thing is that after rebuilding it's crucial to properly rebalance the turbo.

Only if you are replacing the compressor or turbine.  If you can reuse the original parts then the original balancing will be valid.  I've rebuilt a few turbos (i.e. new bearings, thrust and seals and they have worked without any problems for years.  I do ensure the compressor is replaced in the same location w.r.t the turbine.
I've done that once as well. Replaced the journal bearings and seals and then assembled the turbo the way it was originally. Brought it in to be rebalanced and it turned out the be quite out of balance.
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3238
  • Country: gb
Re: Dynamic balancer with arduino ???
« Reply #15 on: April 07, 2018, 08:23:02 pm »
Looks like i failed to mention what it is that i'm balancing. I happen to have a couple turbochargers that need rebuilding. One thing is that after rebuilding it's crucial to properly rebalance the turbo.

Only if you are replacing the compressor or turbine.  If you can reuse the original parts then the original balancing will be valid.  I've rebuilt a few turbos (i.e. new bearings, thrust and seals and they have worked without any problems for years.  I do ensure the compressor is replaced in the same location w.r.t the turbine.
I've done that once as well. Replaced the journal bearings and seals and then assembled the turbo the way it was originally. Brought it in to be rebalanced and it turned out the be quite out of balance.

If the turbine and compressor are undamaged, clean and replaced in the same respective locations, what causes the imbalance?
 

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Re: Dynamic balancer with arduino ???
« Reply #16 on: April 10, 2018, 08:06:01 pm »
Looks like i failed to mention what it is that i'm balancing. I happen to have a couple turbochargers that need rebuilding. One thing is that after rebuilding it's crucial to properly rebalance the turbo.

Only if you are replacing the compressor or turbine.  If you can reuse the original parts then the original balancing will be valid.  I've rebuilt a few turbos (i.e. new bearings, thrust and seals and they have worked without any problems for years.  I do ensure the compressor is replaced in the same location w.r.t the turbine.
I've done that once as well. Replaced the journal bearings and seals and then assembled the turbo the way it was originally. Brought it in to be rebalanced and it turned out the be quite out of balance.

If the turbine and compressor are undamaged, clean and replaced in the same respective locations, what causes the imbalance?
I replaced the thrust bearing runner/collar, which probably brought some imbalance to the rotor assembly.
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Dynamic balancer with arduino ???
« Reply #17 on: April 12, 2018, 03:09:09 am »
I suspect it's pretty common for there to be some small amount of wear or damage, the turbos I've worked on typically had a fair amount of buildup on both the turbine and compressor wheels. It probably doesn't take much to throw things out of whack with the speed those rotate. It's actually really impressive that they hold up as well as they do. The turbine in particular operates in an extremely harsh environment.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf