HI all, new user here.
I'm conceptualizing my first real project. I've been through most of the exercises in the "Getting Started with Sketches" book, I have a little bit of background with C, commercial race data systems, MATLAB, and some more background with vehicle dynamics in general. Basically, I know where I need to go but I'm hoping to discover the route through discussion here ![]()
The concept:
What I'm trying to do is to create a device that will allow me to output a 0-5V analog signal that represents corrected acceleration to my vehicle's ecu, which has been modified to allow datalogging already. I’d eventually like to be able to grow this into a program and system robust enough to output torque values directly to the ecu. For now I’d like to focus on just an acceleration value, preferably corrected for road grade. The rest of the calculations can be easily handled in Excel since I can already output to .csv files. The idea is to be able to build a “torque map” that correlates to the fuel/spark maps as shown here:

This will allow me to tune the vehicle for peak torque at each breakpoint of the map.
The basic equation of a moving automobile:
M*V’ = Fd – Ff – Fa – Fg
Where
M = mass of the vehicle
V’ = dV/dx = acceleration of the vehicle
Fd = tractive force, i.e. engine power at the wheels
Ff = frictional forces (tires, wheel bearings, losses due to bumps, etc.)
Fa = aero drag
Fg = road grade contributions
The methodology is to go through and solve each of these individually by negating the others. M*V’ is fairly obvious and is what I would like to measure (specifically the V’!). Ff and Fa can be solved for sequentially (and with reasonable, but not excellent accuracy) by performing low speed and then high speed neutral gear coast down tests per SAE standards… something that car magazines and other testers do on a regular basis. Solving the force balance for Fd is what will allow me to derive and map the torque output of the motor.
Fd is the tricky one (for me). I really want the device to correct for road grade. My first thought was to use the z-axis of the accelerometer to calculate the angle based on the arcosine of the g-value. Then I realized that, while this will give me the angle, it will not tell me if that gradient is positive or negative. I can’t use the arcsine of the x-axis unless the vehicle is in steady state. Research has pointed me in the direction of using GPS to calculate the grade. I should be able to output horizontal and vertical velocities to the Arduino and take the arctangent of Vv/Vh. The GPS would only need to be polled at 1Hz max since logging would generally be done on relatively level and smooth roads where the gradient does not change rapidly. Also I’m in Florida, so there aren’t too many hills here anyway ![]()
I’m thinking I might use a Due for 32-bit capability and to allow for future expansion & CAN-bus capability, along with one of the accelerometers available from SparkFun or similar. I have no idea where to start looking at GPS as this is my first time working with it really. I would love some input. Does everything here sound reasonable and doable? Is there a single sensor that I don't know of that will do the acceleration and grade in one shot? Is this noob in over his head?
Thanks for sticking around for the long-ish read.
