PDA

View Full Version : Jaguar communication issue


kenavt
06-21-2011, 06:05 PM
Hello,

While trying out some drive code, I have had problems with one of our four Jaguars that control the four drive motors. I have verified that the wiring is correct multiple times, and when the robot is enabled the LED on the Jaguar is a solid amber - indicating a connection to the cRIO. However, when I should be sending power to the motor, the LED still indicates a solid amber instead of green or red.

Frankly, I cannot find any fault with my code, but that seems to be the only possible thing. I have tested out other code with the same Jaguar, and it responded, so it cannot be a problem with the Jaguar. I've attached pictures of my LabVIEW code in the Begin.vi and Teleop.vi. I am honestly stumped. Can any of you guys help?

jhellr13
06-21-2011, 09:31 PM
Hello,

While trying out some drive code, I have had problems with one of our four Jaguars that control the four drive motors. I have verified that the wiring is correct multiple times, and when the robot is enabled the LED on the Jaguar is a solid amber - indicating a connection to the cRIO. However, when I should be sending power to the motor, the LED still indicates a solid amber instead of green or red.

Frankly, I cannot find any fault with my code, but that seems to be the only possible thing. I have tested out other code with the same Jaguar, and it responded, so it cannot be a problem with the Jaguar. I've attached pictures of my LabVIEW code in the Begin.vi and Teleop.vi. I am honestly stumped. Can any of you guys help?

First off, do you have the right pwm cable connected, and connected in the right way? Is your joystick code correct as well? Are your jaguars calibrated? I would assume so. I remember having a problem similar to this, this past season. We killed one jaguar because we forgot to calibrate, so one jaguar killed another. I remember we also played around with what jaguar got what motor. If you try switching around the pwm cables to different jaguars, that can possibly work.
The last thing i can think of in LabVIEW, would be to see what the motor output is. I don't really remember how to do it as the programming computer is not with me, but i think you right click a wire in the code, and something is an option that allows you to see the number/output of something like a jaguar or the speed applied when the joystick is pushed. I think you would have to put it on the wire that is connected from motor to set motor in the teleop code. Not exactly sure as I only learned how to do that at the competition when i had a programming alumni present to help me out.
Let me know how things go

kenavt
06-21-2011, 09:51 PM
First off, do you have the right pwm cable connected, and connected in the right way? Is your joystick code correct as well? Are your jaguars calibrated? I would assume so. I remember having a problem similar to this, this past season. We killed one jaguar because we forgot to calibrate, so one jaguar killed another. I remember we also played around with what jaguar got what motor. If you try switching around the pwm cables to different jaguars, that can possibly work.
The last thing i can think of in LabVIEW, would be to see what the motor output is. I don't really remember how to do it as the programming computer is not with me, but i think you right click a wire in the code, and something is an option that allows you to see the number/output of something like a jaguar or the speed applied when the joystick is pushed. I think you would have to put it on the wire that is connected from motor to set motor in the teleop code. Not exactly sure as I only learned how to do that at the competition when i had a programming alumni present to help me out.
Let me know how things go

Let me try to address the things you've brought up one by one (I'm trying to cross potential problems off of my list):

-I have verified the wiring from the cRIO to the Digital Sidecar and through the PWMs to the Jaguar.
-What do you mean by calibrating Jaguars? I thought they were set to go out of the box.
-Frankly, I doubt switching around PWMs should make any difference. All the Jaguars are the same, right? Or at least they should be.
-I haven't "probed" - that's the word you are looking for - the output wire to the SetOutput.vi while the robot's been running. However, looking at my code, I am most definitely not sending "0s", as my team would say, to the Jaguar.

Because previous code (our competition 2011 code) used that Jaguar as expected, I am guessing the problem has to do with how I am assigning PWM channels. That is why I attached the image of my Begin.vi.

jhellr13
06-21-2011, 10:03 PM
Let me try to address the things you've brought up one by one (I'm trying to cross potential problems off of my list):

