|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Little help Please
Does anyone have any dead reconing code they could post inorder to give me some ideas that could lead to a working dead recogning code i continullay draw blanks when i go to write the code? how do i set up the timing as far as knowing how many loops or second can past i know i've seen post talking about the timing but i could use a clarity as far as they go.
Thank you, John. im sorry if this seems like a repeditive post but im having alittle trouble conceptualizing. |
|
#2
|
||||
|
||||
|
Re: Little help Please
the timing of the loop, or how hard you tell your bot to turn when you detect you are loosing the line, depends on how fast your bot can turn, how fast its running, and whether or not you just hit one of the spots where the line changes direction.
line tracking with two sensors is simple -you space them out so the are on opposite sides of the line, and you put your robot pointing in the direction you want it to go start the robot moving straight if the right side sensor sees the line then you have turned to the left, so you tell it to turn right until it no longer sees it and same (opposite) for the other side but thats where you have to try some values, see how your bot responds, and adjust the amount of turn, the speed of the robot... there is also the possibility that the sensor will see the line, but not be able to turn fast enough, and cross over it completely (if its going too fast) all these things need to be tested with your machine and you need to tweak your settings - also, if you put more than two sensors on the bot, you can cover the possible variations with different responses. |
|
#3
|
|||||
|
|||||
|
Re: Little help Please (with dead reconing code)
Sorry, to John if it seems that I am stepping on his toes and sorry if John's post sounded a little unclear but we already have a successful line tracker that we just finished earlier today (our code is posted in "Line seeking help" ) I believe, if I remember correctly, that John is searching for the dead reakoning code where the robot operates practically blind and just follows code saying go this way for so long than this way for so much long.
|
|
#4
|
||||
|
||||
|
Re: Little help Please (with dead reconing code)
ok - am I going brain dead or did you edit your first post? For some reason I thought you were looking for line following code, but it says plain as day "dead reconing"
?! |
|
#5
|
||||
|
||||
|
Re: Little help Please (with dead reconing code)
Quote:
Last edited by Xufer : 20-02-2004 at 12:02. |
|
#6
|
|||||
|
|||||
|
Re: Little help Please (with dead reconing code)
I dont mean to be beating a deadhorse ( well really a dead post) but litterally ANYTHING that somebody out there in CD land would EXTREMLY help us with our dead reaconing. So plz if anybody could give us SOMETHING on dead reakoning we all would be very much appreciative...
P.S. I'll hook ya up at UTC regionals or Nats with some trinkets or stuff if it works or helps |
|
#7
|
|||
|
|||
|
Re: Little help Please (with dead reconing code)
Ok, I don't have any exact code on hand, but our bot from last year ran on only dead reconing. There are a few things you need to take into concideration:
1) Timing vs. absolute positioning 2) Does the bot drift? Can you stop that? 3) Acceleration/deceleration and it's effect on the bot Learning from last year, doing dead reconing based soley upon time is a bad idea. Our primary problem was drift. On paper, our timing worked, but because when we turned one motor wasn't powered, it drifted and threw everything off. In other words, saying pwm13 = 254 for half a second isn't a good idea. What I would recoment would be a way of absolute postitioning. Instead of relying on time, give your bot a way to know exactly ( not using time x speed) of where it is. One way to do this is by using encoded sensors (such as in a mouse). By making your axis spin an encoded sensor that is hooked up to the FRC, the bot can tell how many revolutions it has traveled. By using some simple algebra using your wheel radius, you can find out how far you travel with each revolution. You can also do a few neat things with this. For instance: 1) if your bot is stoped, and someone pushes it, the bot can sense that and pe programmed to fight back 2) you can use it to prevent drift. If pwm 13 is @ 127, and another is @ 254 (simulating a turn like a tank), then the bot can sense if it's drifting and can either prevent it by fighting back or can make up for it. So basically, now that you're armed with this knowledge, you can beging to program some dead reconing code. You can (using coded discs) tell the bot to go x number of revolutions @ a certain speed as opposed to telling your bot to travel at speed 254 for 2 seconds. I'm not sure how clear this is going to come across, but I'll be sure to check this thread again. Feel free to PM me. ~Brian |
|
#8
|
||||
|
||||
|
Re: Little help Please (with dead reconing code)
I had thught abot the possibilitie of drifing as well as the costing from the winding down of or motors but i plan on settin a small revers flow for .2 seconds inorder to have the motor wind down quicker then turn. i do need to know how to get a motor running for so many second then stop becuaewe need to raise our arm durring autonomous mode aswell as get it to swing to remove those 10 point balls and i want to have a backup autonomus just incase our line seeking doesnt work. I have been toying with IR but, im not exactly sure how to implement the IR beacon tracing, it seems s though the robot would not work as exact.
what i really need to know is how to: 1. get a motor to spin for X-many seconds at Y-many speed 2. get each line to execute at the right time. 3. get the code to execute 2 lines a the same time for differnt lengts of time and power all of which im havng trouble figuring out, so if anyone could give me a hand i would appreciate it !! Last edited by Xufer : 20-02-2004 at 22:15. |
|
#9
|
|||||
|
|||||
|
Re: Little help Please (with dead reconing code)
Aren't there some wait functions somewhere? those would do nicely.
|
|
#10
|
||||
|
||||
|
Re: Little help Please (with dead reconing code)
I dont have any C code for dead rec, but I can psudeo code for you and you can map it into C
if autonmode = false then /* initialize the auton variables*/ begin sequence = 0 autontime = 0 end else /* do the auton stuff */ begin autontime = autontime+1 /* increment the loop counter */ if sequence = 0 then begin motor pwms = 254 /*full speed, or whatever you want for the 1st step*/ if autontime = 40 then /* this step happens for 40 loops */ begin sequence = sequence + 1 /* next sequence next time */ autontime = 0 /*zero the loop count */ end endif else if sequence = 1 then /*the next step*/ begin right motor pwm = 0 /* turn hard right */ left motor pwm = 254 if autontime = 10 then /* this step happens for 10 loops */ begin sequence = sequence + 1 /* next sequence next time */ autontime = 0 /*zero the loop count */ end endif else if sequence = 2 then /* ect ect ect */ ...... get the idea? have a variable that tells you which step of your sequence you are in, and have a variable that tells you how many times you have gone through the loop, and end that step when you have repeated it for a certain number of loops this is dead rec - you have no outside info telling you how fast you are actually moving, how far you have turned - you have to use trial and error to test this with your bot and tweak the motor pwm settings for each sequence step, and tweak the autontime equality 'if' for each step, to get the bot to more or less go where you want it to go. also, within each step you can turn other motors, or relays on and off, depending on what you want your machine to do at each step. make any sense? |
|
#11
|
|||||
|
|||||
|
Re: Little help Please (with dead reconing code)
here's a hint - don't turn. just go in a straight line. the wall is your friend.
edit (I am completely serious) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|