|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
I want to use a servo to rotate the optical sensor. When the sensor variable switches on, I want the chassis to turn the exact degree of the servo. (My engineer says to forget about it, so I need to do this quick before we rule it impossible
). Anyway, How do I get input or anything to control the turn degree on the chassis?? We have tank drive so it seems harder than the one joystick drive system we had last year.I'm extremely thankful for any help I can get, and thanks 47 for the great site. mjt |
|
#2
|
||||||
|
||||||
|
One thing you could do would be mount three optical sensors next to each other, spaced a few inches apart, with all three rotating together.
Then, once you get a "lock-on" from moving the servo, start turning in the direction that the servo is pointing. As you turn, move the servo so that only the center optical sensor sees the target (ie if the left sees it, move the servo left). Doing this, the servo will eventually line itself up with the robot. |
|
#3
|
|||
|
|||
|
perhaps you are attacking the problem the wrong way. We'll probably do this on our robot, so I'm hesitant to share, but mount the optical sensor in a fixed position and turn the robot until the sensor input changes. Once you have a "lock" just drive straight forward, the turning will already be done. I plan on scanning while following the white line.
|
|
#4
|
||||
|
||||
|
Once you detect the tape, you could rotate the servo back toward the center of the robot (the axis going from stern to bow) a couple degrees, turn the robot until the sensor reads true again, and rinse and repeat until the servo reads that it is pointing straight forward.
Last edited by Mongoose : 07-01-2003 at 23:03. |
|
#5
|
|||
|
|||
|
white tape?
hrm...i'm under the impression that the tape on the carpet is white....or so i have read from the manual, is it white or reflective?
Last edited by chewie : 08-01-2003 at 12:27. |
|
#6
|
||||
|
||||
|
white
|
|
#7
|
|||
|
|||
|
white hrm...
so, i'm guessing the sensors are sensitive enough to detect the white surface, even though it is not as reflective as the reflective tape on the boxes?
|
|
#8
|
||||||
|
||||||
|
In theory, yes. However, you will definately need to experiment with the correct gain setting (that little dial on the back) and the distance from the ground to find the optimal setting such that it reflects on the white but not on the carpet.
|
|
#9
|
|||
|
|||
|
Anyone used the boe-bots? I am new on my team, and there was an option for new members to take a summer school course where out final test was to use optical sensors to follow a black line on a white surface and be able to turn off the sensors and skip over some white. That was fairly simple, and we had to convert the pre-given white line follower to make it follow black.
|
|
#10
|
||||
|
||||
|
Re: Sensor Tracking the Boxes
Quote:
Our solution however, was a variable gain sensor that would allow us to track the rotation of the light sensor. When we tested it the only problem was the detection range and width of the containor strips. At distance, you have to "hit" the tape on the containers almost exactly with your sensor's line of sight, and it has to stay in the line of sight long enough to register in your programs loop. Good luck with it if you try it. |
|
#11
|
|||
|
|||
|
Don't forget our wonderful yaw rate sensor. I've used it in an application that could be equated to this, and it did it within a couple of degrees accuracy. I'm not sure if this is the solution my team is going to use or not... our (hopefully) unique chassis might offer another possibility
![]() |
|
#12
|
|||
|
|||
|
To anyone that still cares about my original post:
I asked my math teacher how to figure distance based on a single angle. I found that to be impossible. Howver, if I read from the first sensor switch to on, then at the sensor switch to off, and move foward on the half angle an alotted distance, the process can be simplified. After moving foward an alotted distance, I take two more readings and parts of the imaginary triangles are revealed using law of sin and other stuff. This is necessary for the distance you want to travel to the boxes only if you want to pick them up. Anyway, if you want an expanded explanatyion, just post and ask for it. |
|
#13
|
|||
|
|||
|
The problem with that solution is that PBASIC doesn't have trigonometry support. At least, I'm pretty sure.
|
|
#14
|
|||
|
|||
|
You can always do trig with calculus using functions pbasic does support, altho you'd probably end up slowing the processor down so much that your execution time would provide noticable lag in doing anything
Tyson |
|
#15
|
|||||
|
|||||
|
To find distance is pretty hard in PBASIC, anyways. We thought about it last year, but threw it away after realizing it would take up like 3 or 4 words. If you recall last year's kickoff, they had a crazy contraption with four light sensors on it, three stationary rotating on an axis and the fourth on top of them, rotating the light up and down. You could use this to find an angle between the ground and the top of the bin.
You could do all of this by finding the angle between flat and the top sensor, and finding the hypotenuse. However, sin, cosin, and tan are all unsigned integers in a word in PBASIC. However, if you didn't care about any of that, you could just chase down a bin by putting a pot on the robot, attaching the knob to your sensor array, and turning the robot untill the pot was 127 or whatever value is lined up. Last edited by Skabana159 : 09-01-2003 at 15:59. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dimensions of the kit boxes | Jean McAuliffe | General Forum | 2 | 24-06-2003 00:40 |
| sliding boxes | Jeff Rodriguez | General Forum | 11 | 11-03-2003 00:24 |
| breaking boxes | illumanat'i | Rules/Strategy | 6 | 19-01-2003 15:44 |
| question on launching boxes | 2PI4Julia | Rules/Strategy | 4 | 18-01-2003 10:17 |
| plastic boxes | Suzy | General Forum | 6 | 12-01-2003 03:27 |