Go to Post I need a This-Is-What-I-Meant checker. - N7UJJ [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 16-02-2013, 11:51
BPtigers BPtigers is offline
Registered User
FRC #4663 (i8sumpi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Minnesota
Posts: 25
BPtigers is an unknown quantity at this point
Motor in Autonomous?

I have a motor I want to go up for about 5seconds in automous mode. How would I program that, Visuals are awesome I'm a newbie, thanks
__________________
Ben
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2013, 12:04
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: Motor in Autonomous?

The default auto code needs to be enabled and they you would replace the RobotDrive with a Motor Set. If you don't have safety config on the motor, there is no need to use the RobotDrive style of delay, you can use a sequence structure and a delay.

The attached image/visual shows some code that sets a motor to full speed one direction for five seconds and then sets it to speed zero.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	76
Size:	36.0 KB
ID:	14037  
Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2013, 23:39
BPtigers BPtigers is offline
Registered User
FRC #4663 (i8sumpi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Minnesota
Posts: 25
BPtigers is an unknown quantity at this point
Re: Motor in Autonomous?

I copied what you provided in the picture but to a bigger scale, the motor claws go down, but it sure doesn't seem like 6 seconds, and after that short burst of like a second nothing seems to happen, I must be doing something wrong in my code, but what could it be? My goal in autonomous is to have a claw come down an arm for 6 seconds, and after that the arm will go forward for 3 seconds, and after that the hooks will go forward for another 6 seconds for 15 seconds total. If anyone sees any errors please tell me, thanks, visuals are awesome I'm a newbie
Attached Thumbnails
Click image for larger version

Name:	autonous mode.PNG
Views:	60
Size:	16.8 KB
ID:	14106  
__________________
Ben
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2013, 04:47
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: Motor in Autonomous?

The code looks fine. Do you have 12V power to the digital breakout board? If not, it will work erratically.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2013, 09:59
chriz4gx chriz4gx is offline
Registered User
AKA: Christopher Villar
FRC #2871 (Beantown Botz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston,MA
Posts: 45
chriz4gx is an unknown quantity at this point
Re: Motor in Autonomous?

I just had a quick question about that my team is doing the same code but with different motors. But we want that the sequence repeats itself 3 times(For each frisbee) and then it sets the output of those motors to 0, how would I do that?
Reply With Quote
  #6   Spotlight this post!  
Unread 19-02-2013, 11:22
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: Motor in Autonomous?

Quote:
Originally Posted by chriz4gx View Post
I just had a quick question about that my team is doing the same code but with different motors. But we want that the sequence repeats itself 3 times(For each frisbee) and then it sets the output of those motors to 0, how would I do that?
FOR LOOP

Separate out the last frame (the set all to zero) and place the three Motor Set output out off to the right. (remove the last empty frame). Wire up the 3 MotorControlDevRef to each of the three. Then put a For Loop around JUST the "Flat Sequence Structure". Do not include the three (3) "MotorContolRefNum Registry Get" keep them off to the left or the last three Motor Sett Output keep them off to the right. Right click on the Auto Indexing terminals on the right side of the For Loop where the wires are now broken and select "Tunnel Mode > Last Value"

Create a constant from the For Loop Count Terminal [N] and set it to '3'
__________________
Omar

Last edited by Omar : 19-02-2013 at 11:28.
Reply With Quote
  #7   Spotlight this post!  
Unread 19-02-2013, 13:23
chriz4gx chriz4gx is offline
Registered User
AKA: Christopher Villar
FRC #2871 (Beantown Botz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston,MA
Posts: 45
chriz4gx is an unknown quantity at this point
Re: Motor in Autonomous?

I am still confused on implementing what you just described me. Can you possibly show me an code that explains what you mean. Is it suppose to look like this?
Attached Thumbnails
Click image for larger version

Name:	HELP.JPG
Views:	42
Size:	168.1 KB
ID:	14113  
Reply With Quote
  #8   Spotlight this post!  
Unread 19-02-2013, 13:30
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: Motor in Autonomous?

That look pretty good.

Does it work?

3 sec seems a little long for some of the shooter that I have seen.

One team that I work with has a rotating cam action and they fire very close to 1 per sec.

I have one team that used a while loop instead of a for loop to run for the whole 15 secs. It just kept shooting even when there were no disc to shoot. It helped with a retry when one disc failed to drop into position at first.
__________________
Omar

Last edited by Omar : 19-02-2013 at 13:36.
Reply With Quote
  #9   Spotlight this post!  
Unread 19-02-2013, 13:37
chriz4gx chriz4gx is offline
Registered User
AKA: Christopher Villar
FRC #2871 (Beantown Botz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston,MA
Posts: 45
chriz4gx is an unknown quantity at this point
Re: Motor in Autonomous?

"Right click on the Auto Indexing terminals on the right side of the For Loop where the wires are now broken and select "Tunnel Mode > Last Value"

This is the part I don't quiet understand I can't find those broken wires. I right click on the FOR Loop but I don't get one of those options. How would you do it using a While Loop? An No we hadn't tested it yet.
Reply With Quote
  #10   Spotlight this post!  
Unread 19-02-2013, 14:05
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: Motor in Autonomous?

The pic posted by Ben (BPtigers) had four sections with the last sections where he stops all the motors at the end (writes zeros).

To keep the shooter motors spinning in between disc you don't want to stop them until all 3 disc are shot.

So I instructed you to keep those outside of the for loop.
But you only used 3 sets of controls (which is perfectly OK) and did not use the last set after the For Loop (again no problem).

If you had done as I had suggested and wired up the thick pink Ref wire to VIs to right of the For Loop, the For Loop defaults to "Auto Indexing" and you would have gotten an Array of pink Ref. The "Motor Set Output" VI to right do not accept Arrays as input.

So you need to tell the For Loop not to Auto Index.

Try it! Put a "Motor Set Output" outside to the right of the For Loop and wire one of the pink Ref wires from inside the for loop to it. You should get a broken wire.

Then fix the broken wire by
Quote:
Right click on the Auto Indexing terminals on the right side of the For Loop where the wires are now broken and select "Tunnel Mode > Last Value
Do LabVIEW programmers everywhere a favor and vote for this ides on the LabVIEW idea Exchange
Smart autocorrecting autoindexing
__________________
Omar
Reply With Quote
  #11   Spotlight this post!  
Unread 19-02-2013, 14:30
chriz4gx chriz4gx is offline
Registered User
AKA: Christopher Villar
FRC #2871 (Beantown Botz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston,MA
Posts: 45
chriz4gx is an unknown quantity at this point
Re: Motor in Autonomous?

I think I got it! Is it suppose to look like this?

So I want the shooters(1+2) to be on all 15 seconds. An then we shoot a frisbee, load again, and then shoot again two times.
Attached Thumbnails
Click image for larger version

Name:	HELP II.JPG
Views:	39
Size:	176.8 KB
ID:	14114  
Reply With Quote
  #12   Spotlight this post!  
Unread 19-02-2013, 15:04
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: Motor in Autonomous?

Yes that looks correct as far as the LabVIEW programming.

But I do not know the finer details of YOUR system so you have to fine tune it.

Do you need to move 3 disc or only 2 disc into the Shooter?

From your delays, the For Loop will take more than 20 sec to cycle two times. The 15 sec Autonomous will abort this code before it has time to finish.

Also I see some code above this that seems to move your robot. Do you need to wait until the robot is at "stand still" before firing disc? Then you will need to work on that in a similar way.
__________________
Omar
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:59.

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