Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   intermdiate programmer requests your help!!! (http://www.chiefdelphi.com/forums/showthread.php?t=63192)

mayazk 03-02-2008 14:09

intermdiate programmer requests your help!!!
 
HI to all and thanks to those who help me! (VIEWRERS DO NOT COUNT ONLY REPLIERS OK VIEWERS COUNT)

MY QUESTIONS:( AND RESULTS:cool:
so the arcade motor stands for what?
y axis = speed and x=steer got it!

TODAYS STEPS
TODAY WE HHOKED UP 4 VICTORS AND 1 VICTOR TO A MOTOR NOW THE MOTOR WAS CONNECTED TO A ROD WHICH WAS HOOKED WITH ANOTHER MOTOR THE ROD WILL ACT LIKE A PULLEY SYSTEM

NOW WHAT I WANT TO KNOW IS

IS THERE ANYWAY THAT I CAN INCREASE THE SPEED OF THE MOTOR AND IF SO WHAT IS IT?

ALSO I WANT TO LEARN MORE ABOUT THE AUTONOMUS MODE AND HOW TO SET IT UP??

I WANT OUR ROBOT TO GO STRAIGHT 13 AND A HALF FEET LIFT ITS CLAW AND WERE GOING TO INCLUDE A LIMIT SWITCH A LITTLE BIT MORE LIGHT ON THAT SUBJECT WOULD BE KIND!

THATS ALL FOR NOW FOLKS AND I KNOW IM BEING BOSSY BUT IT WOULD HELP ALOT IF I GOT QUICK REPLIES ILL BE POSTING EVERY TUESDAY,WEDNESDAY,FRIDAY AND SATURDAY BECAUSE OF THE SHORT TIME IT WOULD BE A GREAT HELP IF YOU GAVE SOME QUIICK REPLIES

THANKS ALOT FOR UR HELP!!!!

jacobhurwitz 03-02-2008 14:13

Re: intermdiate programmer requests your help!!!
 
Quote:

Originally Posted by mayazk (Post 691407)
HI to all and thanks to those who help me! (VIEWRERS DO NOT COUNT ONLY REPLIERS OK VIEWERS COUNT)

MY QUESTIONS:( AND RESULTS:cool:
so the arcade motor stands for what?
y axis = speed and x=steer got it!

TODAYS STEPS
TODAY WE HHOKED UP 4 VICTORS AND 1 VICTOR TO A MOTOR NOW THE MOTOR WAS CONNECTED TO A ROD WHICH WAS HOOKED WITH ANOTHER MOTOR THE ROD WILL ACT LIKE A PULLEY SYSTEM

NOW WHAT I WANT TO KNOW IS

IS THERE ANYWAY THAT I CAN INCREASE THE SPEED OF THE MOTOR AND IF SO WHAT IS IT?

ALSO I WANT TO LEARN MORE ABOUT THE AUTONOMUS MODE AND HOW TO SET IT UP??

I WANT OUR ROBOT TO GO STRAIGHT 13 AND A HALF FEET LIFT ITS CLAW AND WERE GOING TO INCLUDE A LIMIT SWITCH A LITTLE BIT MORE LIGHT ON THAT SUBJECT WOULD BE KIND!

THATS ALL FOR NOW FOLKS AND I KNOW IM BEING BOSSY BUT IT WOULD HELP ALOT IF I GOT QUICK REPLIES ILL BE POSTING EVERY TUESDAY,WEDNESDAY,FRIDAY AND SATURDAY BECAUSE OF THE SHORT TIME IT WOULD BE A GREAT HELP IF YOU GAVE SOME QUIICK REPLIES

THANKS ALOT FOR UR HELP!!!!

Please don't write in all caps. It's distracting.

In tank drive, left y-axis is left motors, right y-axis if right motors. Both forward means robot goes forward, one forward and one backwards means the robot twists on its axis.

In arcade drive, y-axis is fowards/backwards and x-axis is twisting.

To increase the speed, you have a few options. If you use WPILib and a function like TankDrive() or ArcadeDrive(), then how far you push the joystick changes the speed. If you want to code it yourself, send the motors a value from 0 to 254 for various speeds (with 127 being neutral). Search Chief Delphi and I'm sure you can find lots of sample code for this.

For autonomous mode, I recommend WPILib. It's very simple and easy to understand for beginners. You just have an AutonomousCode() function that's executed during autonomous mode. See WPILib's website for details.

In summary, welcome to Chief Delphi! But please be more polite, and always search for an answer to your question before you ask it.

psy_wombats 03-02-2008 14:16

Re: intermdiate programmer requests your help!!!
 
Alright...

Motor Speed: You can't get a motor to go faster than it can mechanically move. So if you're assigning the PWM 255 or 0, there is no way to get it increase its speed... Unless you redo your gearing and select a different gear ratio.

Autonomous: Can't help you much here. You'll want to be more specific on what sensors you are using. What exactly will your limit switch be? To drive for a certain number of feet, you need at least a geartooth sensor hooked up. Then just measure the amounts. There are plenty of GTS threads floating about. Search for specific issues.

And in the future, please don't use caps locks... It makes your post very hard to read, and decreases my chance of reading it. Thanks.

kevin.li.rit 03-02-2008 14:22

Re: intermdiate programmer requests your help!!!
 
a limit switch is pretty simple. You plug it into the digital inputs and look for it to be pressed, when it is pressed it creates a 0 signal.

if(!rc_dig_in07)// if limit switch is pressed
{ pwm05=127;//Stop arm!
backuparm(); //use a function here to back up the arm so it no longer hits the limit switch.
}

There Many ways to use a limit switch...

paulcd2000 03-02-2008 14:44

Re: intermdiate programmer requests your help!!!
 
and your limit switch will depend on how it's wired. 1 could be open or closed depending on the wiring. test with a multimeter first. for the 13.5 feet part, use encoders (might be hard), or measure the time that it takes your robot to go 13.5 feet and use timers (sample code):

Code:

int time;
if(time<115){ //this is about 3 seconds, 1 is 26.2 milliseconds
    pwm01=pwm02=254;
    time++;
}
else{
    pwm01=pwm02=127;
    if(!limit_switch){ //again, remember the wiring thing
          claw_motor=254; //redefine claw motor, and this is assuming that 254 is up, and that ur not using a relay
    }
    else{
          claw_motor=127; //same deal
    }
}


mayazk 09-02-2008 21:59

Re: intermdiate programmer requests your help!!!
 
Thanks and i apologize for the all caps i thought its more of making a point than distracting so im sorry!
I understand the limit switch, now what about the autonomus period how is the robot suppose to even move?? Am i suppose to use Tank 4 drive for it too or what?? and if so how?

thanks

1jbinder 09-02-2008 23:28

Re: intermdiate programmer requests your help!!!
 
In autonomous mode you will need encoders to measure distance. We are currently controlling our motors with a PD loop and not direct PWM control but if you want to set your to drive motors(plugged into outputs 1 and 2) forward this would be the command:
pwm01=255;
pwm02=255;
Use Kevin's default code at kevin.org for you robot. In the autonomous.c file in the project open up the autonomous function and write the code there. In future posts you should probably call yourself a beginner FRC C programmer because it will make it easier for people to fix your posts. Anyways i hope this works for you.
Julian

mayazk 11-02-2008 15:36

Re: intermdiate programmer requests your help!!!
 
hey guys
quick question

is there anyway to program the buttons on the joystick??

quick reply is appreicated

thanks alot

kevin.li.rit 11-02-2008 15:47

Re: intermdiate programmer requests your help!!!
 
Yes You can do something like.
relay1_fwd = p1_sw_trig;
relay1_rev = p1_sw_top;

or
if(p1_sw_trig)
{relay1_fwd=1;
relay1_rev=0;
}
if(p1_sw_trig)
pwm07=235;

Look on the OI reference guide for all the button definitions.


All times are GMT -5. The time now is 23:43.

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