Programming the last thing a robot does...

Has anyone attempted to do a “last move” type of thing with their robot? Such as, at the very last second of the match, I would like to have the robot set itself back into a mode which would make it easier to carry, safer with less stored energy… etc.

Other than having a counter, and after 2:14 of counting… is there any other way to accomplish this? :confused: Let me know if you or your team has done this in the past, or if its completely unprecedented. Thanks in advance.

You could do this with a counter, or you could have the strategist watch the clock and have the driver press a button to go back to whatever position you want.
Joey

having someone do that manually is something I’d like to avoid. however, it may come to that.

Speaking as someone almost entirely ignorant of programming, I can only really describe things I have seen done in the past. I do know, however, that last year, the programmers were able to make our gripper release the tube whenever the robot was shut off… I will ask them more about this and get back to you.

Are you sure they programmed it? Once you turn off the bot there’s no more code.

I would’nt do this because it may be against the rulse. But if you have a function that overrides the stop command from the field controls, and in that function you could tell it to return back to how it was.
Other than that I would just use a counter.

All though it is your team’s choice, that last second may be very useful for you guys, in the sense of the game. That last second might determine who wins the game. So if you really are bored, I would just make the operator of the robot be able to control that action, instead of doing it autonomously.

When a match ends the robot is still on, its just disabled. There might be some code in disabled I could look at… see if theres anything I can tweak.

Anything our robot does in the last second, I doubt, would change the result of the game. Forgive me if I’m wrong, but I don’t believe that there are any “continuance” rules… if the robot stops and the ball is still going, the clock runs out and the ball scores, I don’t believe that counts.

Also, when I talk about “last second”, I mean the last bit of code that executes, so no driver could react that quickly, and it wouldn’t waste time during the match.

I dont know what your robot can do, but if you are trying to put the ball on at the end of the match or hurdle, and your code puts the robot back into its home position, and the ball falls off it could make a BIG difference. If you get it on top you get 12 points. That could change a match. When you say the last second, you will probably need to press it 1 or 2 seconds early, so the robot has time to move. Once it is disabled the motors stop. Have your strategist give the driver a count down of time and press the button at say 1 or 2 seconds left. This is my opinion as a programmer - I would rather just press the button because it is easier for me to do. This is my opinion as a driver - I want to push the button because if you know you cant possibly score you can just press the button, and if you could score, dont press it. Our team did this last year and it worked well. Just my 2 cents.
Joey

In the past the rule has been to let everything come to a complete rest. This year will be interesting to see how balls will be counted as they continue rolling on the field after the game is over.

There may actually be a rule about this already that I am unfamiliar with if someone can quote one that would be cool, but if not a Q&A question may be in order.

As far as moving everything back to a home postion after the match is over, if something is pnuematically driven you can always **safely **let the air out of the system, and move the components freely that are attached to them, but if it is a motor it may be more difficult unless you backdrive the motor manually (with the motors that can actually be backdriven by hand).

Always keep a tether cable handy and in the worst case scenario bring out your control panel and your tether and put your robot in the home position on the field… or carry it off the field and do it there before returning to your pit if space is a huge issue.

Hm… I would think if there was enough time for the software to contract the robot into a movable position, there would be enough time for the driver to get one last lap or hurdle in certain instances. Anyway, why don’t you use a tether once the match ends? (Wait, this is against the rules, right? Never mind.) At least you could use a tether once you’re off the field, but I guess that defeats the purpose.

Or maybe instead of a button triggering the contraction of the robot, a button that prevents it? The robot automatically folds up unless told otherwise in tight situations?

We’ve done this several times by implementing a timer (in EasyC, they provide an interface to the hardware timers, and in MPLab it’s pretty easy to write your own timer routines).

For example, last year’s robot always used the last 2 seconds of autonomous mode and teleoperated mode to attempt to score a ring (there was no sense in hanging on to it, and no sense in remembering to do it).

We’ve done variants as well, such as having a switch or button that arms a system to go off at the end of the match.

(We don’t have as many “settling time” game issues as we used to… in 2003 our robot automatically lifted itself off the floor at the end of the match by simply having a bunch of pneumatic relays release when the robot was disabled at the end of match).

There is already a ruling in the Q&A section. I think it was posted today.

When the clock is 0:00 the period is over. There are no more points to be scored, even if the ball is in the middle of a hurdle., it will not count. There are no residual point scoring actions after the clock runs out.

If your team representative(s) haven’t read the Q&A section on FIRST Forums, just do it. A lot of questions posted here have already been answered there by the GDC. They have the answers and make the final rulings.

EDIT: Sorry about the confusing answer to the original Question. From past experience, only the KEYANG motors or a worm gear cannot be driven backwards by hand. These definitely require tethering after the match if they are extended.

if using pnuematics, just put in a pressure release valve in a strategic location.

thanks for all the replies.

I talked to a couple mentors today about these ideas. What we’re going to implement is mechanical, and not coded. That way, if the robot loses power, or the e-stop button is pressed, the robot will do what it needs to do by itself.

Once again, thanks for everyones input. See you at the competition.

That’s easy: wire your pneumatic solenoid for the gripper so that the when it’s not energized the gripper is open. When the control is disabled, the user processor’s RESET pin (not the reset button) is held to ground. This puts the processor into its initial state. For more info on the initial state of the processor, see the 18f8722 datasheet.

This is very similar to how 1501 (who we were very happy to play with this past two boilermaker regionals) designed their lift mechanesim last year on their elevator robot. In it’s normal state, not energized, the solenoid gating air to their lift pistons held the robot in the ‘up’ position. As soon as the match began, they energized the solenoid to put the robot down. When the match ended, even if they forgot to hit the lift button the robot would used it’s stored pneumatic energy to lift the robot when the solenoid became de-energized as the processor entered it’s reset state.

You can get some pretty neat endgame stuff out of this. Also remember that airplane servos and motors relax when there is no pwm input (robot disabled), so if you used a spring or something you can get clever there too.

-q

Its a Good Idea but if you think about how un-predictable FIRST competitions are, that one second could cost you the championship when it comes down to it.

(That’s what it came to last year… )

JT