Go to Post Dean Kamen, you deserve a cookie. - Jessica Boucher [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 02-02-2013, 11:56
KissMySass3763 KissMySass3763 is offline
3763
AKA: Madeline Mapes
FRC #3763 (Wild Cards)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Richlands
Posts: 13
KissMySass3763 is an unknown quantity at this point
Servo Motors

I am trying to program a servo motor in a true/ false statement o that when a button is pressed, the servo motor will rotate. I really have no idea how to do that, or even if I should be using a case structure at all. Where do I start?

Madeline
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2013, 12:19
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Servo Motors

What you desire to have happen probably needs better definition.

Here is an example of pressing and holding a button to move a servo.
When the button is released the servo returns to a preset position.


If you want the button to move the servo permanently to a position, then a simple case statement might do it.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2013, 12:40
KissMySass3763 KissMySass3763 is offline
3763
AKA: Madeline Mapes
FRC #3763 (Wild Cards)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Richlands
Posts: 13
KissMySass3763 is an unknown quantity at this point
Re: Servo Motors

It may be better defined as a timed system, but with no timer involved. I want the button to tel th servo to rotate 180 degrees and then return to the origional angle, but without having to hold the button down. do not know if that is even possible.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2013, 12:44
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Servo Motors

That would have to be a timed action.
There is no sensor feedback built in to the servo that your code can call to check to see when the servo reaches the 180 degree mark.
All your code knows is that it ordered a turn to 180 degrees, not whether the servo arrives there or not.

You'd have to add a potentiometer that your code could read from for feedback.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2013, 13:07
KissMySass3763 KissMySass3763 is offline
3763
AKA: Madeline Mapes
FRC #3763 (Wild Cards)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Richlands
Posts: 13
KissMySass3763 is an unknown quantity at this point
Re: Servo Motors

How would I write the code for a timer, and then wire it into my code for the servo, in that case?
Reply With Quote
  #6   Spotlight this post!  
Unread 02-02-2013, 14:42
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Servo Motors

You have a couple of options.

Here is one that works only in Periodic Tasks.vi, but is pretty straight forward:


If you want it in Teleop.vi, then you have to set a timer and check it each time through Teleop to act when the timer expires.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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:51.

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