Go to Post Physical items will be lost along the way eventually but memories will never be forgotten. - Connor McBride [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 30-01-2013, 10:43
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Breaker Switches and Buttons to Motors

How do I wire the true/false of a joystick button into an if square thingy? And how do I make it so in one case it doesn't connect the wired but in another it does?

Also how do i change a button (green) to a motor value (orange) ...???

Thanks. And don't see the title "breaker switches" and post something about the compressor, i can't understand that in the compressor...
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2013, 11:27
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,752
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: Breaker Switches and Buttons to Motors

A case structure enforces you to produce data for all cases. If it didn't, and someone tried to use the data, it would be an uninitialized variable. You can move the motor update block into the structure itself and only call it in one frame, or you can output the same value that you sent the last iteration.

For changing a Boolean into a number, the typical approach is to use a case structure or a select block to choose between two numbers.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2013, 12:31
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

Quote:
Originally Posted by Greg McKaskle View Post
A case structure enforces you to produce data for all cases. If it didn't, and someone tried to use the data, it would be an uninitialized variable. You can move the motor update block into the structure itself and only call it in one frame, or you can output the same value that you sent the last iteration.
Do you basically mean "put the whole thing, joystick things and all inside of the if statement?
Also do you mean that just wiring my Boolean (in this case something that should be connected to breaker switches) up to the side of the diagram makes it determine what the if returns as?
Quote:
Originally Posted by Greg McKaskle View Post
For changing a Boolean into a number, the typical approach is to use a case structure or a select block to choose between two numbers.

Greg McKaskle
I'll try that, same section as ifs?

Thanks.
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2013, 16:25
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

How do I set up a single motor?
Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2013, 21:14
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,113
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: Breaker Switches and Buttons to Motors

Quote:
Originally Posted by sthreet View Post
How do I set up a single motor?
(I'll answer the question I think you're asking. If what I'm saying doesn't make sense, try asking again using different workds.)

The functions for working with individual motors are two more levels deep in the function palette: WPI Robotics Library >> RobotDrive >> Advanced >> MotorControl. Look at the "Motor Control.lvproj" example to see how the Motor functions are used.
Reply With Quote
  #6   Spotlight this post!  
Unread 30-01-2013, 22:34
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

Quote:
Originally Posted by Alan Anderson View Post
(I'll answer the question I think you're asking. If what I'm saying doesn't make sense, try asking again using different workds.)

The functions for working with individual motors are two more levels deep in the function palette: WPI Robotics Library >> RobotDrive >> Advanced >> MotorControl. Look at the "Motor Control.lvproj" example to see how the Motor functions are used.
So you are saying that motorcontrol initializes and controls a single motor with its y input as the forward and x input as backward? Not to ask stupid questions but why does it have no pwm thingy? Also i hooked up a single motor that i initialized as two motors (made both pwms the same) and tried it, didn't work... Do i have to change some pwms inside of it then?
Reply With Quote
  #7   Spotlight this post!  
Unread 30-01-2013, 23:25
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,113
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: Breaker Switches and Buttons to Motors

I didn't say anything like that. What did you see that made you think that's what I meant?


Do you understand what "WPI Robotics Library >> RobotDrive >> Advanced >> MotorControl" is referring to? Do you know how to find the FRC examples like "Motor Control.lvproj"?


Your terminology is very vague and informal, and it's making it difficult for me to understand how best to help you. Perhaps you should take advantage of some of the tutorials at http://frcmastery.com/ so we can communicate more effectively.
Reply With Quote
  #8   Spotlight this post!  
Unread 31-01-2013, 12:42
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

Quote:
Originally Posted by Alan Anderson View Post
Do you understand what "WPI Robotics Library >> RobotDrive >> Advanced >> MotorControl" is referring to? Do you know how to find the FRC examples like "Motor Control.lvproj"?


Your terminology is very vague and informal, and it's making it difficult for me to understand how best to help you. Perhaps you should take advantage of some of the tutorials at http://frcmastery.com/ so we can communicate more effectively.
No, i probably don't; i'll check it out later when i get to the computer; probably mixed it up with something else...

Sorry about that, will check that link and try being more specific.

EDIT: Sorry, was mixing up drive and motorcontrol...

Last edited by sthreet : 31-01-2013 at 16:15.
Reply With Quote
  #9   Spotlight this post!  
Unread 31-01-2013, 19:03
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

UPDATE: We have a bug:

I've narrowed it down to the following:

A DIO get refnum is wired into the get for DIO In which is wired into a case structure, in the false part of the case structure a get refnum for the motor i am using is connected to a set output (which the input of the set out and the motor stuff should be working because it was working before i put it in a case structure. Another setup of what is show above is their except for a different DIO.

I'm pretty sure the error is with the way i did the DIO... Buttons operate case structure fine and worked before i put motor in the case structure, breaker switches hooked up and tried with them on and off, didn't work...

EDIT: I deleted the wires from the DIO in get and wired false things to that, one direction works find now but the other (each case statement is a direction) goes in spurts and at like half speed...

Last edited by sthreet : 31-01-2013 at 19:11.
Reply With Quote
  #10   Spotlight this post!  
Unread 31-01-2013, 22:48
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,113
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: Breaker Switches and Buttons to Motors

What do/did you have wired to the DIO pins?

The "one way works haltingly at half speed" symptom points to a common programming mistake. You're trying to run the motor one direction with the first case block, and the other direction with the second case block, right? The problem is probably that both blocks are turning off the motor in their False case. You have two places setting the motor speed, and one of them "wins". Imagine you're trying to run the motor forward. The "turn it off when not requesting backward" case turns it off, but the "turn it on when requesting forward" immediately turns it on and it works as you expect. But when you try to run the motor backward, the "turn it on when requesting backward" case turns it on, but the "turn it off when not requesting forward" immediately turns it off and it only gets a little twitch of motion.


Do you want to use two joystick buttons to control a motor's forward/reverse motion? There are examples of how to do exactly that posted on the Chief Delphi forums; do a forum search for "button motor" and you'll find lots of helpful advice.
Reply With Quote
  #11   Spotlight this post!  
Unread 01-02-2013, 10:27
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

What i'm saying is that my joystick buttons worked fine using a case structure and constant numbers to control them, now that i split the motor up into two other case structures that have the input of the DIO (both in the false position) they still rely on pushing a button, but one works weirdly, and considering i kept the code the same with different names (to reference different things) I wonder why this is... One is one, other is negative one and if i press both buttons they cancel out and do nothing...

I'll see if i can look at DIO pins, not 100% certain what that is but i should be able to figure it out, either with google or my teacher/mentor/whatever you call him might know.

EDIT: I suppose if I can't figure it out today i'll take some pictures of what the code is and put that up.

Last edited by sthreet : 01-02-2013 at 10:41.
Reply With Quote
  #12   Spotlight this post!  
Unread 01-02-2013, 11:52
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,113
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: Breaker Switches and Buttons to Motors

Quote:
Originally Posted by sthreet View Post
EDIT: I suppose if I can't figure it out today i'll take some pictures of what the code is and put that up.
That would be very helpful. For example, you've been referring to DIO inputs, but I'm pretty sure that's not what you mean. Seeing what you're actually doing will be good.
Reply With Quote
  #13   Spotlight this post!  
Unread 04-02-2013, 15:40
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

Sorry, was lazy over the weekend, will get it in when i get home today.

EDIT: Also where do I find the things for the logitech gamepad F310?
Attached Thumbnails
Click image for larger version

Name:	007.JPG
Views:	21
Size:	369.7 KB
ID:	13794  Click image for larger version

Name:	008.JPG
Views:	16
Size:	401.3 KB
ID:	13795  Click image for larger version

Name:	009.JPG
Views:	10
Size:	374.7 KB
ID:	13796  Click image for larger version

Name:	010.JPG
Views:	11
Size:	324.6 KB
ID:	13797  Click image for larger version

Name:	011.JPG
Views:	15
Size:	321.1 KB
ID:	13798  


Last edited by sthreet : 04-02-2013 at 19:08.
Reply With Quote
  #14   Spotlight this post!  
Unread 04-02-2013, 19:07
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

Here's some, i'll edit the others into my previous posts.
Attached Thumbnails
Click image for larger version

Name:	002.JPG
Views:	13
Size:	380.1 KB
ID:	13789  Click image for larger version

Name:	003.JPG
Views:	9
Size:	93.5 KB
ID:	13790  Click image for larger version

Name:	004.JPG
Views:	11
Size:	339.2 KB
ID:	13791  Click image for larger version

Name:	005.JPG
Views:	13
Size:	368.6 KB
ID:	13792  Click image for larger version

Name:	006.JPG
Views:	9
Size:	279.4 KB
ID:	13793  

Reply With Quote
  #15   Spotlight this post!  
Unread 04-02-2013, 19:09
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: Breaker Switches and Buttons to Motors

Edit doesn't seem to be their for the one before you posted...
Attached Thumbnails
Click image for larger version

Name:	012.JPG
Views:	10
Size:	278.2 KB
ID:	13799  Click image for larger version

Name:	013.JPG
Views:	13
Size:	348.4 KB
ID:	13800  Click image for larger version

Name:	014.JPG
Views:	9
Size:	418.1 KB
ID:	13801  Click image for larger version

Name:	015.JPG
Views:	19
Size:	295.5 KB
ID:	13802  
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: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