View unanswered posts | View active topics It is currently Sun Sep 21, 2014 12:14 pm






Reply to topic  [ 2 posts ] 
How to log multiple values ROBOTC/NXT and make decision 
Author Message
Rookie

Joined: Tue Jan 31, 2012 11:27 pm
Posts: 1
Post How to log multiple values ROBOTC/NXT and make decision
I am trying to get through a tunnel like obstacle and I usually stick to just coordinating time with power, but I would like to kick it up a notch and have an ultrasonic scan both the left and right walls and have it store 2 or more values. From there I would like it to make a decision whether my robot needs to veer right or left until both sides are aligned. How would I go about that? sample code would be awesome, if not, can you guys throw some terminology that I might be able to look up.

Here is what I want it to do (simplified version):

Scan left, readDistance, storeLeftDistance
Scan right, readDistance, storeRightDistance
if leftSide < rightSide
moveright until leftSide == rightSide
else
moveLeft until leftSide == rightSide

Thanks guys


Tue Jan 31, 2012 11:41 pm
Profile
Rookie

Joined: Fri Jan 27, 2012 6:57 pm
Posts: 40
Post Re: How to log multiple values ROBOTC/NXT and make decision
You have a basic bang-bang control feedback loop there, but you might want to consider looking into a PID Controller:
http://www.inpharmix.com/jps/PID_Contro ... obots.html


Wed Feb 01, 2012 1:12 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.