Go to Post We found our bandsaw on Craigslist for $40. We keep looking for laser cutters and waterjets in that price range, but so far no luck. - chapman1 [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 08-02-2010, 15:30
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Jiggly servo

We have a two speed transmission that shifts with a servo. We want to press the trigger button to shift between high and low gear. We want the program to Get the Servo angle...decide if it is in high gear (45) or low gear (120)...then shift into the opposing gear.

The problem with the program- program attached below- is... when we pull the trigger button the servo JIGGLES before it decides what gear it sets in. Most of the time it chooses the correct gear but not always.

Are we taking the wrong approach?
Attached Thumbnails
Click image for larger version

Name:	Servo test.jpg
Views:	25
Size:	3.7 KB
ID:	8559  
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2010, 15:33
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Jiggly servo

You want to trigger the change when the button is pressed, but right now you are triggering the change whenever the button is down. This results in it flickering between the two states as fast as the program cycles, and will 'randomly' pick one when you let go.

Try to figure out how you can only trigger when the button wasn't pressed but now is - only once per button push.

You are really close, I'm sure you'll get it quickly.

As a hint, the "shift register" will remember something one time tick in the past.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-02-2010, 15:38
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: Jiggly servo

It is probably best to think about the problem Eric highlighted for a bit and see if you can solve it yourselves (you'll learn more), but if you get stuck you may find this thread of interest:

http://www.chiefdelphi.com/forums/sh...light=one+shot
__________________


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
  #4   Spotlight this post!  
Unread 08-02-2010, 15:49
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,112
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: Jiggly servo

Quote:
Originally Posted by grosh View Post
Are we taking the wrong approach?
I think you are. Using a "toggle" function to shift between high and low gear isn't the sort of thing I'd want to use if I were driving. I would want one control to select high gear, and another control to select low gear.

However, if you really do want to make it work that way, Eric and Kevin have good advice. The thread Kevin linked to can show you a simple fix for your code if you understand what's going on.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-02-2010, 16:11
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Jiggly servo

Alan, I agree. We did have two buttons setup for the drivers, but they asked for a single button shift.

I really did not understand the threads. We don't have any trained talent on the programming team. We don't offer a class at our high school and we don't have any outside mentoring to help us learn. Everything we know we have learned through LVMastery and ChiefDelphi.

We will try Alan's "rising edge" program. We don't understand the logic in it, but I have seen the icons before.
Reply With Quote
  #6   Spotlight this post!  
Unread 08-02-2010, 16:15
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: Jiggly servo

Quote:
Originally Posted by grosh View Post
We will try Alan's "rising edge" program. We don't understand the logic in it, but I have seen the icons before.
The code Alan posted in that thread uses a feedback node to look at both the current value of the button and the last value of the button. The triangular gate is a NOT gate and inverts the true/false value coming out of the feedback node. The other gate is an AND gate which returns true if and only if both inputs are true.

So the code outputs true if and only if the button is pressed now and wasn't pressed the last time the code executed.
__________________


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
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
servo on DS eitang FRC Control System 1 16-01-2009 14:32
Servo Strength TJ4nier Motors 20 13-02-2007 02:59
Servo behavior question / advanced servo/PIC programming question DanL Electrical 12 18-10-2005 18:33
Buying Servo Gamer930 Motors 4 13-02-2005 20:44
Servo MASherry General Forum 6 04-10-2004 22:46


All times are GMT -5. The time now is 11:58.

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