Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   How to get the robot to stop... (http://www.chiefdelphi.com/forums/showthread.php?t=33130)

KoRnPoP 20-01-2005 14:58

How to get the robot to stop...
 
Does anyone know how to get the robot to stop in autonomous mode with out using script?

Ryan M. 20-01-2005 15:04

Re: How to get the robot to stop...
 
I'm not sure if you're trying to stop the robot using software (as in, if we run into something stop) or if you mean that you want to be able to kill the robot in mid-stride because you can tell it's just about to rip its arm off. :D

For the first thing, you just have to set the variables pwmXX and pwmXX to 127 in your code, where the two XX is where your motors are hooked up.

For the other option, which only works when you're on your practice field, you build a dongle, which is basically just a few stiches which connect/disconnect a few pins on the competition port on the operator interface. I'm not sure right now exactly where those are, but there is lots about them here. Do a search. :)

steven114 20-01-2005 15:57

Re: How to get the robot to stop...
 
while(1);
Works every time! :D

RIgnazio 20-01-2005 16:27

Re: How to get the robot to stop...
 
Quote:

Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!
Love it!
Ok, anyways, back to the making the robot stop. In autonomous mode, what I find that works best is at the end of the loop, use
Quote:

else
{
pwmXX = 127;
pwmXX = 127;
}
where XX is your PWM number. Now, you can create a little snippet like this:
Quote:

#define pwm_neutral 127
What that will do is let you use pwm_neutral and it will equal 127. If you don't like working with numbers, that is. I also do a
Quote:

#define pwm_max 254
#define pwm_min 0
for max and min speeds.

buss 20-01-2005 17:33

Re: How to get the robot to stop...
 
Last year my team (S.P.A.M. #180) ran into a serious problem during autonomous. If we ran into something and the robot didn't fix itself, we would continue driving forward and start to burn holes into the carpet. If you have some sort of motion sensor (be it an accelerometer or something equivalent) have a counter going that adds 1 every loop. Each time the sensor returns data, have it zero the counter. So if the sensor doesn't return anything (I.E. you're not moving) then the counter will count to whatever you have set as the max. When it reaches the max, set the motors to neutral (127). This bit of code kept us from being disqualified for field damage for at least five matches during one regional.

That may not be exactly what you're asking for, but its good none-the-less.


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

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