My students are using a PID loop to control their chain bar. They hooked up a potentiometer and plugged it into an analog port and made sure that it was entered into motor and sensor setup in RobotC. When they access the debugger window to get the range values they need, it only reads from 0 to 65, when it’s supposed to be 0 - ~4000. They tried four other potentiometers and different ports with the same result. Any help would be great!
Not an expert by any means… but i seem to remember that we got different readings depending on whether or not the cortex was actually powered on or off.
Do any other RobotC variables get reported to your debugger stream okay?
Is there anyway you can check the voltage coming out of the analog ports? I suppose it’s possible that the 5 volt regulator that supplies the analog ports is having a problem. The middle of the port should be +5 volts with respect to the ground, as shown in this schematic:
If the Cortex 5 volt regulator is not working, then that might explain the low values. But check to make sure your software is set up for the debugger to actually see the variables.
To confirm the testing setup: Are they getting those values when the potentiometer is on the robot, or just when they’'re holding it & spinning by hand an axle stuck in it? If they’re getting these values when it’s on the robot, is the POT on a geared axle?
After a day of frustration not getting the desired values, the fix was as easy as turning on the cortex. Falsely assumed that the USB was enough. Thanks for all of your help!!!