Go to Post Consider how nature does this, and emulate. Nature usually has a pretty good algorithm. - DonRotolo [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-2009, 14:55
elbuo elbuo is offline
Teams #2884 and #1144
AKA: Yamil Asusta
FRC #1144 (Coquitron)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Puerto Rico
Posts: 89
elbuo has a spectacular aura aboutelbuo has a spectacular aura aboutelbuo has a spectacular aura about
Trying to control 1 motor with 2 buttons

I've passed couple of hours trying to make one globe motor work with joystick buttons

I want that #2 makes the motor spin right and the #4 makes the motor spin left.

I open a Get from joystick and I set the buttons I plan to use. Then I open a loop where false is empty but in True I add an open Motor and I can't seem to find the way to connect them all together... And to specify where to should each one should spin...

If anyone can explain me or show me a small SS I would really appreciate it
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2009, 14:59
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Trying to control 1 motor with 2 buttons

you need to open the motor outside of teleop. once the motor is open, you set it inside the case structure.
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
Reply With Quote
  #3   Spotlight this post!  
Unread 08-02-2009, 15:39
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
Re: Trying to control 1 motor with 2 buttons

I posted a picture of some code that will do this for you that is simpler than using a case structure. It uses some logic gates in the code and ensures that the relay is set only once during each loop execution. If you are controlling jaguars or victors than you can just change the set relay to set speed and submit constants (255, 127, or 0 or any degree thereof) to the true/false cases for the select blocks.

Here is the thread.

http://www.chiefdelphi.com/forums/sh...ad.php?t=73908

feel free to post if you have any more questions! Hope this helps!
Reply With Quote
  #4   Spotlight this post!  
Unread 08-02-2009, 15:46
elbuo elbuo is offline
Teams #2884 and #1144
AKA: Yamil Asusta
FRC #1144 (Coquitron)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Puerto Rico
Posts: 89
elbuo has a spectacular aura aboutelbuo has a spectacular aura aboutelbuo has a spectacular aura about
Re: Trying to control 1 motor with 2 buttons

Problem is that the I can't find the way to wire the joystick buttons to that motor....
I couldn't understand the relay thing either...
Reply With Quote
  #5   Spotlight this post!  
Unread 08-02-2009, 16:46
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
Re: Trying to control 1 motor with 2 buttons

are you trying to control a relay or a jaguar/victor?
Reply With Quote
  #6   Spotlight this post!  
Unread 08-02-2009, 17:12
elbuo elbuo is offline
Teams #2884 and #1144
AKA: Yamil Asusta
FRC #1144 (Coquitron)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Puerto Rico
Posts: 89
elbuo has a spectacular aura aboutelbuo has a spectacular aura aboutelbuo has a spectacular aura about
Re: Trying to control 1 motor with 2 buttons

Specifically a Jaguar
Reply With Quote
  #7   Spotlight this post!  
Unread 08-02-2009, 17:24
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
Re: Trying to control 1 motor with 2 buttons

sure okay. To do this I would use code similar to what i posted in the picture and instead of assigning forward/ reverse/off to the block selectors use integer values. 255 would be full power in one direction, 0 would be full power in the other direction and 127 would be off. Also, instead of using the set relay use the set speed to connect to the output of the block selector.

It might be easier to just use a relay instead of a jaguar unless you really need to control speed.
Reply With Quote
  #8   Spotlight this post!  
Unread 08-02-2009, 18:01
elbuo elbuo is offline
Teams #2884 and #1144
AKA: Yamil Asusta
FRC #1144 (Coquitron)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Puerto Rico
Posts: 89
elbuo has a spectacular aura aboutelbuo has a spectacular aura aboutelbuo has a spectacular aura about
Re: Trying to control 1 motor with 2 buttons

What is a relay?
I'm a rookie and I don't know some stuff....
Reply With Quote
  #9   Spotlight this post!  
Unread 08-02-2009, 18:27
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
Re: Trying to control 1 motor with 2 buttons

sorry about that. they are also known as the spikes. They cannot be used to power the CIMs (against the rules), but they can be used to power smaller motors like the globe motors. On the spike there is M+ and M- on one side. On the other side there is 12V and GND. The M+ and M- is for the motor leads. the 12V and Gnd is for power to the motor. there is also a three terminal header in the spike. it is rectangular and a pwm cable plugs into that which delivers the signal from the digital I/O sidecar to the spike.

The relay is pretty much just an on/off or forward/off/reverse device. There is no speed control. Determining if you need speed control depends on the application for the motor.

In the WPI libraries there are VIs written for controlling the spike. I think they are under WPI Library-->Actuators-->Relay. By putting those VIs into the code and then clicking the question mark in the right hand corner and hovering over the icon you will get a description of what he inputs and outputs are to the vi.

Here is also more info from NI.
http://decibel.ni.com/content/docs/DOC-3321

hope this helps!
Reply With Quote
  #10   Spotlight this post!  
Unread 08-02-2009, 18:35
elbuo elbuo is offline
Teams #2884 and #1144
AKA: Yamil Asusta
FRC #1144 (Coquitron)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Puerto Rico
Posts: 89
elbuo has a spectacular aura aboutelbuo has a spectacular aura aboutelbuo has a spectacular aura about
Re: Trying to control 1 motor with 2 buttons

Oh the Spikes! Oh Lala!
I'll use those then! I'll check tomorrow and let you know.

Thanks
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
programming a motor to two buttons solomason519 Programming 2 28-01-2009 12:37
Programming Joystick Buttons to toggle a motor on and off programmr C/C++ 6 25-01-2009 17:47
[FTC]: Random Error with FTC motor control Xaphiinia FIRST Tech Challenge 2 01-12-2008 15:39
What to do with buttons Storcky General Forum 20 14-06-2006 22:07
Buttons, Buttons and more Buttons (2006) Freddy Schurr Team Organization 11 14-12-2005 21:36


All times are GMT -5. The time now is 16:35.

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