Go to Post Engineering fundamentally comes down to problem solving, and if the students can't get excited and inspired by the problem solving process because someone has spoon fed them a solution, then nobody wins. Give a man a fish, he'll eat for a day. Teach a man to fish, he'll eat for a lifetime. - kevinw [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 06-01-2013, 20:38
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 06-01-2013, 21:01
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Moving Servo Motors

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
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	87
Size:	172.0 KB
ID:	13407  
Reply With Quote
  #3   Spotlight this post!  
Unread 06-01-2013, 21:17
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
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?

Last edited by Zach S. : 06-01-2013 at 21:21.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-01-2013, 21:30
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Moving Servo Motors

Quote:
Originally Posted by Zach S. View Post
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


Attached Thumbnails
Click image for larger version

Name:	servo.png
Views:	57
Size:	66.3 KB
ID:	13408  
Reply With Quote
  #5   Spotlight this post!  
Unread 06-01-2013, 21:31
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Moving Servo Motors

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
Attached Files
File Type: vi Untitled 1.vi (7.7 KB, 13 views)
Reply With Quote
  #6   Spotlight this post!  
Unread 06-01-2013, 21:32
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Re: Moving Servo Motors

Quote:
Originally Posted by Ether View Post
my team and I



Attached is an example from team358.org


I have seen and tried that bit of program to no avail.
Reply With Quote
  #7   Spotlight this post!  
Unread 07-01-2013, 00:09
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Moving Servo Motors

Did you install the servo power jumper on the pins next to the PWM output on the Digital Sidecar?
Reply With Quote
  #8   Spotlight this post!  
Unread 07-01-2013, 05:30
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Re: Moving Servo Motors

Quote:
Originally Posted by Alan Anderson View Post
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?
Reply With Quote
  #9   Spotlight this post!  
Unread 07-01-2013, 06:02
Ido_Wolf's Avatar
Ido_Wolf Ido_Wolf is offline
LabVIEW Addict
AKA: Ido
FRC #2230 (General Angels)
Team Role: Alumni
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Israel
Posts: 42
Ido_Wolf is an unknown quantity at this point
Re: Moving Servo Motors

Quote:
Originally Posted by Zach S. View Post
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)

Last edited by Ido_Wolf : 07-01-2013 at 09:58.
Reply With Quote
  #10   Spotlight this post!  
Unread 07-01-2013, 09:05
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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. View Post
Would that be why no servo programming I do ever works?
Signs point to "yes".
Reply With Quote
  #11   Spotlight this post!  
Unread 07-01-2013, 19:05
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
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!
Reply With Quote
  #12   Spotlight this post!  
Unread 23-01-2013, 11:11
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
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!
__________________
Head of Computer Systems and Programming of Team 3307


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 21:53.

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