Go to Post Pit Tools Distraction=bad - Lil' Lavery [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 11-02-2009, 16:32
brainsdmaner's Avatar
brainsdmaner brainsdmaner is offline
Registered User
AKA: Brian
FRC #1691
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Sidney MT
Posts: 4
brainsdmaner is an unknown quantity at this point
Button Help

We are trying to program our robot so that if you hold down the trigger on one joystick then the motor goes forward, and if you hold down the trigger on the other joystick the motor goes in reverse. we have tried while loops and they simply stop our drive train and nothing works. when we have tried to put in multiple if loops then the drive works but it goes in one direction and continues until we shut our bot down.

here is a picture of what we have right now.
Attached Thumbnails
Click image for larger version

Name:	print screen.jpg
Views:	40
Size:	149.8 KB
ID:	7403  Click image for larger version

Name:	print screen2.jpg
Views:	29
Size:	146.4 KB
ID:	7404  
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2009, 16:58
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: Button Help

You have not stated explicitly what you want the motor to do when neither of the joystick buttons have been depressed. I assume that you want the motor to stop. This may also be the problem with the code.

i.e.
Have you programmed the motor speed to be zero when neither of the buttons are pressed?

Incidentally, the Motor Control Set Speed.vi uses an input range from [-1, 1]. If you want a range from [0-255], then you use the Set Value.vi in the WPI Robotics Library->IO->PWM->Set Value.vi You can right click on the VI and select Help for additional details about each VI.

-Nate
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2009, 17:19
brainsdmaner's Avatar
brainsdmaner brainsdmaner is offline
Registered User
AKA: Brian
FRC #1691
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Sidney MT
Posts: 4
brainsdmaner is an unknown quantity at this point
Re: Button Help

well i'm trying to get it so that when you press button one on controller one, the motor turns one way. and then when you press button one on controller two, that the motor turns the other way. and when you don't press either of them it stops.

i tried this program below, but nothing on the bot works!!!

oh and by the way, thank you for any advice you can give and thank you nate for showing me the pwm stuff, i knew it was out there but i couldn't find it!
Attached Thumbnails
Click image for larger version

Name:	print screen3.jpg
Views:	38
Size:	105.6 KB
ID:	7406  
Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2009, 18:06
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Button Help

The latest picture doesn't make it clear which joystick is being read, especially for the top portion.

Anyway, as mentioned before, you really have four possible combinations, three of which you have to define.
Neither button pressed -- motor off (128 for value I guess).
Only J1 pressed -- motor one direction (255)
Only J2 pressed -- motor other direction (0)
Both J1 and J2 pressed -- ??? (may I suggest motor off)

Keep in mind that when you set a motor speed/power, it stays at that setting until you change it. So if you never set it to 128, your motor never stops.

There are many ways to write the logic once you decide what you want. The important thing to do is to walk through your code for each of the above combinations and determine what the result is -- does it match your desired outcome. If it gets too complicated or doesn't seem to do what you want, use probes to verify all your assumptions.

Greg McKaskle
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
Joystick Button Motor!!! HELP!!! furiousgeorge Programming 3 07-02-2009 22:57
Joystick Button Programming in Labview Help Needed domoarigato NI LabVIEW 11 28-01-2009 10:55
Button making Alex Burman Team Organization 7 10-10-2005 21:45
Button Programing BobcatProgramer Programming 6 25-02-2004 16:43
Button types Scottie2Hottie General Forum 7 27-03-2002 00:13


All times are GMT -5. The time now is 08:32.

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