I am an A2 student that is making a rolling road for a Greenpower race car.
I currently have a system that allows me to count RPM using a opto-isolator but need to change RPM into meters per second. The formula I have is:
V = radius in meters*RPM*0.10472
The problem I am facing is trying to find a way to implement the 0.10472 as I do not know how to make an accurate decimal of this length.
I am using a 18M2 chip
The radius of the wheel is 0.26m
The RPM range is 0-504 which is equivalent to 0-30mph
A preference would be then to output m/s in mph. To convert to mph I have to do m/s*2.23694 (another decimal!)
Solutions:
Currently I have tried to use the b0 variables to produce the decimal however this doesn't work because I am getting an output of 0.165;
b0=104
b1=1000
b2=b0/b1
b3=b0*1000/b1//1000
serout b.0,n2400,(254,1,254,128,#b2,".",#b3)
end
Another option I have is to use the uM-FPU V2 chip which I have looked at but have found it is a bit out of my league.
Thanks in advance,
JordanR
I currently have a system that allows me to count RPM using a opto-isolator but need to change RPM into meters per second. The formula I have is:
V = radius in meters*RPM*0.10472
The problem I am facing is trying to find a way to implement the 0.10472 as I do not know how to make an accurate decimal of this length.
I am using a 18M2 chip
The radius of the wheel is 0.26m
The RPM range is 0-504 which is equivalent to 0-30mph
A preference would be then to output m/s in mph. To convert to mph I have to do m/s*2.23694 (another decimal!)
Solutions:
Currently I have tried to use the b0 variables to produce the decimal however this doesn't work because I am getting an output of 0.165;
b0=104
b1=1000
b2=b0/b1
b3=b0*1000/b1//1000
serout b.0,n2400,(254,1,254,128,#b2,".",#b3)
end
Another option I have is to use the uM-FPU V2 chip which I have looked at but have found it is a bit out of my league.
Thanks in advance,
JordanR
Last edited: