![]() |
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 |
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.
|
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. |
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? ![]() |
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. |
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! |
Re: Axis Pan+Tilt Servo issue?
Quote:
|
Re: Axis Pan+Tilt Servo issue?
True. I might just end up figuring out the equation and running from there.
|
Re: Axis Pan+Tilt Servo issue?
Quote:
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. |
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