measuring RPM/V

sgds23

100 mW
Joined
Sep 19, 2012
Messages
35
I'm clearly missing something obvious, but this used to work, and all I did was change from a BMC v2 to an eZee -- which I thought were roughly the same..

So I'm trying to empirically measure RPM/V. My program steps through 5 power levels (think of them as 25%, 50%, 75%, 100%), runs the wheel, measures the speed and voltage, then calculates the RPM/V. I try to be reasonably careful: I get the wheel up to speed before measuring, and I average measurements over 100 datapoints. (Note that I do have a rim/wheel on the hubmotor, but it's off the ground so no load.)

It works fine for my crystalyte:

motor#, desired power level (0-1000), achieved power level, volts * 10, average RPM, PWM volts * 10, RPM/volts

2 250 250 645 148 161 9
2 500 500 645 302 322 9
2 750 750 644 449 483 9
2 1000 1000 643 606 643 9

showing 9 RPM/V for every power level, just as it should. (Controller doesn't handle floats, hence some of the weird math.)

But when I do this for my Ezee

1 250 250 645 301 161 18
1 500 500 640 643 320 20
1 750 750 632 1095 474 23
1 1000 1000 623 1516 623 24


The most obvious problem is the RPMs are too high. But I'm using 80 pole pairs, just as I did with the BMC. The second problem is the drifting upwards, and too high, RPM/V.


So do I have pole pairs wrong? And can anyone spot the boneheaded measurement error I'm incurring?

Thanks,
s.
 
I don't entirely understand what you're doing.. ordinarily measurements are made with a digital laser tachometer.. even a cheap $20 unit on eBay will work.

Take measured RPM with the tachometer divided by the current voltage of the battery with the wheel in the air, and you have rpm/v.
 
Well, yes, but other than my method being apparently completely wrong, it should be significantly more accurate. After all, I'm accounting for voltage sag _at each time step_. and systematically measuring over power curve.


For the completists, my controller code looks like:

Code:
motor_channel = 2
desired_power = 0

wait(100)
'
'  Calculate RPM/volt


OUTER_LOOP: 
	desired_power = desired_power + 250
	i = 0

INNER_LOOP1:[code][code]
	SetCommand(_GO, motor_channel, desired_power)
	wait(8) 	
	i = i + 1
	if ( i < 50 ) then goto INNER_LOOP1

	i = 0
	measured_volts = 0
	measured_speed = 0
	measured_power = 0
	max_speed = 0 

INNER_LOOP2:
	SetCommand(_GO, motor_channel, desired_power)
	wait(8) 
	if ( getValue(_P, motor_channel) = desired_power ) then
		measured_volts = measured_volts + getvalue(_VOLTS, 2)
		t_rpm = getvalue( _BLSPEED, motor_channel)
		measured_speed = measured_speed + t_rpm
		if ( t_rpm > max_speed ) then max_speed = t_rpm
		measured_power = measured_power + getValue(_P, motor_channel)
		i = i +1
		if (i >= 100 ) then goto OUTA_LOOP
	end if
	goto INNER_LOOP2


OUTA_LOOP:
	average_volts = measured_volts / 100
	average_speed = measured_speed / 100
	average_power = measured_power / 100
	
	actual_volts = ( average_volts * average_power ) / 1000
	rpm_per_volts =  (average_speed*1000) / (actual_volts*100)
	print ("\r", motor_channel, "\t" ,  desired_power, "\t",average_power,"\t",average_volts, "\t",average_speed,"\t",actual_volts,"\t",rpm_per_volts,"\t",max_speed,"\r\n")
	if ( desired_power < 1000 ) then goto OUTER_LOOP

SetCommand( _GO, 1, 0 )
SetCommand( _GO, 2, 0 )
 
Back
Top