-
https://x-engineer.org/calculate-wheel-vehicle-speed-engine-speed/
-
https://www.circuitmagic.com/arduino/diy-digital-rpm-tachometer-with-arduino/
PiRacer’s both wheels have the same radius This means that:
where $ω_w$ [rad/s] is the common wheel rotational speed.
Since both vehicle and wheel move together, the vehicle speed is equal to the speed of the wheel. So if we calculate the wheel linear speed, we also have the vehicle’s speed.
Where
The speed of the gearbox output shaft is equal with the engine speed divided by the gear ratio:
The rotational speed of the differential crown wheel is also reduced, being equal gearbox output shaft speed divided by the differential gear ratio:
The left and right wheel speeds are equal with the differential speed:
Combining all above equations, gives the formula for wheel speed function of engine speed:
For engine speed, the conversion from rpm to rad/s is done as:
Where
The wheel’s linear speed is calculated function of rotational speed and radius as:
Combining equations, gives the expression of the vehicle and wheel speed function of engine speed and gearbox and differential gear ratios:
If we want to have the speed in [kph], the formula becomes:
Due to the speed sensor’s structure, I could only find the rpm of the crankshaft.
Where
Then you can get
Combining equations, gives the formula for engine speed including crankshaft speed
To get vehicle speed, we need below variables:
-
$N_k$ [rpm] - rpm of crankshaft -
$i_o$ [-] – gear ratio of the differential -
$r_w$ [m] - radius of wheel
First, install pulse at the crankshaft to get the rpm. For rpm of crankshaft, the formula is done as:
Where
Where
Second, count number of gear teeth to get gear ratio.
I counted number of differential gear teeth.
Last, wheel radius is 2.3 cm, but it must be converted to meters:
Now, I have all the variables I need for the equation:
This is an arduino code to calculate the vehicle speed and rpm.
If you want to get max RPM of motor, you should know
Combining equations, gives the formula of engine RPM:
So if you get max