Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Breaker Switches and Buttons to Motors (http://www.chiefdelphi.com/forums/showthread.php?t=112357)

sthreet 30-01-2013 10:43

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

Greg McKaskle 30-01-2013 11:27

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

sthreet 30-01-2013 12:31

Re: Breaker Switches and Buttons to Motors
 
Quote:

Originally Posted by Greg McKaskle (Post 1224480)
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 (Post 1224480)
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.

sthreet 30-01-2013 16:25

Re: Breaker Switches and Buttons to Motors
 
How do I set up a single motor?

Alan Anderson 30-01-2013 21:14

Re: Breaker Switches and Buttons to Motors
 
Quote:

Originally Posted by sthreet (Post 1224701)
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.

sthreet 30-01-2013 22:34

Re: Breaker Switches and Buttons to Motors
 
Quote:

Originally Posted by Alan Anderson (Post 1224894)
(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?

Alan Anderson 30-01-2013 23:25

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.

sthreet 31-01-2013 12:42

Re: Breaker Switches and Buttons to Motors
 
Quote:

Originally Posted by Alan Anderson (Post 1225008)
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...

sthreet 31-01-2013 19:03

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

Alan Anderson 31-01-2013 22:48

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.

sthreet 01-02-2013 10:27

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.

Alan Anderson 01-02-2013 11:52

Re: Breaker Switches and Buttons to Motors
 
Quote:

Originally Posted by sthreet (Post 1225821)
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.

sthreet 04-02-2013 15:40

Re: Breaker Switches and Buttons to Motors
 
5 Attachment(s)
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?

sthreet 04-02-2013 19:07

Re: Breaker Switches and Buttons to Motors
 
5 Attachment(s)
Here's some, i'll edit the others into my previous posts.

sthreet 04-02-2013 19:09

Re: Breaker Switches and Buttons to Motors
 
4 Attachment(s)
Edit doesn't seem to be their for the one before you posted...


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi