paper: FRC Drivetrain Characterization

I’m trying to duplicate the computations given in the paper, and I can’t seem to get the same numbers for ka. Here’s what I have:

CIM_FREE = (5310 / 60) # rps
CIM_STALL_TORQUE = 343.4 # oz/in
CIM_STALL_AMPS = 133 # amp
CIM_FREE_CURRENT = 2.7 # amp

wheel_diameter = (3.8/12.0)
gearing = 6.1
nmotors = 3
robot_mass = 110

max_velocity = (CIM_FREE * math.pi * wheel_diameter) / gearing
max_acceleration = (2.0 * nmotors * CIM_STALL_TORQUE * gearing) / (wheel_diameter * robot_mass)

kv =  CIM_NOMINAL_VOLTAGE / max_velocity
ka = CIM_NOMINAL_VOLTAGE / max_acceleration
print('vmax=%.3f amax=%.3f kv=%.3f ka=%.3f' % (max_velocity, max_acceleration, kv, ka))

And this results in vmax=14.433 amax=360.816 kv=0.831 ka=0.033 . However, the paper reports kv=0.83 and ka=0.1 … so something’s wrong with my acceleration numbers.

I assume I’m not using the right units for CIM_STALL_TORQUE, but I’ve tried a bunch of different units and none of them have worked out. I had expected the unit to be in ft/lb … but that yields amax=1.867 ka=6.427 which seems really off.

Edit: I was too quick to assume that the mistake here was the common unit confusion, please ignore the first version of my post which has now been removed.

You’ve made some mistake calculating amax; here is the correct calculation.

At a glance, it appears you have used the wrong value for nmotors (3 rather than 6; we are doing the calculation for the whole robot, not half of it, or else we would have to halve the mass), and also that you have used inconsistent distance units (your torque is stated in oz-inches, but your wheel diameter is in feet).

This is one reason I almost always use wolframalpha for calculations involving units these days; the unit handling is a godsend.

Thanks, that was really useful! Shows why I got terrible grades in physics back in college. :yikes:

… speaking of which, I played with it a bit and still can’t get the numbers for Amax working without units. Clearly I’m missing something. I’ll try to show my work.

I recall from something somewhere there’s a difference in how metric units and imperial units work… but according to wolfram it seems like I’m working with the right dimensional units. For the life of me I can’t figure out what magic conversion factor I’m missing to make this work.

Thanks for your patience!

Ah, now you’ve run into the problem I addressed in my first (now-deleted) version of my post - your unitless equation is correct, but your calculated acceleration is in units of gs, not ft/s^2. This is because you’ve used lbf for your force, and lbm for your mass; their ratio is the acceleration of gravity.

You’ve gotta be careful about this when using imperial units; if you don’t want this to happen, you have to use slugs rather than lbm for your units of mass.

Ok, that works… but now I’m confused. I thought lbf-ft is to N-m as lb is to kg? Or rather… why does this work when I convert everything to metric – or does it not actually work and I would need to convert kg to some other unit also?

(I’m asking because I’m trying to implement this model for pyfrc’s drivetrain simulation, so I want to make sure it’s implemented correctly and that I understand the units that I’m asking users to give me)

No, and I’m not even sure what you’re trying to do here.

[li]lbf: not sure which you mean[/li][list][li]pounds force - is pounds, a unit of force[/li][li]pound feet - is torque: a force of one pound applied normally (perpendicularly) at a distance of 1 ft.[/ul][/li][li]N-m is torque, a force of one Newton applied normally at a distance of 1 m.[/li][li]lb is pounds, a unit of force [weight]. The unit of mass in standard/imperial is the slug, which is the mass of something which weighs ~32 lb on the surface of the earth. An lbm (pound mass) is ~1/32 slug.[/li][li]kg is kilograms, a unit of mass. The unit of force in metric is a kg-m/s2, also known as a newton (N). A kilogram mass weighs ~9.8 N on the surface of the earth.[/li][/LIST]

Edit/add: Assuming you meant foot-lb at the top, then:
[ul][li]ft-lb corresponds to N-m as [/li][li]lb corresponds to N and as [/li][li]slugs correspond to kg.[/ul][/li]
(By correspond, I mean that they have the same dimensions and can be converted to/from each other, not that they have the same conversion factors.)

That is exactly the distinction that I was missing. I had thought lb and kg were both units of mass, I see now that that isn’t correct.

Thanks to everyone for your help and patience!

1 Like