
Originally Posted by
Kenjones1935
I have been multiplying by .066 (in my head). Give or take a decimal point. I want to be able to READ the EEPROM and see inches. Not easy?? Is there a PBP routine that does this?
I think its this easy:
Code:
inchesfront = rangefront/148
write SomewhereInEEprom,inchesfront
inchesright = rangeright/148
write SomewhereElseInEEprom,inchesright
To get the result from EEprom:
Code:
read SomewhereInEEprom,frontanswer
read SomewhereElseInEEprom,rightanswer
My interrupts are once every 5 millisec. I count 25 of them between each SONAR trigger. They are 125 millisec apart. The servos do work well with properly timed pulses, but they do not seem to react any quicker or with any finer precision. I have no accurate means of measuring this.
Ok, first I have demonstrated my inability to do simple math somewhere in some posts about your sonar timing. But no matter. Heres whats going on right now. you trigger every other sonar 125 mS apart, so if only talking about the right sonar for now, it is triggered every 250 mS, or 4 times per sec. I think that is just too slow!!!. your steering servo can and does react fast enough, but it gets the same signal 12 times before you have a new range to adjust with. So thats 6 missed opportunities to get a better correction.
Thank you for thinking along with me. My computer experience was all digital data communication. Ultimately I retired from CISCO. I know nothing about real time control systems.
Ken
its all fun for me, I am learning PBP far faster this way so its mutually benifical for both.
And BTW, I switched majors in collage because I didn't want to learn the communication side of electronics. Something about "transform anaylases" just scared me
Bookmarks