Speed control for Jaguars?

Hi everyone!

This is our schools first year participating in any robotic competition, so things have been going pretty rough.

We hadn’t been able to get our motors spinning at all, but after hours of troubleshooting, we found that removing the watchdog from the labview project let us turn the motors on and off by the values -1 0 and 1 in the speed input box in the labview program.

However, we cannot control the actual speed of the motors with the code, even though the video “Make a simple motor in 10 minutes” shows variable speed. When we run the motors, we get the slow blinking on the sidecar, but the LEDS on the jaguars go green when they are on, regardless of the blinking LEDs on the sidecar.

I updated both the cRIO image and the Driver revision from the most recent releases.

So, in conclusion, we can turn the motors on and off without speed control when we delete the “Watchdog: Open” from the labview code. If the watchdog is in there, then it will not run the motors at all.

The tutorial had stated to set a constant of “false” for the watchdog, but that option is not present, but I did read that the option was completely taken out and it is automatically false. Is this correct?

Thanks in advance!!

-3020

It looks like two things are happening:

1.Something in your code is causing the watchdog to trip.This can be solved be disabling it, but it’s usually much better to either increase the timeout of fix the offending section of code(putting a few Getwatchdog.Feed)s in any internal loop should work.

Your second problem–have you tried printing out the values you’re actually sending to the motors? It’s possible that something else is modifying a global. If the correct values are getting sent, you might want to reclaibrate your Jaguars

Well, still no dice.

Recalibrating should only be necessary is we are using the joysticks right? We are just running it on the computer for now, with a direct ethernet connection to DS. When running the program, you should be able to increase or decrease the integer value on a speed control box on the screen. 1 is full on, 0 is off, -1 is reverse, but we have no control of the speed. Like I said, we had to delete the watchdog to even get the motors to have any kind of response at all.

What’s odd is that when the watchdog is in the code, outside the while loop, it isn’t wired to anything. I don’t know if it should be or not, and to where. The tutorial video does not show it getting wired anywhere. Please keep in mind, this is the first time I’ve even worked with any visual programming tool, let alone labview.

The program we wrote in labview is extremely simple. It is this exact one seen in the video found here http://zone.ni.com/devzone/cda/tut/p/id/7977

We will be taking the system up to a shop on friday and saturday to see if they can help us…but time is running out! Then again, we just go the robot parts last week…

Thanks!

I’m not sure how much is explained in that video, as I didn’t listen to it, just skipped to the part with the LV program, so forgive me if I repeat something that’s in that video.

The watchdog is a nifty little feature that, if not “fed” for a defined period of time, will shut down the code we are running. This is for safety reasons–let’s say you have a logic error in your code. You put it on the field, getting just the right conditions to trigger the logic error. Nothing about the code is wrong, but you are stuck in a While loop, say, waiting for a sensor (that’s now unplugged), not doing anything else. Your motors are set for full forward, and you are going to crash full-bore into the wall.

Now, suppose you were using the watchdog. You set it at the beginning of the program, and feed it at every point of the program where you anticipate taking longer than the expiration you set, say, 0.1 seconds. That’s a short time in our realm, but an eternity to a processor. The code hangs inside the While loop, waiting for a condition that isn’t going to happen. The watchdog is not fed for that 0.1 seconds because, being a smart programmer, you haven’t put a Feed inside the While (that sensor is only going to take a moment to respond, right?). The watchdog shuts down the code before your robot becomes a safety issue.

This feature has been mandatory on older robots; if the user processor froze up for whatever reason and stopped communicating with the master processor, the controller would shut down (and you would see a (IIRC) blinking red light of death). This year, it is optional. Deleting the watchdog from your design is probably OK, but just know the consequences.

Now, for the other part of your problem. This year, unlike other years, Integer values are not going to cut it for your speed controller outputs. The range for the outputs is -1 to 1, with 0 being off. If you want half speed, you have to output 0.5. I think you probably haven’t tried it with the joysticks yet; the joystick positions aren’t described as integers either. They are in the same -1 to 1 range as the speed controller outputs. The control shown is of the type Double; this is adequate because Doubles are a floating-point type–they can describe numbers with a moving decimal point. I bet you a cookie that all you need to do is type something like “0.5” into that control and you will get half speed. IIRC, those controls only increment in integer values, and you won’t see any partial power steps.

Let me know if that fixes your problem, or if not. I’m not the most proficient at LabView, but I can certainly try.

Jacob

Haha, last night before going to bed I was pondering the possibility of the range being -1 to 1. So I tried that today and sure enough it worked. Then I came on the forums and saw your post. But thanks anyways!