-I have verified the wiring from the cRIO to the Digital Sidecar and through the PWMs to the Jaguar.
-What do you mean by calibrating Jaguars? I thought they were set to go out of the box.
-Frankly, I doubt switching around PWMs should make any difference. All the Jaguars are the same, right? Or at least they should be.
-I haven't "probed" - that's the word you are looking for - the output wire to the SetOutput.vi while the robot's been running. However, looking at my code, I am most definitely not sending "0s", as my team would say, to the Jaguar.

Because previous code (our competition 2011 code) used that Jaguar as expected, I am guessing the problem has to do with how I am assigning PWM channels. That is why I attached the image of my Begin.vi.

According to what you have said, I think the Jaguar is fine. Plus is you used it for competition they are definitely calibrated then. If you didnt know, to calibrated you take a small pin and put it in the reset hole. Then you wait for it to blink. Then you just push the joystick forward, neutral, then back, then release pin.
Are you sure pwm is only for that Jaguar and not used for something else?
The last thing I can think of is the following. If this Jaguar is for your drivetrain, then you have it programmed wrong. If it is just for a window motor which should he attached to a spike relay, you also have it wrong. What exactly are you using this Jaguar for? I probably should've asked that in my first response.

Mark McLeod
06-22-2011, 07:37 AM
Did you accidentally open PWM2 for some other device as well?

It's often not the code you are focused on that causes problems, but the code you dismiss out of hand as "unrelated".

kenavt
06-22-2011, 05:48 PM
According to what you have said, I think the Jaguar is fine. Plus is you used it for competition they are definitely calibrated then. If you didnt know, to calibrated you take a small pin and put it in the reset hole. Then you wait for it to blink. Then you just push the joystick forward, neutral, then back, then release pin.
Are you sure pwm is only for that Jaguar and not used for something else?
The last thing I can think of is the following. If this Jaguar is for your drivetrain, then you have it programmed wrong. If it is just for a window motor which should he attached to a spike relay, you also have it wrong. What exactly are you using this Jaguar for? I probably should've asked that in my first response.

I am using the Jaguar for a drivetrain CIM motor. Frankly, I've never had different programming for different motors, so I am not entirely sure what you mean.

Did you accidentally open PWM2 for some other device as well?

It's often not the code you are focused on that causes problems, but the code you dismiss out of hand as "unrelated".

No, I've only opened PWM2 once. Woah, that scared me for a second.

An additional thing I should note was that once I removed code from the Disabled.vi and PeriodicTasks.vi dealing with the two motors (no longer referenced in the Begin.vi) from the demo code, I have no errors pop up when operating the robot. Before I removed that code, I had many, many errors from those two pieces of code.

jhellr13
06-22-2011, 08:00 PM
If you are using it for a drivetrain, your code in the begin vi should be either he arcade or tank block.

kenavt
06-22-2011, 08:35 PM
If you are using it for a drivetrain, your code in the begin vi should be either he arcade or tank block.

Actually, I believe that is only for the Teleop.vi - not when initializing PWM channels. Also, the whole point of my program is to test different drive system code, not the basic tank/arcade/holonomic code.

jhellr13
06-22-2011, 09:48 PM
Actually, I believe that is only for the Teleop.vi - not when initializing PWM channels. Also, the whole point of my program is to test different drive system code, not the basic tank/arcade/holonomic code.

For a drivetrain code, whatever the drive code (arcade, tank. holonomic) is placed in the begin vi. On that block, the pwm cables are assigned for each jaguar controlling the CIM motors. In teleop, that is where you initiate the drive system and make it controllable by a joystick. As a heads up, if you are doing omni wheel or mecanum, remember that those drive systems have 3 axis. Forward, back, and strafe.
If you need some help because it seems like you might be confused, check out this link. It is the team website for Mark McLeod's team up above. They have a great resource for LabVIEW programming on any topic and it was a great help for me this year, and certainly help you out right now.
http://team358.org/files/programming/ControlSystem2009-/LabVIEW/

