Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Linear Actuator Programming Help (http://www.chiefdelphi.com/forums/showthread.php?t=133163)

Luid101 19-01-2015 15:30

Linear Actuator Programming Help
 
1 Attachment(s)
Hey I just finished programming the linear actuators for our team but i have this problem. My linear actuators are supposed to lift at the push of a button until it hits the top switch then come down at the push of another button until it hits the bottom switch. All that stuff happens but the code updates the jaguars irregularly. Like update-wait for some time-update etc. I think it might be the way my loop but i am not sure. Could you guys check it out? THANKS!!! :confused:

Alan Anderson 19-01-2015 16:08

Re: Linear Actuator Programming Help
 
You have a 5 millisecond wait in the "Allows actuator movement Downwards" case. Why?

How are you ensuring that you aren't simultaneously sending two different commands to the Linear Actuator0 motor?

There's a lot of nearly incomprehensible stuff going on at the left side of your picture. What is all of that supposed to be doing? (If it's what I suspect, you can probably replace it all with two feedback nodes and a couple of boolean functions.)

Is all of the code inside one of the timed loops in Periodic Tasks? If so, which one?

Luid101 19-01-2015 16:31

Re: Linear Actuator Programming Help
 
Ok.The code is in the timed tasks vi. The code at the left side is a toggle switch for the joystick input. If you could show us a better way of coding it we would be grateful! I am pretty new to labview programming so I am not sure if there should be a wait or not, I saw it there so I didn't tamper with it.

Luid101 19-01-2015 16:34

Re: Linear Actuator Programming Help
 
Oh and I have no idea how to ensure that linear actuator0 doesn't recive two different inputs we could use some help with that too. Thanks!!!

Alan Anderson 19-01-2015 16:46

Re: Linear Actuator Programming Help
 
Quote:

Originally Posted by Luid101 (Post 1430619)
Ok.The code is in the timed tasks vi.

Is it outside all of the timed while loops in that vi, or is it inside one of them? If it's inside a while loop, which one is it in?

Quote:

The code at the left side is a toggle switch for the joystick input. If you could show us a better way of coding it we would be grateful!
If you can tell me what you want the code to do, I'm sure I can show you an efficient way of telling LabVIEW how to do it. The phrase "toggle switch for the joystick input" isn't enough detail for me to know what you want.

Quote:

I am pretty new to labview programming so I am not sure if there should be a wait or not, I saw it there so I didn't tamper with it.
There are specific places for wait functions, and specific reasons for using them. Besides the timed loops in Periodic Tasks, the only place I think I have put them in a robot program would be in a flat sequence in Autonomous Independent (or a flat sequence in Periodic Tasks, but that's a very special case).

protoserge 19-01-2015 17:02

Re: Linear Actuator Programming Help
 
Are you intending to use a linear actuator on this year's competition robot? If so, verify it is using a motor in the table listed in Rule R18. If it does not have one of those motors, it will not be a legal item unless there is an official GDC Q&A ruling that states otherwise.

Luid101 19-01-2015 17:06

Re: Linear Actuator Programming Help
 
Quote:

Originally Posted by Alan Anderson (Post 1430631)
Is it outside all of the timed while loops in that vi, or is it inside one of them? If it's inside a while loop, which one is it in?

It was inside the "10 ms tasks" loop but in an attempt to reduce lag I changed the wait time on the timer to 5 ms.

Quote:

Originally Posted by Alan Anderson (Post 1430631)
If you can tell me what you want the code to do, I'm sure I can show you an efficient way of telling LabVIEW how to do it. The phrase "toggle switch for the joystick input" isn't enough detail for me to know what you want.

We need the code on the left to make a button on the joystick toggle a Boolean value. Which we will use to tell the actuator to move or be stationary.

Luid101 19-01-2015 17:11

Re: Linear Actuator Programming Help
 
Quote:

Originally Posted by stinglikeabee (Post 1430648)
Are you intending to use a linear actuator on this year's competition robot? If so, verify it is using a motor in the table listed in Rule R18. If it does not have one of those motors, it will not be a legal item unless there is an official GDC Q&A ruling that states otherwise.

Yup we are using the Dart Linear actuators along with the Sim motors they came with. They are the same ones in the robot in 3 days build they should be allowed.

ozrien 19-01-2015 21:01

Re: Linear Actuator Programming Help
 
Since you're using Jags, would be easier to wire the limit switch inputs of the Jag to the Dart Actuator? Should work even in PWM mode. I know the Ri3d team did the same thing with Talon SRXs (which also have inherent limit switch inputs).

Zentx 20-01-2015 00:16

Re: Linear Actuator Programming Help
 
Quote:

Originally Posted by ozrien (Post 1430776)
Since you're using Jags, would be easier to wire the limit switch inputs of the Jag to the Dart Actuator? Should work even in PWM mode. I know the Ri3d team did the same thing with Talon SRXs (which also have inherent limit switch inputs).

I'm part of the electrical team. I was wondering how you would wire the limit switches to Jags. What we are trying to do is, toggle up and down when we want it to. So if i were to wire the limit switches to the Jags, if it clicks, would it automatically switch directions or wait for the next command? Would any coding be necessary?

Zentx 20-01-2015 23:23

Re: Linear Actuator Programming Help
 
Basically what we want is to press a button and make it go forward until it hits the limit switch, we want it to stay stationary at that point until a command is given to go in the reverse direction where it should also hit another limit switch and stop. Our previous code did not allow us to move in the opposite direction until both switches have been released.

The wires have been already soldered onto PWM pins and connected to the DIO. I really don't want to cut the connections and rewire it to 2 pin connectors to hook it up to the Jags.If anyone has a solution i would be so grateful!:D

mshafer1 21-01-2015 00:09

Re: Linear Actuator Programming Help
 
2 Attachment(s)
I have attached a snippet (LabVIEW generated picture that can be dropped back in LabVIEW to turn back into code) that shows one way of doing this, if I understand what you are saying correctly, you need the linear actuators to stay on their course until either the the driver sends a different command, or the limit switches say to stop. I think I have shown that in this code, if you have any questions, you could send me a private message and I would be more than happy to help you get more figured out.

I attached my original snippet, then realized that I had a typo, when I went back to fix it, I also realized that it could be simplified a little. Using the shift register in this way is really the same as using the feedback node, just that some say that this way is cleaner.

Zentx 21-01-2015 11:27

Re: Linear Actuator Programming Help
 
Thanks For The Code! Going to test it out soon.:D

Luid101 22-01-2015 11:36

Re: Linear Actuator Programming Help
 
Hey thanks for the code! But we are using digital inputs instead of switches and i think that should change the whole code.

Alan Anderson 22-01-2015 13:01

Re: Linear Actuator Programming Help
 
Quote:

Originally Posted by Luid101 (Post 1432167)
Hey thanks for the code! But we are using digital inputs instead of switches and i think that should change the whole code.

Digital inputs are what the code uses to read switches.


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

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