Go to Post What isn't fun about watching a robot hang tubes? I love watching my team do it! - Michael Corsetto [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 13-02-2011, 14:23
Ian McShane Ian McShane is offline
Registered User
FRC #3585 (Rogue Robots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: NH
Posts: 141
Ian McShane will become famous soon enoughIan McShane will become famous soon enough
servo

if i want to program a servo to move say 5 degrees up when i push a button on the joystick, how do i do that, specificly in teleop (a diagram would be nice)
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2011, 15:03
Ian McShane Ian McShane is offline
Registered User
FRC #3585 (Rogue Robots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: NH
Posts: 141
Ian McShane will become famous soon enoughIan McShane will become famous soon enough
Re: servo

the way i have it wired now is from the name to joystick vi's, to unbundled y axis, to case structure (true). here is where i have trouble, i can't connect the wiring to any of the servo vi's, set position, get position, you name it. that is my problem. How do i wire this so when i push the axis or button, it moves how ever many degrees or speed. ive been looking in all the tutorials for awhile, that includes other websites.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2011, 15:17
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: servo

Have a feedback node keep the current value of the servo, which is always writing to it. Have a case structure so that when you press the button, it adds five to the value.

With that setup, it will add 5 degrees every single time the loop runes (which is quite fast). If you want to wait for the button to release and then repress before it adds another five, you will have to add another feedback node. This one would keep the value of another case structure, around the first one. You wire the output of the feedback node into the input of the case structure. This would have several names as the cases: Try calling them "Button Pressed" and "Button Released"

The button released state would look for the button to be pressed, and when that happens would send the +5 degree command and the "Button Pressed" constant to the feedback node. In the Button Pressed state, it would give either a value of "Button Pressed" to the feedback node if the button was pressed or a value of "Button Released" if the button was released. At that point, it would go back to button released and start over.

I guess I'll attach some code.. One of them is how I said to do it in this post, and the "simplified" version is one that uses no case structures and very few functions.
Attached Files
File Type: vi Joystick Servo.vi (10.6 KB, 51 views)
File Type: vi Joystick Servo Simplified.vi (9.6 KB, 31 views)
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2011, 15:21
Ian McShane Ian McShane is offline
Registered User
FRC #3585 (Rogue Robots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: NH
Posts: 141
Ian McShane will become famous soon enoughIan McShane will become famous soon enough
Re: servo

what program do i open the files with?
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2011, 15:22
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: servo

Quote:
Originally Posted by Ian McShane View Post
what program do i open the files with?
.....Labview?.....
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2011, 15:25
Ian McShane Ian McShane is offline
Registered User
FRC #3585 (Rogue Robots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: NH
Posts: 141
Ian McShane will become famous soon enoughIan McShane will become famous soon enough
Re: servo

maybe
Reply With Quote
  #7   Spotlight this post!  
Unread 13-02-2011, 15:28
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: servo

Quote:
Originally Posted by Ian McShane View Post
maybe
I apologize, my reply was a bit obnoxious. The answer is definitely Labview.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #8   Spotlight this post!  
Unread 13-02-2011, 15:31
Ian McShane Ian McShane is offline
Registered User
FRC #3585 (Rogue Robots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: NH
Posts: 141
Ian McShane will become famous soon enoughIan McShane will become famous soon enough
Re: servo

no problem, i wasn't sure if it was word or picture or something like that.
Reply With Quote
  #9   Spotlight this post!  
Unread 13-02-2011, 20:16
dahlboy15 dahlboy15 is offline
Vice President
AKA: Dyson Dahl
FRC #3290 (Robo-Bears)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Baudette, MN
Posts: 14
dahlboy15 is an unknown quantity at this point
Re: servo

I hooked up your simplified version to the buttons. I've attached the vi below. It still does nothing. No servo moves at all when I press a button. I replaced a couple (+) vis with (-). I want to control up with 3, down with 2, left with 4, and right with 5. What's wrong with the program?
Attached Files
File Type: vi Teleop.vi (26.5 KB, 11 views)
Reply With Quote
  #10   Spotlight this post!  
Unread 13-02-2011, 23:04
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: servo

Quote:
Originally Posted by dahlboy15 View Post
What's wrong with the program?
Perhaps nothing is wrong with the program.

