Dynamic balancer with arduino ??? - Page 1
Forum section: electronics / general

author: Refrigerator
author_rank: Super Contributor
timestamp: March 31, 2018, 08:57:35 pm
content: 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.

author: MasterT
author_rank: Frequent Contributor
timestamp: March 31, 2018, 09:47:53 pm
content: RPM measurements is essentially frequency reading. There are libraries to do that on arduino.1. Set Timer1 to clk=1, running 16MHz2. 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.

author: Refrigerator
author_rank: Super Contributor
timestamp: March 31, 2018, 10:08:24 pm
content: Quote from: MasterT on March 31, 2018, 09:47:53 pmTo be honest i have absolutely no idea what you just saidI'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:const byte zerox = 2; // interrupt pin 2const byte vibsense = 0; // vibration sensorunsigned long postx = 0;unsigned long prevx = micros();unsigned long timex = micros();unsigned long revtime = 0; //unsigned long peakval = 0; // peak vibration valueunsigned long peakpos = 0; // peak vibration positionunsigned long vibval = 0; // vibration valueunsigned 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 ocvoid setup() { // dynamic balancer V1.0sbi(ADCSRA, ADPS2); // ADC occbi(ADCSRA, ADPS1); // ADC occbi(ADCSRA, ADPS0); // ADC ocpinMode(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 revprevx = timex; //revcount = 0; // reset rev counter till next 5 revs.state == HIGH; // to prevent false revtime.}vibval = analogRead(vibsense); // saves peak position and valueif ( 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.edit: changed the code a little

author: ChunkyPastaSauce
author_rank: Unknown
timestamp: March 31, 2018, 10:32:31 pm
content: https://tushev.org/articles/arduino/9/measuring-frequency-with-arduino

author: MasterT
author_rank: Frequent Contributor
timestamp: April 01, 2018, 12:14:26 am
content: 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

author: Refrigerator
author_rank: Super Contributor
timestamp: April 01, 2018, 08:28:29 am
content: Quote from: MasterT on April 01, 2018, 12:14:26 ami'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() ?

author: C
author_rank: Super Contributor
timestamp: April 01, 2018, 04:15:42 pm
content: 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.

author: Nusa
author_rank: Super Contributor
timestamp: April 01, 2018, 04:30:00 pm
content: 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.

author: C
author_rank: Super Contributor
timestamp: April 01, 2018, 05:12:45 pm
content: 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.

author: Refrigerator
author_rank: Super Contributor
timestamp: April 02, 2018, 02:20:19 pm
content: 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.

author: rstofer
author_rank: Super Contributor
timestamp: April 02, 2018, 05:51:12 pm
content: Quote from: C on April 01, 2018, 05:12:45 pmSpeed 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.

author: Simon
author_rank: Unknown
timestamp: April 02, 2018, 07:33:34 pm
content: Quote from: Refrigerator on April 02, 2018, 02:20:19 pmWith 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.

author: senso
author_rank: Frequent Contributor
timestamp: April 02, 2018, 08:13:43 pm
content: 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.

author: mikerj
author_rank: Super Contributor
timestamp: April 02, 2018, 08:45:36 pm
content: Quote from: Refrigerator on April 02, 2018, 02:20:19 pmOnly 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.

author: Refrigerator
author_rank: Super Contributor
timestamp: April 03, 2018, 05:32:09 am
content: Quote from: mikerj on April 02, 2018, 08:45:36 pmI'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.

author: mikerj
author_rank: Super Contributor
timestamp: April 07, 2018, 08:23:02 pm
content: Quote from: Refrigerator on April 03, 2018, 05:32:09 amIf the turbine and compressor are undamaged, clean and replaced in the same respective locations, what causes the imbalance?

author: Refrigerator
author_rank: Super Contributor
timestamp: April 10, 2018, 08:06:01 pm
content: Quote from: mikerj on April 07, 2018, 08:23:02 pmI replaced the thrust bearing runner/collar, which probably brought some imbalance to the rotor assembly.

author: james_s
author_rank: Super Contributor
timestamp: April 12, 2018, 03:09:09 am
content: 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.