Go to Post Like my programming class teacher has said multiple times: "Stop complaining on reddit about your code not compiling and actually fix it". - [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2009, 16:06
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Still can't get the camera to track

Even without a gimbal mount, I'd still recommend opening the Two Color Example. The servo control on the panel will update to show the new servo setpoint, but it will work fine without it.

If that example doesn't show video and a good mask, then the problem is either with communications with the camera or camera setup.

Presumably that will work fine, and the next step will be integrating the vision portion of the example into the framework and replacing the gimbal setpoint with an encoder or pot setpoint and changing the loop to control a motor instead of a servo.

Post again with more specific questions/issues. I haven't explained how the example works yet, but if your are going to use it I'll be happy to answer more about it.

Greg McKaskle
Reply With Quote
  #2   Spotlight this post!  
Unread 10-02-2009, 16:09
Jill Jill is offline
Registered User
FRC #2197 (Las Pumas)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: New Carlisle, IN
Posts: 12
Jill is an unknown quantity at this point
Re: Still can't get the camera to track

The video and mask are fine. It's replacing the gimbal vi with something to control the motor...

Correction: The video/mask are updating when I run it, but the servo positions are not.

Last edited by Jill : 10-02-2009 at 16:39.
Reply With Quote
  #3   Spotlight this post!  
Unread 10-02-2009, 16:38
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Still can't get the camera to track

Thought so. And glad to hear that the vision works.

The first thing is to determine the feedback, it could be an encoder, or it could be a pot.

The vision loop currently calls the State Machine subVI that has about five states that should be simplified if it is a 1D rotary mount. The search should pan from current location to one of the motor limits, then pan to the other, probably back and forth until it locks on. Because the camera can't take good images when it is moving really fast, you probably still want to limit the velocity as it is currently doing.

Once located, it will update the setpoint of the encoder/pot based on the pixel to encoder scaling needed. The 15 and -13 proportional numerics on the panel are what to divide the pixel difference by in order to get the amount to move the servo or other motor. That was assuming it was mapping to degrees for the servo. To map to other encoder ranges you will need to change this number to tune it. In fact, since a motor and encoder don't have PID built in where a Servo does, you will probably want to put a PID into the loop to control the motor. You may also want to remove the deadband and the smoothing.

Greg McKaskle

The loop that updates the servo should change to take an en
Reply With Quote
  #4   Spotlight this post!  
Unread 10-02-2009, 18:13
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: Still can't get the camera to track

I might be wrong, but I think Jill wants to turn the whole robot instead of a turret. If so, you could just take the servo positions it calculates, subtract the ange that the program thinks is center, and turn your robot in the direction of the sign. If it's negative, turn right. If it's positive, turn left. You could use a set speed to turn at, or you could scale the degrees to motor speeds. Have a deadband so that once the value gets close to zero, the robot will stop turning.

Just a couple of thoughts off the top of my head, trying to think of the easiest way to do it.
__________________
Twitter Profile
Reply With Quote
  #5   Spotlight this post!  
Unread 15-02-2009, 15:57
Chris1228 Chris1228 is offline
Registered User
FRC #1228
 
Join Date: Sep 2007
Location: Rahway, NJ
Posts: 22
Chris1228 will become famous soon enough
Re: Still can't get the camera to track

can you submit example code on how to do this for us visual learners?
Reply With Quote
  #6   Spotlight this post!  
Unread 15-02-2009, 16:31
Chris3632 Chris3632 is offline
Registered User
FRC #2884
 
Join Date: Jan 2009
Location: Puerto Rico
Posts: 8
Chris3632 is an unknown quantity at this point
Re: Still can't get the camera to track

this is what i have, but i need to attach an encoder because, the code resets itself and it keeps tearing my cables apart. how do i attach an encoder to this?...
http://tinypic.com/view.php?pic=25uu1qs&s=5
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What if we want to use the camera to track orbit balls? Bryan Herbst General Forum 10 12-01-2009 21:10
can't get joystick right with the motor coolguybigt Motors 1 16-02-2007 10:20
AAH I'm spazzing out because I can't get our camera to do anything!!! JBotAlan Programming 23 14-02-2007 04:20
[RCU]: Can't get into the chats? Julia Magoolia General Forum 0 12-06-2005 13:28


All times are GMT -5. The time now is 21:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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