The Gyro sensor type in ROBOTC was originally implemented for an older sensor, so the existing calibration is a little off. We're fixing this in an update to ROBOTC in the coming weeks. One article that will help you until then can be found here: http://vamfun.wordpress.com/2011/05/09/note-vex-gyro/

Hi Jesse, I heard the gyro now works with RobotC vs 3.02. However, when I connected the gyro to the cortex the debug window gives me very low values, not 0 -3600. I get values like -1, -2, etc when turning clockwise; this is with the robot continuously spinning as it never reaches my 90 degree value of -900. I switched the gyro to another cortex & it seemed to work but the next day I got the same low values again. What am I doing wrong? Thanks.

Wed Oct 05, 2011 3:08 am

jbflot

Site Admin

Joined: Tue May 15, 2007 9:02 amPosts: 409

Re: Gyro

I'm not sure what you're doing wrong, but I've found that it's helpful to manually wipe out the gyro configuration data at the beginning of the program, and then reconfigure it, like this:

Code:

// Completely clear out any previous sensor readings by setting the port to "sensorNone" SensorType[in8] = sensorNone; wait1Msec(1000); // Reconfigure Analog Port 8 as a Gyro sensor and allow time for ROBOTC to calibrate it SensorType[in8] = sensorGyro; wait1Msec(2000);

This is in place of the pragma statements the Motors and Sensor Setup generates. There's three sample programs available if you go to File > Open Sample Program > Gyro.

Jesse, I've tried using the sample & also doing it thru Motors & Sensor from the Robot drop down menu. Either way, the debug window showed very low values, -1,-2,-3,etc. When I connected it to another cortex, I had the same problem at first then after many tries it worked. But the next day the values on the debug windows were low again. I opened a new gyro & put it on another cortex that had RobotC vs 3.03 (the other one had vs 3.02) & that one worked. But it wouldn't let me change the value in the debug window Sensors screen to 0. It froze the Sensors value so I had to reopen the file, then it worked. Anyway, Downloaded vs 3.03 on the other computer & connected the gyro but it still gave low values so the robot kept rotating. Any idea how to correct this?Also, when we downloaded a file that was created on either vs. 2.32 or vs 3.02 using the current vs 3.03, our robot just started to turn & raise its arm when the code was for it to just close its claw and move forward. The motors are in the correct ports. We're going to try to copy the code onto a New Competition template using vs 3.03 to see if it still gets erratic tomorrow. Also, with the new vs, we have to power cycle before each download. We get red robot or joystick lites and an error message but when we power cycle, all the lites go back to green & it can download. Thanks.

I also haven't seen the issue with using 2.32 programs you described, but if you send me the code I'll be happy to check it out and try to offer some insight. I'm assuming that you have updated your Cortex to the latest Master and ROBOTC Firmware?

Red lights tend to indicate low battery. You might check the connectors on your robot and battery to see if any are damaged - making the connection between them shaky. What error message are you getting, specifically?

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum