Go to Post I swear, at IRI, Gary and I only talked about coming up with a plan to do away with Billfred, we didn't actually do anything... yet... - MissInformation [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 09-02-2016, 19:07
2386programming 2386programming is offline
Registered User
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Burlington
Posts: 34
2386programming is an unknown quantity at this point
Button not working, axis are.

We are trying to control our functional mechanisms using buttons on our controller. The problem that we have though, is that when we try to control it using buttons, the motor keeps rapidly turning on and off (basically twitching). When I map the control to an axis though. It works flawlessly. Using Labview.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2016, 19:28
2386programming 2386programming is offline
Registered User
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Burlington
Posts: 34
2386programming is an unknown quantity at this point
Re: Button not working, axis are.

When we use one case structure saying if button is true then turn on motor, if false then set output to zero. the moment we add another case structure to control the motor in the other direction, it starts twitching.
Reply With Quote
  #3   Spotlight this post!  
Unread 09-02-2016, 19:30
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,708
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Button not working, axis are.

Sounds like you're setting the output to the motor twice. You need to make sure you only set the output of the motor once in your loop.

If you can post a picture or snapshot of your code, we can tell you more exactly how you're going wrong.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #4   Spotlight this post!  
Unread 09-02-2016, 19:42
2386programming 2386programming is offline
Registered User
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Burlington
Posts: 34
2386programming is an unknown quantity at this point
Re: Button not working, axis are.

Here ya go
Attached Files
File Type: pdf Untitleddocument.pdf (38.9 KB, 27 views)
Reply With Quote
  #5   Spotlight this post!  
Unread 09-02-2016, 21:11
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,708
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Button not working, axis are.

Okay, I was hoping someone else would show up to draw up the correct solution, since I don't have Labview installed at the moment.

Anyways, you're definitely setting the output for the motor twice, because you have a set output VI in each of those case structures. To fix that, you need to do two things:

1. Only use one set output VI per motor. Delete all the Set output VIs in those case structures. Put one Set Output VI outside the case structure.

2. Use values inside the case structures to feed the Set Output VI. You want one big case structure with +1 inside the TRUE case, and ANOTHER small case structure inside big one's FALSE case. Then, put a -1 in the TRUE case of the smaller structure, and a 0 inside the FALSE case of the smaller structure.

I'll try to hack up a drawing in Paint or something since I don't have Labview. Or maybe we'll get lucky and someone with Labview will wire up what I just described. Feel free to post a screenshot of your attempt at what I just described there.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #6   Spotlight this post!  
Unread 09-02-2016, 23:17
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: Button not working, axis are.

Here's an example using buttons to drive a motor.
http://www.chiefdelphi.com/forums/at...6&d=1454729278
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #7   Spotlight this post!  
Unread 10-02-2016, 16:55
2386programming 2386programming is offline
Registered User
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Burlington
Posts: 34
2386programming is an unknown quantity at this point
Re: Button not working, axis are.

Great! Thank you very much! I'll give this a try.
Reply With Quote
  #8   Spotlight this post!  
Unread 11-02-2016, 12:26
2386programming 2386programming is offline
Registered User
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Burlington
Posts: 34
2386programming is an unknown quantity at this point
Re: Button not working, axis are.

It's not working for me, tell me if this looks right.
Attached Thumbnails
Click image for larger version

Name:	button code.png
Views:	19
Size:	135.6 KB
ID:	20037  
Reply With Quote
  #9   Spotlight this post!  
Unread 11-02-2016, 12:30
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: Button not working, axis are.

Sorry,

That will work as long as you continue to hold a button down.
As soon as the button is released the motor will stop.

Do you want something different to happen or is the motor still pulsing?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #10   Spotlight this post!  
Unread 11-02-2016, 12:38
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 123
aeastet is an unknown quantity at this point
Re: Button not working, axis are.

Quote:
Originally Posted by 2386programming View Post
It's not working for me, tell me if this looks right.
Did you register the mew motor controllers in the begin.vi?

This should work as long as each motor was set up in the begin file and has a unique PWM was selected for each motor. If it still is not working make sure that you have the correct button on the joystick selected.

If you put one motor control in the loop does it run?
Reply With Quote
  #11   Spotlight this post!  
Unread 11-02-2016, 12:55
2386programming 2386programming is offline
Registered User
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Burlington
Posts: 34
2386programming is an unknown quantity at this point
Re: Button not working, axis are.

I have them all initizlized in the begin.vi

The 3 controllers being used are a talon srx, talon, and victor. My problem is that only one motor turns with one button.
Reply With Quote
  #12   Spotlight this post!  
Unread 11-02-2016, 13:18
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 123
aeastet is an unknown quantity at this point
Re: Button not working, axis are.

Can you show the begin file where these VI's are registered?
Reply With Quote
  #13   Spotlight this post!  
Unread 11-02-2016, 13:26
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 123
aeastet is an unknown quantity at this point
Re: Button not working, axis are.

OK As I started looking at your code I notice a few things:

You have two inputs going to each motor controller. For the first one called "ArmPivot" You have button 3 on the joystick controlling the first t/f vi. and you have you have button 1 controlling the second t/f vi. Are you sure that you are getting the expected result for both of these values?

Do you know how to use a probe int he software? That would tell you a lot about what is going on. If you probe them and pull the trigger then you should see the probe value to change and you will start to be able to troubleshoot what is going on.
Reply With Quote
  #14   Spotlight this post!  
Unread 11-02-2016, 13:37
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 123
aeastet is an unknown quantity at this point
Re: Button not working, axis are.

Click image for larger version

Name:	button code.png
Views:	17
Size:	307.8 KB
ID:	20038

Look at this as well.
Reply With Quote
  #15   Spotlight this post!  
Unread 11-02-2016, 14:41
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 251
BitTwiddler is on a distinguished road
Re: Button not working, axis are.

Also I notice you don't have a button labeled zero (0). Just to be sure, the button marked one (1) on your gamepad is actually button zero (0) in the code. Arrays are weird that way and could affect the way the buttons operate versus what you want them to do.
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:25.

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