Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Axis Pan+Tilt Servo issue? (http://www.chiefdelphi.com/forums/showthread.php?t=100518)

DominickC 17-01-2012 20:51

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

Joe Ross 17-01-2012 22:22

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.

DominickC 17-01-2012 22:28

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.

DominickC 17-01-2012 22:50

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?


Joe Ross 17-01-2012 22:51

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.

DominickC 17-01-2012 23:06

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!

Joe Ross 17-01-2012 23:22

Re: Axis Pan+Tilt Servo issue?
 
Quote:

Originally Posted by DominickC (Post 1108111)
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.

DominickC 17-01-2012 23:27

Re: Axis Pan+Tilt Servo issue?
 
True. I might just end up figuring out the equation and running from there.

SuperS_5 18-01-2012 02:50

Re: Axis Pan+Tilt Servo issue?
 
Quote:

Originally Posted by DominickC (Post 1108080)
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.

DominickC 18-01-2012 20:08

Re: Axis Pan+Tilt Servo issue?
 
I've gotten it to work, thanks everyone for your help!


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

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