View Single Post
  #18   Spotlight this post!  
Unread 03-02-2009, 07:36
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Unhappy Re: WPILib PID controller object

I have been trying to get the PIDController to work with my robot the last few days without any luck. What we want to do is exactly like the example above. We have a turret and a potentiometer that we want to use and everytime I include the PIDController calls in my program, the cRIO just locks up and goes to its disabled mode. (All my Jaguars and Victors flashing)

I have an error message that was outputted when it crashes, does anyone know what is going on, or what this means?

---------------------------------------------------------------------
eclipse.buildId=20080514-1211
java.version=1.5.0_11
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86

Info
Mon Feb 02 17:19:12 CST 2009
Target Exception: Vector 0x600 : Alignment Exception status=0x134CE7C on VxWorks6x_10.29.92.2 in Kernel Task FRC_RobotTask:0xc7b6c8
at pc=0x134CE98 in SetSetpoint()
---------------------------------------------------------------------

For further information I am using the Iterative Robot example and here is the pertinant code: I already have a bunch of code written and like the Iterative over the Simple Robot so any changes from the example code you see, I had to do to get the program to compile.

************************************************** ****
In my .h file:
Jaguar *TurretPIDMotor;
AnalogChannel *TurretPIDPot;
PIDController *turretControl;

In my .cpp file:

In TeleopInit()
Jaguar TurretPIDMotor(3);
AnalogChannel TurretPIDPot(1);
PIDController turretControl(0.1,0.001,0.0, &TurretPIDPot, &TurretPIDMotor);
turretControl.Enable();

In TeleopPeriodic()
TurretGoto is being set from 0-5 using an equation and it is float defined
turretControl->SetSetPoint(TurretGoto);

************************************************** **

I tried putting the stuff in TeleopInit up in the top of the code before any functions are called and where most of my other variables are set or initalized but it wouldn't compile. The code compiles with everything above. I also tried using "turretControl.SetSetPoint" as was shown in the example, but I had to use "->" to get it to compile. (This is an issue I am always having, I don't know what all the ".", "->", "&", "*" and stuff means or why some times one works and one doesn't)

I am almost to the point where I am thinking of just writing my own subroutine so that I can at least know what the code I am using is doing. The PIDController looks like an awesome shortcut though so I would rather try to get it to work first. The above code compiles fine but when I run the robot it doesn't work.

I am using a 10-turn potentiometer as the sensor and a window motor as the motor driving the sensor.

Can anyone give me some pointers or have you already solved this problem and can tell me how you fixed it?
Reply With Quote