Go to Post "Don't you wish your drill bit was hot like mine?" - BariSaxGuy [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 04-02-2013, 18:36
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
Exclamation Servo motor?

So my team and I were trying to figure out how to program a servo motor in teleop where when we push button 1 the servo spins its full range then once the button is released the servo returns to 0° automatically. No clue how to program this and any help given would be great
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2013, 18:53
James H James H is offline
Registered User
FRC #4256
 
Join Date: Feb 2013
Location: United States
Posts: 9
James H is an unknown quantity at this point
Re: Servo motor?

Quote:
Originally Posted by Team3763 Adam View Post
So my team and I were trying to figure out how to program a servo motor in teleop where when we push button 1 the servo spins its full range then once the button is released the servo returns to 0° automatically. No clue how to program this and any help given would be great
This depends on the rate at which you want this to happen at. As fast as possible is pretty easy since the servo just needs you to give it an angle and it does the rest unlike other motors that need a speed input. So before I can give you a definite answer, do you have a rate at which you would like the servo to move?
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2013, 21:01
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 motor?

Assuming you don't care about slowing down the servo's motion, what you want to do is pretty easy. Use a joystick button to select between 0 (when false) and 180 (when true), and feed the selected value to a Gyro Set Angle.

I think the default maximum is actually only 170 degrees. You can change it to match the servo you're using when you Open it.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2013, 17:59
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
Re: Servo motor?

We don't care about speed, and we're just trying to get the servo to go from button not pushed: 0°; button pushed 180°, 170 if this is max.

Below is the code we have so far, it's from an example I believe.

Click image for larger version

Name:	begin.jpg
Views:	34
Size:	173.3 KB
ID:	13831
Click image for larger version

Name:	teleop.jpg
Views:	31
Size:	195.9 KB
ID:	13832
Click image for larger version

Name:	finish.jpg
Views:	25
Size:	198.0 KB
ID:	13833
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2013, 19:15
Cecil's Avatar
Cecil Cecil is offline
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: Servo motor?

The code looks good to me. Another thing to remember is that the servo needs power applied to it, too. There has to be a jumper across the two pins directly next to the PWM port the servo is plugged into.
__________________
I'm right 90% of the time, so why worry about the other 3%?
Reply With Quote
  #6   Spotlight this post!  
Unread 06-02-2013, 19:43
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
Re: Servo motor?

Quote:
Originally Posted by Cecil View Post
The code looks good to me. Another thing to remember is that the servo needs power applied to it, too. There has to be a jumper across the two pins directly next to the PWM port the servo is plugged into.
There's a jumper, and it's wired in PWM 4. We're currently having problems with our Digital Sidecar. There's a thread posted here http://www.chiefdelphi.com/forums/sh...d.php?t=112925
Reply With Quote
  #7   Spotlight this post!  
Unread 06-02-2013, 21:05
Cecil's Avatar
Cecil Cecil is offline
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: Servo motor?

Well.. That opens up a whole 'nother bag of worms. Based on what you have said from your last thread, have you tried swapping the cable from the cRIO to the digital sidecar with a known working one? Remember that last year's ribbon cables shipped assembled backwards, which would screw up a bunch of things.
__________________
I'm right 90% of the time, so why worry about the other 3%?
Reply With Quote
  #8   Spotlight this post!  
Unread 06-02-2013, 23:13
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
Re: Servo motor?

Quote:
Originally Posted by Cecil View Post
Well.. That opens up a whole 'nother bag of worms. Based on what you have said from your last thread, have you tried swapping the cable from the cRIO to the digital sidecar with a known working one? Remember that last year's ribbon cables shipped assembled backwards, which would screw up a bunch of things.
We've differentiated between the round and flat cables, however I do believe the issue MAY be with DS (digital sidecar) as it wasn't receiving full power. Tomorrow I will make adjustments and take photo pictures then upload them here. Here's to hope!
Reply With Quote
  #9   Spotlight this post!  
Unread 07-02-2013, 09:25
Cecil's Avatar
Cecil Cecil is offline
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: Servo motor?

I saw the other thread, and I can't believe I made the fundamental mistake of not suggesting power to the Digital Sidecar. Hopefully applying power will fix everything easily.
__________________
I'm right 90% of the time, so why worry about the other 3%?
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 22:59.

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