Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Debugging the default targeting code (http://www.chiefdelphi.com/forums/showthread.php?t=82770)

Lumit 15-02-2010 19:44

Debugging the default targeting code
 
So we're trying to get the default code to rotate towards a target to work. We have a good gyro working (finally), and the camera is detecting our pretend target, but whenever we hit the button, it always rotates to the left.

Any advice on some steps we could do to debug this?

We found that one of the values inside the Rotate Towards Target vi isn't the correct datatype, but that doesn't seem like it'd be enough of an issue?

thanks...

Joe Ross 15-02-2010 22:34

Re: Debugging the default targeting code
 
Does it rotate to the left and then stop when it rotates approximately the right amount (just in the wrong direction) or does it continue rotating forever?

Lumit 16-02-2010 02:55

Re: Debugging the default targeting code
 
We don't have a lot of room atm to let it spin forever, but I think that's what is going on... It isn't simply on the wrong side of the middle line, it will turn right into a wall (over 90 degrees) and keep going, even after losing the target in the process.

Greg McKaskle 16-02-2010 08:10

Re: Debugging the default targeting code
 
Note that the code will turn to gyro heading of zero unless it sees a target. Does the dashboard show a green circle around the target? If not, it may be rotating to the zero.

First determine if the vision code is working just by watching the dashboard. You can also reset the gyro to a safer heading. It is reset using two buttons on the back of the joystick -- I don't remember the numbers.

Greg McKaskle

seventhapollo 16-02-2010 17:35

Re: Debugging the default targeting code
 
Our robot also does this. In addition, I noticed that the motor-controller input does *not* vary (to my understanding, it *should*) with the target's distance from the center of the camera view.

Our camera/dashboard *does* see the target - the green circle *is* present. However, the robot simply does not turn properly.

Alan Anderson 16-02-2010 23:08

Re: Debugging the default targeting code
 
Quote:

Originally Posted by seventhapollo (Post 921458)
...the robot simply does not turn properly.

The defaults for the PID control parameters might not be appropriate for your robot. To make it turn properly you will have to tune them.

Lumit 17-02-2010 02:26

Re: Debugging the default targeting code
 
thank you Greg,
There is a green circle, it is detecting the target.
We just got done updating to LV2.1 and Dashboard1.1, I'll try to see if it works now, if not then I'll see if I can get more information about where it is trying to turn to.

Quote:

The defaults for the PID control parameters might not be appropriate for your robot. To make it turn properly you will have to tune them.
How might we go about doing that? The PID vi looks way above and beyond my level of comprehension...

Greg McKaskle 17-02-2010 06:32

Re: Debugging the default targeting code
 
There is a white paper on the NI site specifically for tuning this usage. Give that a try. There are many good tutorials out there for more general usage.

Greg McKaskle

Lumit 19-02-2010 00:07

Re: Debugging the default targeting code
 
The updates somehow fixed it! :)


All times are GMT -5. The time now is 11:02.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi