|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Jaguar Blinking Yellow
Hello everyone. This is our teams first year in FTC and we have run into some problems getting started on the programming side. I have read quite of few of the guides and the problem I have run into is that no matter what I try the Jaguar motor controller blinks yellow which indicated that it is not initialized in the code. These are the steps that I have taken so far:
1. Connected everything as shown in the "Getting Started with the 2012 FRC Control System pdf. (There is a small problem with the document. On page 13 it shows the motor controller connected to the white PWM pins on the sidecar while on page 11 it shows it connected to the black pins which I believe are for sensors or spikes from what I've read.) 2. My setup has one difference. There is only one Jaguar motor controller connected. It is connected under PWM 1 on the sidecar. 3. Flashed the cRIO successfully and assigned it the correct IP address. 4. Compiled a program after downloading the WPIlib file that was missing. (I was using the simple robot template for this.) 5. Uploaded it to the cRIO. 6. Power cycle. 7. Run autonomous and driver control from the driver station. After modifying the code in countless ways I still have had no success. I have tried changing the class to iterativerobot as well as using the Jaguar class with no success. I was wondering if anyone could shoot some code my way with a few examples of how to get this working. I'm sure its something simple I'm overlooking. I was also wondering if anyone could tell me or point me to a document that explains what CAN is and what the advantages and disadvantages of it are? Any help is appreciated! Last edited by meltbox360 : 22-01-2012 at 14:01. |
|
#2
|
|||||
|
|||||
|
Re: Jaguar Blinking Yellow
According to this document, table 2-5 says:
Quote:
|
|
#3
|
||||||
|
||||||
|
Re: Jaguar Blinking Yellow
Did you rework your DB37 cable?
|
|
#4
|
|||
|
|||
|
Re: Jaguar Blinking Yellow
Is that the cable that's reminiscent of floppy disk drive cables?
I have checked power just by looking at the lights but I suppose poking around with a multimeter would not hurt. I have actually rewired the whole thing once so the wiring should not be the problem but I will make sure to triple check it. Maybe try another controller to make sure I don't have a bad one. |
|
#5
|
|||
|
|||
|
Re: Jaguar Blinking Yellow
I rechecked all the wiring and everything is correct. I'm not sure what the lights next to "RELAY" on the sidecar signify but they light up. Sometimes one of them is not lit up though. The motor controller continues to blink just as before. I will post my code here, perhaps someone can find something I did wrong.
Code:
#include "WPILib.h"
class WRobot : public SimpleRobot
{
Jaguar WMotor;
public:
WRobot(void):WMotor(2,1)
{
//WMotor.SetExpiration(0.1);
}
~WRobot(void)
{
}
void Autonomous(void)
{
WMotor.Set(1);
Wait(2.0);
WMotor.Set(0);
WMotor.Disable();
}
void Disabled(void)
{
WMotor.Set(1);
Wait(2.0);
WMotor.Set(0);
WMotor.Disable();
}
void OperatorControl(void)
{
WMotor.Set(1);
Wait(2.0);
WMotor.Set(0);
WMotor.Disable();
}
void RobotInit(void)
{
WMotor.Set(1);
Wait(2.0);
WMotor.Set(0);
WMotor.Disable();
}
void RobotMain(void)
{
WMotor.Set(1);
Wait(2.0);
WMotor.Set(0);
WMotor.Disable();
}
void StartCompetition(void)
{
WMotor.Set(1);
Wait(2.0);
WMotor.Set(0);
WMotor.Disable();
}
};
START_ROBOT_CLASS(WRobot);
EDIT: Just a note on the commented SetExpiration. I did have that in the code at one point. I commented it as it was unclear to me exactly what it did but I was just trying a few things. Last edited by meltbox360 : 24-01-2012 at 18:40. |
|
#6
|
|||||
|
|||||
|
Re: Jaguar Blinking Yellow
Quote:
That is worrisome, because if you are not deliberately commanding them on, why are they on? They shouldn't be. |
|
#7
|
|||
|
|||
|
Re: Jaguar Blinking Yellow
I did make sure to change the firmware back to the c++ firmware and I found an example that runs the motor. I will look into it more to see what it is that I did differently. I believe the code I wrote only references the PWM pins but it does not make the Jaguar react. This is definitely a fault in my code I'm just unsure of what exactly it is.
|
|
#8
|
|||
|
|||
|
Re: Jaguar Blinking Yellow
Quote:
|
|
#9
|
||||
|
||||
|
Re: Jaguar Blinking Yellow
Ok -- so I've taken a longer look at the code and there are a number of issues. Rather than going over each one individually, I'm going to ask why you don't start with the "FRC SimpleRobot" template instead of trying to write from scratch. The program you have here uses things that the SimpleRobot class doesn't use in the template. That's not a bad thing if you're experienced, but it appears you may be pretty new to this. One of the big items here, however, is that OperatorControl() is called ONCE and you need to have a "while isOperatorControl() { ... }" loop or else it'll call your code, you set a few things, and then a millisecond later, you're no longer running your robot code. It is quite possible that your function calls work on the Jaguar itself, but since SimpleRobot is not being used properly, it appears to be unsuccessful.
I would suggest starting with the template and modifying from there. It'll likely be much less problematic. Also, I'd suggest taking the SimpleRobot docs from the help file and print them out, STUDY them, and highlight/make-notes. Then if it's still a problem, send me a PM with your phone number and we'll get on the phone and talk it through. Thanks, bob |
|
#10
|
|||
|
|||
|
Re: Jaguar Blinking Yellow
Quote:
|
|
#11
|
||||
|
||||
|
Re: Jaguar Blinking Yellow
You're welcome. I thought that the SimpleRobot demo example did do a drive forward for 2 seconds in autonomous and also did arcade drive during teleop though. Let me know how things turn out.
bob |
|
#12
|
|||||
|
|||||
|
Re: Jaguar Blinking Yellow
It's so strange that I suspect you either have a broken Digital Sidecar or a faulty cable connecting it to the DIO module in the cRIO. Do you have access to any others to try swapping them out?
|
|
#13
|
|||
|
|||
|
Re: Jaguar Blinking Yellow
Quote:
EDIT: Simple robot does indeed do those things at least the code suggests it should but the last time I ran it absolutely nothing happened. I will try again. The main difference I have spotted between the example code that I ran and worked and simple robot is the working code use the "new" c++ keyword to allocate memory for a "RobotDrive" object instead of the way the simple robot and my code have it done. I should definitely see if that fixes it although it should not have any effect unless the code is doing something really weird behind the scenes. Last edited by meltbox360 : 25-01-2012 at 18:27. |
|
#14
|
||||
|
||||
|
Re: Jaguar Blinking Yellow
If you are heading into "strange-land" possibly...I would suggest that you try the known-good labview program like 10 times in a row with moving a few things around ... wiring etc... if you get rock solid consistent results there, then move to C++ simplerobot and re-test... this would help gain you some sanity if it help identify a hardware flakey issue.
bob |
|
#15
|
|||
|
|||
|
Re: Jaguar Blinking Yellow
I am leaning toward either a broken cable at the moment as I have found that initializing a Jaguar appears to init a relay. EG I init PWM 1 as a Jaguar and instead relay 1 lights up green. Any thoughts?
EDIT: As a side note. The code that works for me in tele-op uses RobotDrive however it now refuses to drive the motors 100% forward but will drive them at 100% in reverse. More strange stuff? Just to make sure what should all the lights on the cRIO FRC II be lit up as? Just want to make sure I didn't overlook those stupidly. Last edited by meltbox360 : 31-01-2012 at 23:20. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|