Ok, so I am experiencing some occasional problems while using the VEXnet competition switch and running autonomous. I am programming in easyC V4 btw. Ok so what I am doing is, first I download my code. Then I plug in the comp. switch. Everything is turned on and the switch is on enabled, driver. At this point, all the operator control is working fine. I switch it to enabled, autonomous and the auton code runs as expected. The problem is that when i switch it to disabled, the robot sometimes keeps doing what it was doing and doesn’t disable. This continues even when the joystick is turned off. It only stops when the cortex is turned off. So, have you guys experienced this problem before? Is it a hardware problem or programming logic error?
This is the reason that backup batteries exist. If your main battery disconnects at a critical point, it is possible that your robot will go rouge.
Oh true, I didn’t think of that. I guess I will try for some time without the backup battery. But I have seen other people testing with the comp. switch and their robot has always stopped when disabled, so i’m kind of confused. But the back up battery didnt strike me at all. Does it only kick-in some of the time?
I’m a bit confused by your description. If the joystick were to be turned off there would be no way for the competition switch state to communicated to the cortex, at this point I think the cortex may default to driver, don’t actually know.
Have you tried a “normal” competition sequence?
disabled/auto
enabled/auto
disabled/auto
disabled/driver
enabled/driver
disabled/driver
The master firmware should be handling the disabling of the motors when the switch goes to disabled.
I assume that john01 means that once the disable command was given, and the robot stopped responding to commands, he turned the joystick off and the robot still didn’t stop.
No, I haven’t tried that sequence but I have gone to one competition and I didnt run into this issue at all. I’m sure it would work, but sometimes it probably would get caught up at the disabled/auto because of this error. Is the latest firmware 3.16 or has it been updated again? Do you know where I could check this?
I believe 3.17 is shipping with the latest EasyC, I may try that tonight. RobotC is still shipping with 3.16. I have no idea of the difference.
I will try and duplicate your result later, normally I use RobotC so the EasyC competition logic may be different to what I’m used to.
Ok, I will definitely update to 3.17 then.
These are the release notes posted in the EasyC tech forum.
**New to easyC 4.0.2.8
**-New Vex Master Code 3.17
-Fixed Learnmate Unlock Issue
-Fixed Unplug Gamepad from Field
I have no idea what these really mean or what has changed in V3.17 master firmware. I wish VEX would post more information on the master firmware and explain the benefits of upgrading. When a school has multiple cortex’s we try and upgrade everything at once otherwise it we get into compatibility issues. However, just like any software update, if there is no good reason to do it we would prefer to delay until after the competition season.
So I ran some tests using EasyC 4.0.2.7, didn’t really want to use 4.0.2.8 and have to upgrade master firmware as I would then have to downgrade to use RobotC again.
So the short answer is that I did not encounter any problems, all combinations of using the competition switch (not the simulation) work OK. If the switch is disabled, the “Initialize” function will run and the code then pause. When enable is selected either Autonomous or Operator control will start. (No surprises here). If you switch from Autonomous to operator control without disabling, the “Initialize” function will first run again and then you will start whatever you selected. If the robot is disabled then “Initialize” will run (yet again) and the code will pause waiting for enable. Interesting to note that “Initialize” will run every time the robot is disabled.
Using the competition switch simulator also works but in a different way to RobotC. It looks like EasyC sends commands straight to the user code, the game LED does not light. RobotC, on the other hand, uses bursts on the RTS line that puts the joystick into competition mode, the game LED lights and behaves the same as if the switch were connected. I did some investigation of this that I posted here.