kenavt
06-23-2011, 07:44 AM
For a drivetrain code, whatever the drive code (arcade, tank. holonomic) is placed in the begin vi. On that block, the pwm cables are assigned for each jaguar controlling the CIM motors. In teleop, that is where you initiate the drive system and make it controllable by a joystick. As a heads up, if you are doing omni wheel or mecanum, remember that those drive systems have 3 axis. Forward, back, and strafe.
If you need some help because it seems like you might be confused, check out this link. It is the team website for Mark McLeod's team up above. They have a great resource for LabVIEW programming on any topic and it was a great help for me this year, and certainly help you out right now.
http://team358.org/files/programming/ControlSystem2009-/LabVIEW/

Frankly, I've never seen anyone place drive code in the Begin.vi - it was my understanding that was for initializing PWM channels, not putting drive code in Robot Main.vi at that point. You may be talking about the Open 4 Motor.vi, which frankly shouldn't be neccessary - I can open individual motors just as easily.

I may seem confused because I believe that I am initializing PWM channels correctly for each individual motor, but nothing seems to be allocated. That website is a great resource, though. I'll be sure to look through that.

Mark McLeod
06-23-2011, 09:37 AM
If you set the motor output in more than one place, especially in someplace like Periodic Tasks, then it could be overriding your Teleop Motor Set and keeping PWM2 in neutral.

I assume the rest of Teleop has a simple straight-through dataflow, without loops or delays.

You might try a step-by-step troubleshooting approach.

Create a new project from scratch
Don't change the existing code, leave the default drive motors, code in Disable, etc.
Add just your new Jaguar out on an unused PWM with a new joystick control.
See if that works.
Step-by-step begin to remove the default code, and changing the code over to resemble what you are having trouble with now.
Test at each change, e.g, 1) just remove the old drive motors, 2) test, 3) relocate your single Jag to PWM2, 4) test, 5) remove the code throwing errors in Disable, 6) test, and so on.

Alan Anderson
06-23-2011, 10:01 AM
Frankly, I've never seen anyone place drive code in the Begin.vi - it was my understanding that was for initializing PWM channels, not putting drive code in Robot Main.vi at that point. You may be talking about the Open 4 Motor.vi, which frankly shouldn't be neccessary - I can open individual motors just as easily.

If you're going to be using the provided tank, arcade, or omni drive functions, you need to define the drivebase motors using an Open 4 Motor (or Open 2 Motor) function. Opening the motors individually is a little more work, and if they are opened individually then controlling them appropriately is even more work.

I may seem confused because I believe that I am initializing PWM channels correctly for each individual motor, but nothing seems to be allocated.

You haven't shown us the rest of your code, so we can't do much to help you debug it. You also haven't indicated whether or not you've done any troubleshooting, either by "probing" the value going to the Motor Set or by swapping wires around to see if the problem stays with the Digital Sidecar's PWM output or with the Jaguar.

sithmonkey13
06-23-2011, 10:10 PM
Check the connection between the PWM cable and the Jaguar. We have had problems with this before, and as a result, we always hot glue the cables to the Jaguars, as driving in a match could shake the PWM cables loose.

jhellr13
06-23-2011, 10:20 PM
Check the connection between the PWM cable and the Jaguar. We have had problems with this before, and as a result, we always hot glue the cables to the Jaguars, as driving in a match could shake the PWM cables loose.

We also hot glue the pwm cables. This year we even made a lexan casing that went around the electronic part of our robot. Because it was clear, the refs and everybody could see our electronics, but the tubes couldn't get stuck in the cables. The casing had a hole for the light, and a slit where the power switch was available. We put velcro around it, so it easily came on and off.

kenavt
06-30-2011, 09:12 PM
I've had a busy last week(two robotics demos, the offseason MARC competition), but I tried the code with a different cRIO, Digital Sidecar, and Jaguars. I had the same result happen where the PWM channel seemed to be allocated incorrectly, so I talked through my drive code with a recently graduated programmer. We isolated the issue to a wrongly attached wire, automatically sending null commands to the Jaguar. So, that was the issue after all.

Thanks a lot for the help anyway. I've learned a bit about debugging, and hopefully I'll be able to bring this knowledge forward into my next project, next build season, and beyond.