Log in

View Full Version : How does disabled mode work?


gnirts
13-02-2006, 07:47
I am interested in building a loop that calibrates the gyro bias while the robot is disabled.

1) Is that legal, as long as there are no PWM outputs, etc.

2) What part of the code is running while the robot is disabled? Process_Data_From_Master_uP()? main()? Process_Data_From_Local_IO()? Is statusflag.NEW_SPI_DATA ever set to true? Does that matter, if the gyro is handled in Process_Data_From_Local_IO()?

Thanks in advance,
Robinson

Alan Anderson
13-02-2006, 08:06
From the point of view of the robot code, the only thing that's different is the value of the disabled mode flag. All the routines run; all the inputs work. Serial communication, analog inputs, and digital I/O all function exactly the same whether or not the robot is disabled.

None of the actual relay or pwm outputs will be active when the robot is disabled. That's all there is to it.

gnirts
13-02-2006, 09:17
Thanks for the fast reply.

Is operating sensors during competition while disabled legal? Desirable?

What about the camera? It communicates using serial, but has PWMs on board. Can I adjust these? If so, can Kevin's code be reworked to lock on pre-match?

Thanks,
Robinson

Greg Marra
13-02-2006, 09:23
They have ruled that it is legal to operate the camera servos from the camera's on board PWM controls before the match starts. We did this last year, and the robot would determine which vision tetras was out before the other teams finished setting up :D .

Alan Anderson
13-02-2006, 11:25
It's perfectly fine to read sensors while the robot is disabled. In fact, sometimes it's important to do so. For example, when you're using a solid-state gyro, you need to calibrate it before you start moving, and you need to read it consistently in order to track your heading.

The camera is considered a sensor rather than an actuator. If its servos are only controlling the direction it's looking, having those servos active even when the robot is disabled is permitted.

Changing this year's camera code to use camera-connected servos is neither trivial nor obvious. I think it might actually have worked better if I had started with last year's code instead.

Kevin Watson
13-02-2006, 11:47
...can Kevin's code be reworked to lock on pre-match?Yes, it can. I started working on this a few weeks ago, but my day gig sucked away any free time I had to work on it. But now I can. I have a new version of tracking.c that does all servo manipulation through two new functions. I haven't had a chance to test it yet, but if you'd like to, here's a link: http://kevin.org/frc/frc_camera_beta.zip. Please report back here with the results of testing. I'll be able to work on this tonight, but it would be most helpful if I knew this code worked (or not) before I leave work.

-Kevin