Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Moving Servo Motors (http://www.chiefdelphi.com/forums/showthread.php?t=110599)

Zach S. 06-01-2013 20:38

Moving Servo Motors
 
For the past three years now me and my team have been trying to set our joystick to be able to move our servos on camera and any other place on bot. Can anyone help me to a) move them with the axis of the joystick or b) press a button to move it to one position?

Greg McKaskle 06-01-2013 21:01

Re: Moving Servo Motors
 
1 Attachment(s)
There are a number of good ways of doing this, but perhaps what you want is to identify an initial servo setting, say 90 degrees. Pressing a button adds a delta, say 10 degrees to the number and updates the servo. Perhaps another button will subtract 10. Alternatively, you could use buttons to simply set the number to a special number.

The code for this would look similar to the attached image. Note that I duplicated the case diagrams near it as printing would. They are actually stacked in the code as individual diagrams.

greg McKaskle

Zach S. 06-01-2013 21:17

Re: Moving Servo Motors
 
Okay, that makes sense, but in the picture, what are the blocks to the right of the button cluster? and the the right of the True? ANd the blue thing above the top most case structure?

Ether 06-01-2013 21:30

Re: Moving Servo Motors
 
1 Attachment(s)
Quote:

Originally Posted by Zach S. (Post 1209350)
me and my team

my team and I

Quote:

Can anyone help me to a) move them with the axis of the joystick or b) press a button to move it to one position?
Attached is an example from team358.org



Greg McKaskle 06-01-2013 21:31

Re: Moving Servo Motors
 
1 Attachment(s)
Sorry about that. I wasn't sure how much LV you knew.

I attached the VI, and you can now show the help window and idle the mouse over each of the nodes to see what they are and what they do.

To answer you questions anyway:
The buttons I was interested in are indexed from the cluster and placed into an array. The array is searched for True to see which is pressed. The node with the magnifying glass is the search. The blue arrow box above the case is called a feedback node and is used to keep values from call to call. This "remembers" the value from last time. The case structure code updates it.

Greg McKaskle

Zach S. 06-01-2013 21:32

Re: Moving Servo Motors
 
Quote:

Originally Posted by Ether (Post 1209415)
my team and I



Attached is an example from team358.org



I have seen and tried that bit of program to no avail.

Alan Anderson 07-01-2013 00:09

Re: Moving Servo Motors
 
Did you install the servo power jumper on the pins next to the PWM output on the Digital Sidecar?

Zach S. 07-01-2013 05:30

Re: Moving Servo Motors
 
Quote:

Originally Posted by Alan Anderson (Post 1209577)
Did you install the servo power jumper on the pins next to the PWM output on the Digital Sidecar?

No. I'm not even sure what that is. Would that be why no servo programming I do ever works?

Ido_Wolf 07-01-2013 06:02

Re: Moving Servo Motors
 
Quote:

Originally Posted by Zach S. (Post 1209682)
No. I'm not even sure what that is. Would that be why no servo programming I do ever works?

Probably, it happened to us before too. They basically wouldn't receive any input when the jumper is not connected.

As a rule of thumb, when you try to learn how to use a new component you've never used before, I suggest utilizing the appropriate LabVIEW example first, and consulting one of your fellow teammates from the electronics department (or a mentor if no other student knows), as the vast majority of "component not receiving/returning value" issues come from either faulty wiring or missing a certain VI that you wouldn't think of when utilizing it by yourself.

The appropriate example here is "Servo Camera.lvproj", you might want to combine it with the example "Rectangular Target - 2013" and integrate both of them into your code.

(Keep in mind that in my experience, the camera's servos are incredibly unstable and unreliable, especially if you try to use to camera to "home in" on the target rather than an additional point of view for the drivers)

Alan Anderson 07-01-2013 09:05

Re: Moving Servo Motors
 
Each of the three-pin PWM OUT connectors on the Digital Sidecar is accompanied by a 2-pin PWM OUT +V header. The PWM OUT pins are SIG, PWR, and (-). The PWR pin is where a servo gets its power from, but it doesn't actually provide any power until you put a jumper on the +V header pins.

Quote:

Originally Posted by Zach S. (Post 1209682)
Would that be why no servo programming I do ever works?

Signs point to "yes".

Zach S. 07-01-2013 19:05

Re: Moving Servo Motors
 
Thanks for the Vi and jumper note. We added them to our older robot today, and will be trying out my code tomorrow. You guys solved a three year old question for us!

Zach S. 23-01-2013 11:11

I finally had the chance to deploy our code and with adding the jumpers it worked flawlessly! We can now move our servos with axis and buttons, thanks you guys!


All times are GMT -5. The time now is 10:54.

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