Did you remember to install the 6v servo power jumper next to the PWM output pins on the Digital Sidecar? Without that jumper in place, the servo won't be powered and won't be able to move at all.
Reply With Quote
  #11   Spotlight this post!  
Unread 14-02-2011, 02:38
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: servo

Quote:
Originally Posted by dahlboy15 View Post
I hooked up your simplified version to the buttons. I've attached the vi below. It still does nothing. No servo moves at all when I press a button. I replaced a couple (+) vis with (-). I want to control up with 3, down with 2, left with 4, and right with 5. What's wrong with the program?
I can see your problem, but I'm not sure how to describe it. My code either told the servo to go to the position it's already at or go to the position it's at +5 degrees. You have two commands, one saying to go to the one it's at and one telling it to go up 5 degrees. This means that several microseconds after it sends the signal to go to one position, it's already telling it to go to another.

I could give you a few ways to make it either go +0, +5, or -5, but it looks like you really want to be able to hold down the button and have the camera move down. In that case, you can just have a selector or case structure with the input wired to the joystick button; the true case wired to "add five" and the false case have another identical case structure but with a "subtract five" in the true case and a "say the same" in the false case. Remember to use a feedback node to have the servo remember its current position.

Sorry I can't give you another example, but I really have to do my homework and get to bed.
Reply With Quote
  #12   Spotlight this post!  
Unread 14-02-2011, 08:28
MaxMax161's Avatar
MaxMax161 MaxMax161 is offline
Allegedly Useful
AKA: Max Llewellyn
FRC #2791 (Shaker Robotics), FRC #1676 (Pascack π-oneers)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Montvale NJ\Troy NY
Posts: 174
MaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond repute
Re: servo

I think this thread is getting more complicated then it needs to. The way I understand your question is that when a button is not pressed you want a servo to be at angle X, and when it is you want it to be at angle X+5. Is this right?

The way I would do this is by having a true/false case statement with the numeric constant X in the false case and X+5 in the true case. I would then feed this value in to the WPI servo .vi called "Set Angle". This code would make the servo go to one angle (in this case X) while the button is not pressed and another (in this case X+5) when it is.

If you still don't see any movement try changing the values from X and X+5 to 0 and 170, it could just be to small a change to see. If there is still no servo movement after that, respectfully suggest to electrical it's their fault, calmly double check your code, then yell at electrical.
__________________
2791 Shaker Robotics (2013-present)
--Control Systems Mentor 2013-present
--Drive coach 2015-present

1676 The Pascack π-oneers (2010-2013)
--Drive coach 2011-2013
--Lead Programmer 2011-2013
Reply With Quote
  #13   Spotlight this post!  
Unread 14-02-2011, 19:25
dahlboy15 dahlboy15 is offline
Vice President
AKA: Dyson Dahl
FRC #3290 (Robo-Bears)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Baudette, MN
Posts: 14
dahlboy15 is an unknown quantity at this point
Re: servo

What is this jumper everyone refers to? Is it a special piece that fits around the two prongs? Is it like the PWM cable only two wired, and if so where does the other end go to? I have looked all over the web and have only seen it refered to as jumper.
Reply With Quote
  #14   Spotlight this post!  
Unread 14-02-2011, 23: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: servo

Quote:
Originally Posted by dahlboy15 View Post
What is this jumper everyone refers to?
Four of them were in the Kit of Parts, in the small parts bag in the black tote. Look at the KoP checklist for a picture.
Reply With Quote
  #15   Spotlight this post!  
Unread 15-02-2011, 17:24
Ian McShane Ian McShane is offline
Registered User
FRC #3585 (Rogue Robots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: NH
Posts: 141
Ian McShane will become famous soon enoughIan McShane will become famous soon enough
Re: servo

This is what i have, what next? don't forget i want the arm to go up however fast however far when i push the y axis, i just want it to move. i also need to do the same thing with another part of the arm. i have also been told they will be used with denso motors, do i change the vi's at all for that? and i am confused on how to input what port/pwm the motor or servo is wired into for each specific servo or motor vi. if anyone can send me a copy of my attachment an example on how to do all of what i just stated, i should be good from there.
Attached Files
File Type: vi Teleop.vi (13.4 KB, 11 views)

Last edited by Ian McShane : 15-02-2011 at 19:14.
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 20:36.

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