Go to Post Your team has a cave?!?!? OMG, how did you guys get that?!?! Do you have a cave sponsor? We tried talking to cave sponsors but none of them responded. You guys must be an elite team to have a cave. - marshall [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 17-01-2012, 20:51
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Axis Pan+Tilt Servo issue?

Hello -

We've installed the Axis Pan and Tilt kit on one of our Axis cameras, but I'm having some issues controlling the servo's. I've written the two servo's into Begin.vi, Teleop.vi, and Finish.vi (all wired to Joystick 3), but they refuse to respond.

Am I going about this in the absolute wrong way?


Begin.vi -
Teleop.vi -
Finish.vi -

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2012, 22:22
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Axis Pan+Tilt Servo issue?

Servo Set Angle expects an angle (in degrees). The joystick Get axis are from -1 to 1, which isn't a very big range of angles.

Last edited by Joe Ross : 17-01-2012 at 22:24.
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2012, 22:28
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Axis Pan+Tilt Servo issue?

I looked under the example code. Seems the servo's have a 170 degree limit, whereas the joystick has a 360 degree range of motion. I guess that means a joystick is out as a controller. What else can I use to control the camera?

I could try putting Servo Set Angle with a numeric constant within a case structure and wiring it to a joystick button and seeing if that would work.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2012, 22:50
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Axis Pan+Tilt Servo issue?

Update - Here's what I threw together. I may edit the buttons once I get the joystick back in front of my face to see the button layout.

Currently, the code sets the servo's to their home or middle angle. From there, I can mount the camera and have 85 degrees of motion on both pan and tilt.

Later on, I'll add more case structures mapped to more/different buttons which move the camera to predefined angles. Good idea, or too much to do during teleop?

Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2012, 22:51
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Axis Pan+Tilt Servo issue?

I added the output values for the joystick to my previous post, because I realized the documentation wasn't clear at all.

You can use a joystick to control a servo, you just need to use a (simple) equation to scale the joystick value to the range the servo expects.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2012, 23:06
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Axis Pan+Tilt Servo issue?

Oh, I see! I'll try to get both methods working (joystick and case structures) and see which one our drivers prefer. Will post my results tomorrow.

Thanks!
Reply With Quote
  #7   Spotlight this post!  
Unread 17-01-2012, 23:22
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Axis Pan+Tilt Servo issue?

Quote:
Originally Posted by DominickC View Post
Later on, I'll add more case structures mapped to more/different buttons which move the camera to predefined angles. Good idea, or too much to do during teleop?
While you won't overload the cRIO doing that, it does take some time to program a whole bunch of cases.
Reply With Quote
  #8   Spotlight this post!  
Unread 17-01-2012, 23:27
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Axis Pan+Tilt Servo issue?

True. I might just end up figuring out the equation and running from there.
Reply With Quote
  #9   Spotlight this post!  
Unread 18-01-2012, 02:50
SuperS_5's Avatar
SuperS_5 SuperS_5 is offline
[Certified LabVIEW Developer]
FRC #1219
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Canada
Posts: 140
SuperS_5 will become famous soon enoughSuperS_5 will become famous soon enough
Re: Axis Pan+Tilt Servo issue?

Quote:
Originally Posted by DominickC View Post
I looked under the example code. Seems the servo's have a 170 degree limit, whereas the joystick has a 360 degree range of motion. I guess that means a joystick is out as a controller.
Just to recap and correct the above comment:

The joysticks get function outputs a range of -1 to +1, floating point. So even though the joystick has a larger range of motion in degrees, it is scaled down by a factor of 127. It is then limited to within that range. (256 units)

Therefore you have to scale your joysticks between this range of 2 to a range of 170.
__________________
Mike B
Reply With Quote
  #10   Spotlight this post!  
Unread 18-01-2012, 20:08
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Axis Pan+Tilt Servo issue?

I've gotten it to work, thanks everyone for your help!
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


All times are GMT -5. The time now is 22:30.

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