Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

proximity sensing

Status
Not open for further replies.

kfas

Student
Mar 25, 2021
2
I need help to convert the following derivative integration pseudocode for proximity sensing to a matlab program

X[i-1] = X[0]
I[i-1] = 0
Loop1:
D = X - X[i-1]
Is (ABS(D) greater than DT)?
true:
I = I[i-1] + D
else:
I = I[i-1]
Is (I H/d)
true:
Object detected
I[i-1] = I
else:
Object not detected
I[i-1] = I*L
 
Replies continue below

Recommended for you

What have you come up with so far? Where does it break?


Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Your pseudocode, as shown here, has typos in. Also believe it or not some idea of what the varibales are would help.


Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
I did zero verification if the algorithm itself was of any use... I just expect to see some work on the part of the student before offering feedback. I didn't see that here, just a cut and paste from a datasheet. Not attempt to actually code it, or show errors in trying to run said code.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
It is obvious Texas Instruments used it in whatever machine they wanted.From their documentation they could have corrected whatever errors it has.
 
I didn't say it had errors. i said it didn't seem to perform very well, after about 30 minutes of tuning.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor