Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Camera servo (http://www.chiefdelphi.com/forums/showthread.php?t=82500)

mcristina444 12-02-2010 16:46

Camera servo
 
im trying to move the camera using the 2nd joytick. we want to make button 8 make it go left and button 9 go right. then for up and down we want the thing that is between them to make it go up and down. anyone know how to do this?

Greg McKaskle 12-02-2010 17:12

Re: Camera servo
 
I think there was a thread that went into details on this recently. Basically you want to set the servo to a value each time through the loop. In front of this, you take the values sent last time and optionally increment, decrement, or leave alone. The value also needs to be remembered again until the next teleop message. The value can be fed back using a feedback node, it can use a shift register, a local variable, or even a global variable.

Greg McKaskle

Alan Anderson 12-02-2010 21:49

Re: Camera servo
 
Quote:

Originally Posted by Greg McKaskle (Post 918768)
The value also needs to be remembered again until the next teleop message. The value can be fed back using a feedback node, it can use a shift register, a local variable, or even a global variable.

The servo itself remembers its value, so you can just Get Position, add to or subtract from it, and Set Position each time through.

Ziaholic 12-02-2010 22:15

Re: Camera servo
 
The "thing" between buttons 8 & 9 is called the Throttle ... a.k.a Axis-3.

It goes from -1 to 1 ... but IMO, it goes the wrong way. You can wire the Axis3 (throttle) axis directly into the Tilt servo's SET POSITION. You might want to throw a "negate" in between if it acts backwards.

umangv620 13-02-2010 00:11

Re: Camera servo
 
Quote:

Originally Posted by Ziaholic (Post 918963)
The "thing" between buttons 8 & 9 is called the Throttle ... a.k.a Axis-3.

It goes from -1 to 1 ... but IMO, it goes the wrong way. You can wire the Axis3 (throttle) axis directly into the Tilt servo's SET POSITION. You might want to throw a "negate" in between if it acts backwards.

That is actually a good idea! I never knew that little thing on the front of the joystick was Axis 3.

btw(by the way), i created a post JUST like this, but I have code that does work(with the lightbulb on). I am still trying to figure out why the camera servo itself isnt working when we deploy the code.

mcristina444 13-02-2010 00:53

Re: Camera servo
 
Thanks for all the quick replies! sorry i cant take screen shots of the programming i have already done. what i basically set up was button 8 going into a case structure. (in true) i called up the Get angle then added 10 to it the put that value into Set Angle. it showed a red dot at Set angle. we deployed this code and nothing happened. is there a way to fix the red dot or should we use another Vi such as Set Position and Get position?:confused:
Also i did get the Throttle to work. all we added was a negate because it was backwards. :)
Again thanks for all the help. This is the second year I have been on the team and i am already the head programmer on my team.

Alan Anderson 13-02-2010 08:35

Re: Camera servo
 
Quote:

Originally Posted by mcristina444 (Post 919031)
i called up the Get angle then added 10 to it the put that value into Set Angle. it showed a red dot at Set angle. we deployed this code and nothing happened. is there a way to fix the red dot or should we use another Vi such as Set Position and Get position?:confused:

The dot is because Get Angle provides an unsigned 16 bit integer, and Set Angle wants a signed 32 bit integer. They are compatible, but not identical. You are right to be concerned about it, but this particular red dot is to be expected and causes no problems.

Alan Anderson 13-02-2010 08:36

Re: Camera servo
 
Quote:

Originally Posted by umangv620 (Post 919016)
I am still trying to figure out why the camera servo itself isnt working when we deploy the code.

Do you have the 6v power jumper installed next to the PWM pins going to the servo?

mcristina444 13-02-2010 09:36

Re: Camera servo
 
Quote:

Originally Posted by Alan Anderson (Post 919135)
The dot is because Get Angle provides an unsigned 16 bit integer, and Set Angle wants a signed 32 bit integer. They are compatible, but not identical. You are right to be concerned about it, but this particular red dot is to be expected and causes no problems.

If there is compatibility then why isnt our robot responding? do i need to add a converter Vi in between that? or is there something else wrong with our code?:confused:

umangv620 13-02-2010 18:13

Re: Camera servo
 
Quote:

Originally Posted by Ziaholic (Post 918963)
The "thing" between buttons 8 & 9 is called the Throttle ... a.k.a Axis-3.

It goes from -1 to 1 ... but IMO, it goes the wrong way. You can wire the Axis3 (throttle) axis directly into the Tilt servo's SET POSITION. You might want to throw a "negate" in between if it acts backwards.

We got our camera servo working using axis 3.
to take into account the -1 to 1, the value given by the axis was divided by 4, and then added .5, so the total value would go from .25 to .75(since we dont need the camera to go up and down all the way)

Alan Anderson 14-02-2010 00:43

Re: Camera servo
 
Quote:

Originally Posted by mcristina444 (Post 919164)
If there is compatibility then why isnt our robot responding?

I don't know why your robot is not responding. You haven't given enough information about how you're trying to make it do what you want it to.

ecnahc515 14-02-2010 01:26

Re: Camera servo
 
Quote:

Originally Posted by umangv620 (Post 919016)
That is actually a good idea! I never knew that little thing on the front of the joystick was Axis 3.

btw(by the way), i created a post JUST like this, but I have code that does work(with the lightbulb on). I am still trying to figure out why the camera servo itself isnt working when we deploy the code.

Make sure you have a jumper on the pwm channel your using for the servo.

Also I have a question:

Im using axis 3 as a throttle to control the speed for our robot. Basically I wana be able to move it down to make our robots motors run slower so going over the bump isnt so fast and reckless.

I did it with controls, but I wana do this with the actual axis 3 button.

How would I go about doing it. These two are what I have:





umangv620 14-02-2010 23:12

Re: Camera servo
 
Quote:

Originally Posted by ecnahc515 (Post 919758)
Make sure you have a jumper on the pwm channel your using for the servo.

That wasnt the problem. Our original code had button 2 moving the camera up and button 3 moving the camera down, and that was not moving the camera for some reason. Without touching the electrical board, we changed the camera servo code so that it moves according to the values given by Axis 3, the camera started moving. I dont know why it didnt work before, but it works now, which is one less thing for us to worry about :)


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

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