Go Down

Topic: RPM anomaly in Dynamometer (Read 373 times) previous topic - next topic

benjamin_b

I have constructed an inertial dynamometer for 540 (36mm diameter) size electric motors and it seems to mostly function but I am getting an unusual "bump" in my rpm around 5000 rpm. I have tried different ways of controlling the servo signal to my motor speed control and there does not seem to be any change. I have tried changing settings in the motor speed control and still no change. I am not sure what else to try. Maybe I am incorrectly using the FreqMeasure library.

I have two Arduino Unos. One gathers the sensor readings and the other outputs a servo signal. The RPM is measured by an optical encoder wheel with 4 slots. The loop on the sensor Uno achieves about 50 sps.

The code for the sensor reading.
Code: [Select]
#include <FreqMeasure.h>
#include <Wire.h>
#include <Adafruit_ADS1015.h>
#include "HX711.h"

HX711 scale;
Adafruit_ADS1115 ads(0x4A);  /* Use this for the 16-bit version */

int16_t currentSensor, voltageSensor;
int throttleOutput = 2, statusPin = 13;
long force;
double sum=0;
int count=0;
unsigned long time1 = 0, time2 = 0;

void setup() {
  pinMode(throttleOutput, OUTPUT);   // HIGH OUTPUT TURNS THE MOTOR OFF.
  pinMode(statusPin, OUTPUT);
  digitalWrite(throttleOutput, HIGH); // Set throttle and status LED to off
  digitalWrite(statusPin, LOW);
 
  Serial.begin(115200);
  Serial.println();
  Serial.println();
  Serial.println("hello");
  Serial.print("microseconds, amps, volts, torque, rpm");
 
  ads.begin();                // start Volt+Current sensor
  ads.setGain(GAIN_SIXTEEN);
 
  // HX711.DOUT  -pin 11//to set the DOUT(or DT) pin
  // HX711.PD_SCK -pin 12//to set the SCKpin
  scale.begin(11, 12);
  delay(2000);
  FreqMeasure.begin();   // Start frequency measure function (can only measure dpin 8)
 
  digitalWrite(throttleOutput, LOW);  // apply full throttle and turn on status LED
  digitalWrite(statusPin, HIGH);
}


void loop() {
 
  time1 = micros();
  if (time1 > (time2 + 19000))
  {
    time2 = micros();
    force = (scale.read());
    currentSensor = ads.readADC_Differential_2_3();
    voltageSensor = ads.readADC_SingleEnded(0) ;
    float frequency = FreqMeasure.countToFrequency(sum / count)*15; // The 15 is to convert a 4 slot encoder wheel frequency into an RPM reading {rpm=freq*(60 rpm/hz)/(4 slot/rotation)}
   
    sum = 0;
    count = 0;
   
    Serial.println();
    Serial.print(time2);          Serial.print(",");
    Serial.print(currentSensor);  Serial.print(",");
    Serial.print(voltageSensor);  Serial.print(",");
    Serial.print(force);          Serial.print(",");
    Serial.print(frequency);

  }
 
  if (FreqMeasure.available())
  {
    // average several reading together
    sum = sum + FreqMeasure.read();
    count = count + 1;
  }
 
  if (millis() > 5100)    // Check if 5.1s have passed and then shutdown
  {
    scale.power_down();   // Shutdown loadcell to avoid heat build
    while(1)
    {
      digitalWrite(throttleOutput, HIGH); // Set throttle and status LED to off
      digitalWrite(statusPin, LOW);
    }
  }
}



The code for the servo signal

Code: [Select]
#include <Servo.h>

Servo testESC;  // create servo object to control a servo
                // twelve servo objects can be created on most boards

int neutral = 91 , fullThrottle = 145;    // variable to store the servo position
int triggerPin = 2, outputPin=12, statusPin = 13;
int triggerState;

void setup()
{
  pinMode(triggerPin, INPUT_PULLUP);
  pinMode(statusPin, OUTPUT);
  digitalWrite(statusPin, LOW);
  testESC.attach(outputPin);  // attaches the servo on pin 3 to the servo object
  testESC.write(neutral);
  delay(500);
}

void loop()
{
  if (!digitalRead(triggerPin))
  {
    testESC.write(fullThrottle);
    digitalWrite(statusPin, HIGH);
  }
 
  else
  {
    testESC.write(neutral);
    digitalWrite(statusPin, LOW);
  }
}


The graph shows RPM over time (seconds) and appears as if the RPM levels and then "surges" at 5000 rpm.
I also have current and torque measurements and there does not appear to be a surge in current or torque at 5000 rpm but it may just be a lack of resolution.

bluejets

What does the bottom line of the graph represent?

Revs portion as such appear to increase ok.

benjamin_b

#2
Apr 17, 2019, 04:19 am Last Edit: Apr 17, 2019, 04:23 am by benjamin_b
the bottom axis is time in seconds. I have looked at dyno outputs from commercial dynos made for the same application and from what I know about electric motors, I do not think there should be a kink in the RPM curve.

Robin2

This link has code that I use for detecting the speed of a small DC motor using an optical detector that produces one pulse per rev.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

leongjerland

Is everything well balanced? Mechanical resonance?

TomGeorge

#5
Apr 17, 2019, 10:31 am Last Edit: Apr 17, 2019, 10:34 am by TomGeorge
Hi,
Does this happen for all motors you dyno test?

Is this with the motor loaded or unloaded as you increase speed?

Thanks.. Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

bluejets

the bottom axis is time in seconds.
So as I read it, the motor goes from approx zero speed to 5000 rpm in say 0.3 sec and then from 5000 rpm to 10000 rpm in approx. 0.2 seconds.

I'd say it would depend on what voltage the motor was designed for and what loading you have and whatever is controlling the feed to the motor. If you are expecting a linear increase and it isn't, perhaps one or more of the others is not.

benjamin_b

The load is a 2 inch diameter, 1 inch wide aluminum disc/flywheel. Since it is just accelerating a weight, the rpm should change smoothly.

leongjerland - it sounds like some vibration is there but nothing unusual. everything is clamped and screwed in place so there shouldnt be enough movement for the encoder wheel to move out of the optical sensor.

TomGeorge - I will try to find and test a different motor system in the next day or two but the current speed control can adjust motor performance through changing commutation timing as well as current limiting, so in essence it is like having a different motor.

Robin2

so there shouldnt be enough movement for the encoder wheel to move out of the optical sensor.
I think, from the other comments, that some people believe your Arduino stuff is working properly and the anomaly is due to the behaviour of the motor.

The comment I have quoted here suggests that you think the problem is within the Arduino system. IMHO the best way to verify that is with an alternative measurement system - either a different Arduino program (I gave you a suggestion earlier) or a completely different measuring system - perhaps an oscilloscope.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

benjamin_b

#9
Apr 18, 2019, 01:09 am Last Edit: Apr 18, 2019, 01:10 am by benjamin_b
I forgot to mention, I purchased a non-contact tachometer and when the motor is at maximum rpm (about 18000) the arduino output agrees with the tachometer within less than 1%. I might try partial power and try to maintain something slightly under 5000 rpm. I'll do some more trial and error in a few hours and tell you what I find.

benjamin_b

made a mistake and burned up a speed control. will have to get back to this in a few days.

leongjerland

Quote
leongjerland - it sounds like some vibration is there but nothing unusual. everything is clamped and screwed in place so there shouldnt be enough movement for the encoder wheel to move out of the optical sensor.
Unless it's severe, I don't think vibration causes problems for the encoder wheel.

But around the resonance frequency there will be additional forces affecting accelleration of the motor.

Go Up