Thank you so much Alain for the links! To be perfectly honest my math skills are not good enough to write the formula so a PIC can process it.
Hope you and your family and friends also have a great Christmas and a Happy New Year!
Best, Ed
Thank you so much Alain for the links! To be perfectly honest my math skills are not good enough to write the formula so a PIC can process it.
Hope you and your family and friends also have a great Christmas and a Happy New Year!
Best, Ed
Hi, Ed
as the speed range will be limited ( even for Red October !!! ), I think you'd better use a retrieve table plus linear interpolation.
the 32 bits square root calculations needing too much CPU time ... for the expected result
( and I hope your sub' not used in sea water or "not so clean " water ... you might use a different density coeff : http://www.csgnetwork.com/h2odenscalc.html )
may be you also could have a look for a possible temp coeff use ...
Wish you all the best
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Thanks Alain!
I do have and can add a seperate temperature sensor for the same PIC and the sub only run in swimming pools, ponds, and lakes with clear water. According to the fine fun folks at Eagletree systems I could never reach the top speed in water as the 0-2 psi range is for airplanes and speedboats. They use a "strange" calculation method they do not wish to disclose. Good catch by the way! My sub is very close to the sub used in the movie "The Hunt for Red October" which is a Russian Typhoon! So what would the caculation code look like?
Best, Ed
Russian joke aside, make your own algorithm.
Write up code to set up your sub to go X speed for Y amount of seconds. X speed meaning a set number for the duty cycle controlling the prop. Make sure Y is long enough for speed to stabilize then save the PSI measurement. Increase X a couple of times, each time saving psi data. You will make your own plot based on your data. It might not be exact according to their 'top secret' calculation method but you shouldn't care. Its all relative. You measure then associate a number with the PSI settings.
If you want to be trick, make your own speed trap using another Microchip and a couple of sensors to make your own algorithm. That might be a bit overkill.
Simple speed trap:
Tie a magnet at the end of a length of string.Then you have a simple repeatable way of calculating distance travelled over time while you tweak your formulas.
Place a residential alarm switch inside the tail of the sub.
Apply a metal plate using tape over the switch.
Extend the plate beyond the prop to protect the string.
Monitor the switch from your PIC.
Edit: watertight, with no holes to plug up later either.
Robert
Thanks guys!
I will not receive my pressure sensor until after the first of the year.I have set up a way to test pressure vs speed with a tub of water and a motor attached to a shaft that spins in the water and travels a known distance with a stop watch that starts and stops at rev.
All my best, Ed
Bookmarks