Go to Post Well i guess the only thing left for me to do is tip my hat and call Karthik, Chris Hibner, EricH and Bill Gold my daddy. - JackN [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #23   Spotlight this post!  
Unread 17-02-2003, 11:47
TOHSlancer TOHSlancer is offline
Registered User
no team
 
Join Date: Jan 2003
Location: Thousand OAks
Posts: 12
TOHSlancer is an unknown quantity at this point
Hey, errrm there's a robot emulator out there. go to the innovation first website. It's a good way to test if your code is messed up or not. Can't really predict turning and stuff because that's all based on your robot, but it helps.

Oh really? Nobody got their working on 3 sensors? Ours works decently. I just did some testing on carpeting last night.
We just had to space the sensors right, and coding wise I did some stuff that works pretty well. 5 sensors would've been nice to work with tho. Man. Right now I just gotta tweak code so that it doesn't just turn right when it hits the top of the ramp.


example:

Code:
do_autonomous_stuff:


' sensor1 sensor2 sensor3
course3 = 0
if (sensor1>127) then too_left
if (sensor3>127) then too_right
'straight on line
drive_L =145
drive_R = 145
course2 = 3
course = 1
goto perfect


'===================================
'===================================
'===========Too left===============
'===================================
too_left:
'===========================
'--------Semi Off ----------
'============================

if (sensor2>127) then drive_R = 113	
if (sensor2>127) then drive_L = 155

'checks to see if swinging back 
if (sensor2>127) and course2 = 1 then course3 = 1

'sets course status
if (sensor2>127) then course2 = 0

'======================
'-------Way Off--------
'=======================
if (sensor2<=127) then drive_R = 103
if (sensor2<=127) then drive_L = 155

'checks to see if swinging further
if (sensor2<=127) and course2 = 0 then course3 = 2

'sets course status
if (sensor2<=127) then course2 = 1

'adaptable course timer
if (course < 170) then course = (course +1)
if (course = 171) then course = 171

'checks previous sensor status and adjusts accordingly
if (sensor2>127) and course3 = 1 then course = (course - 90)
if (sensor2<=127) and course3 = 2 then course = ( course - 70)

'adjusts motor values
if (course >= 39) then drive_R = (drive_R - ((course - 39)/10))
if (course >= 39) then drive_L = (drive_L + ((course - 39)/12))
goto perfect




'===================================
'===================================
'===========Too Right===============
'===================================
too_right:
'===========================
'--------Semi Off ----------
'============================

if (sensor2>127) then drive_L = 113	
if (sensor2>127) then drive_R = 155

'checks to see if swinging back 
if (sensor2>127) and course2 = 1 then course3 = 1

'sets course status
if (sensor2>127) then course2 = 0

'======================
'-------Way Off--------
'=======================
if (sensor2<=127) then drive_L = 103
if (sensor2<=127) then drive_R = 155

'checks to see if swinging further
if (sensor2<=127) and course2 = 0 then course3 = 2

'sets course status
if (sensor2<=127) then course2 = 1

'adaptable course timer
if (course < 170) then course = (course +1)
if (course = 171) then course = 171

'checks previous sensor status and adjusts accordingly
if (sensor2>127) and course3 = 1 then course = (course - 90)
if (sensor2<=127) and course3 = 2 then course = ( course - 70)

'adjusts motor values
if (course >= 39) then drive_L = (drive_L - ((course - 39)/10))
if (course >= 39) then drive_R = (drive_R + ((course - 39)/12))
goto perfect



perfect:

'sensor check
if sensor1 > 127 then out10 = 1
if sensor1 <= 127 then out10 = 0
    
if sensor2 > 127 then out11 = 1
if sensor2 <= 127 then out11 = 0

if sensor3 >127 then out12 = 1
if sensor3 <= 127 then out12 = 0

'course check
if (course > 1) then out13 = 1
if (course = 1) then out13 = 0

Last edited by TOHSlancer : 17-02-2003 at 11:50.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A better autonomous method.. randomperson Programming 4 24-02-2004 18:02
crazy idea for autonomous Mike Ciance Programming 16 24-04-2003 21:50
autonomous location manodrum Programming 4 02-04-2003 08:05
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
Autonomous Kill Switch UCGL_Guy Programming 8 15-01-2003 17:39


All times are GMT -5. The time now is 00:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi