|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: How do you do it?
Quote:
that is sort of what I had attempted to do. Our robot had adjustable shooting angle between 0 and 45 degrees freedom that was hooked up to a potentiometer. then you aimed left and right with the whole robot. what I attempted to do was make a lookup table so that if the camera was reading X on the tilt axes, it would make the shooter go to Y Degrees. I never got it to work because at first the potentiometer wasn't working correctly and then I wasn't able to figure out how to make a PID before we had to ship the robot. |
|
#2
|
|||||
|
|||||
|
Re: How do you do it?
Quote:
Only out of it we build a Linear Graph in excel, got its equation and put it in the code so the RC always knew what should be his cannon angle compared to the location of the target... Our cannon was actually based on 2 points. one stable in the back, where the balls got into it, and annother point in the other side of the cannon, which was a gear that went up or down using a spike... I believe it was using the Globe Motor. we just moved one end of the cannon up and down, while the other point is stabling it... The cannon was about half a meter long, so it ddnt create problems, but if it was a 20 CM cannon, then it would have created more problems, cause then we had to make 2 moving points beeing depandanant on each other,,,and that would have been one crazy formula... Some teams also made a rotating cannon, bout 120 degrees, meaning that they could shoot from anywhere, without depanding on their wheel position. WE didnt even try it, thought it was way too complicated for 6 members team to make... Actually, we have even removed the X-axis servo from our CMUcam2, so it only moved up and down, and didnt move left right, which made finding the target much much faster for the camera... Before the matches began and we suffered some bad ramming, u could actually see our camera moving along with the cannon, as if they were using the same servo (BTW thought of giving them the same servo and attaching them, but gave it up, dont remember why ). |
|
#3
|
|||||
|
|||||
|
Re: How do you do it?
Our robot last year was designed to not move, and so most of its operations were supposed to be autonomous.
Of course, there were issues that prevented this idealized vision. However, it should give you an idea of how it works. Here's how I recommend approaching the issue. Autonomous and user mode just change where you get your inputs. They should be feeding the same routines. This allows you to use any advanced stuff you develop in both autonomous and user mode. These common routines, hardware control code, should present a fairly high-level interface. Saying that numbers are in m/s is a little excessive, but you should be getting an idea. Last year's robot followed this, even though most of the inputs were for override modes. (And we had plans for things like power management and such. "These devices should be killed when voltage gets this low", etc.) As for autonomous: Don't code at the lowest level you can. Instead, code at a higher level. Write functions to handle all the fancy bits. Don't implement the "drive n feet" code 5 times. You don't have to go all-out with the scripting stuff from kevin. The single most helpful tip: Writing too many helper functions/macros is better than not enough. |
|
#4
|
|||||
|
|||||
|
Re: How do you do it?
So are you saying that it is bad to have the infamous
Code:
pwm01 = p1_y; pwn02 = p2_y; If I did use the velocity control (which I now fully intend to implement this year) I would use a lookup table for joystick values matching to velocity settings. But like I said, that seems a bit overkill. A little off-topic, but I have to teach a newbie this year, and I want to do some really advanced stuff. Should I walk him through it at the expense of getting it done, or do I go as fast as I can like I would if I was doing it by myself, and explain later? I just see advanced programs hard to do when I am programming to teach. JBot |
|
#5
|
|||||
|
|||||
|
Re: How do you do it?
Quote:
Code:
#define SetVelocity(left,right) pwm01 = left, pwm02 = right Quote:
This is especially helpful the drive motors are not symetric--they're biased. Just one word of advice. If you get into fancy motor control loops, I recommend calibrating the victors to absolute. Subtle bugs appear when 127 - 7 drives but 127 + 7 doesn't. You can use my small program to do this. Last edited by Astronouth7303 : 03-01-2007 at 17:46. Reason: Fixing typos |
|
#6
|
|||||
|
|||||
|
Re: How do you do it?
Quote:
Anyhow, if I'm going to be calling a SetVelocity function at all, I'm going to write a feedback loop, or at least a PWM output-to-velocity lookup table because it's fun to be exact (whoo, I guess my obsessive-compulsive is taking over ).Quote:
Quote:
)Thanks, JBot |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scary Awesome Autonomous Modes | Dan Richardson | Championship Event | 18 | 26-06-2006 09:34 |
| EasyC autonomous modes | TubaMorg | Programming | 25 | 12-04-2006 22:53 |
| Rookie autonomous modes | StephLee | General Forum | 6 | 30-04-2005 13:16 |
| Autonomous modes? | Buster | Robotics Education and Curriculum | 4 | 17-03-2004 15:56 |
| Alternative autonomous modes | Jon Reese | Programming | 1 | 14-01-2004 13:17 |