Go to Post On these forums, there are so many people that we see working all of the time to try to help teams out, and just overall good people. To everyone who does that, thanks. - miketwalker [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 21-03-2011, 09:54
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
old robot kicker question

I am rewriting the code for an old 2010 robot in 2011 style code.

the kicker is cocked by a pnuematic. when the kicker is kicked, the 3 double solenoids flip directions and springs kick the kicker.

I have figured out how to set it so it so it kicks when the kick button is held. I also have it so if it is kicked with button x, it kicks low, button y kicks medium, and button z kicks high using how many solenoids are activated (to control flow)

question #1

I am trying to make the solenoid go forward for 500ms and then retract (reverse) when a button is tapped (not held). i was told by the team's lead programmer to use a flat sequence structure.

I thought that i read that flat sequences were not allowed in teleop.vi. Also, i am not sure if a flat sequence is the right way to go.

any thoughts on what approach I should use?

Question #2

I am considering using one button to kick and 3 others to set kick power. as it is now, I could rewrite it so holding such power button while kicking would set power (no button held defaults to full power). not what i want. I would like to make it so hitting (not holding) the proper power button sets the power until another power button is hit. I am not sure how to do that.

I am a bit of a noob on this...

any advice?
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.

Last edited by ratdude747 : 21-03-2011 at 10:15.
Reply With Quote
  #2   Spotlight this post!  
Unread 21-03-2011, 10:00
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: old robot kicker question

A flat sequence is okay, but it goes in Periodic Tasks, not Teleop.

Teleop needs to remain streamlined, quick and simple, to keep up the 50Hz loop rate.
I wouldn't recommend putting much more than the basic drive train in there, unless it's direct joystick control of something.

Periodic Tasks is made for timed, sensor triggered, and sequenced events.
Tasks within it are also shared with both Autonomous and Teleop, although I imagine Auto isn't of much concern to you with an old robot.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 21-03-2011 at 10:07.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-03-2011, 10:40
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
Re: old robot kicker question

no sensors to speak of other than the pressure sensor for the compressor.

so the button presses must be in periodic? i though that anything buttons only had to be in teleop?
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.
Reply With Quote
  #4   Spotlight this post!  
Unread 21-03-2011, 11:20
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: old robot kicker question

The driver inputs, buttons and joysticks alike, can be checked anywhere you need to know what they are.

Periodic Tasks need to be within one of the infinite While loops there, so it keeps checking for a value change and your sequence can be repeated when it's needed.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #5   Spotlight this post!  
Unread 21-03-2011, 16:26
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
Re: old robot kicker question

I added a new while loop to the periodic tasks.

attached is the image of what is in the loop.

does it look right?

if so, then what about the 3 switch power toggle thing? if my controller (usb converted xbox) had a 3 way switch, then i'd use that. i don't, so what do i do? I think there might be a shift register involved... but I am not 100% sure.
Attached Thumbnails
Click image for larger version

Name:	kicker kode.jpg
Views:	16
Size:	94.7 KB
ID:	10454  
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.

Last edited by ratdude747 : 21-03-2011 at 16:29.
Reply With Quote
  #6   Spotlight this post!  
Unread 21-03-2011, 16:47
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: old robot kicker question

Quote:
Originally Posted by ratdude747 View Post
I added a new while loop to the periodic tasks.
attached is the image of what is in the loop.
does it look right?
You're going to need to throttle that loop. Without a wait like what's in the other periodic task loops, it'll run full bore and eat up all the CPU time it can. 50 ms is probably a good value.

Otherwise, it looks okay, except that I can't tell what's in the other cases of the power selection. The contents should be obvious, but there's always the chance that something got miswired by mistake.
Reply With Quote
  #7   Spotlight this post!  
Unread 21-03-2011, 17:23
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
Re: old robot kicker question

well, the problem is that in the loop is a flat sequence, with 2 frames. the first is timed for either 500, 625, or 750 ms (depends on kicking power), and the second is always 500ms

i thought that by itself would server as timing enough...

the power button has me confused... if this were digital electronics, all i would do is wire a nor gate to each reset of the flip-flop... but this isn't that

any ideas?
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.

Last edited by ratdude747 : 21-03-2011 at 17:29.
Reply With Quote
  #8   Spotlight this post!  
Unread 21-03-2011, 21:37
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
Re: old robot kicker question

I think i fixed it.

I found in the function block menu flip-flops. i used those to set the 3 button system. being an electronics guy, i knew how to wire them to do what i wanted.

I also moved the button/flip-flop section to the teleop.vi and clustered the kick boolean and the enum kick power to the periodic tasks.vi . i did it this way to make a future dashboard and/or autonomous project more modular.

i attached the teleop and periodic halves of the kick code. (well, screenshots)

edit- (not in pictures) i changed the cluster wire to a global variable. that way I can add it to my custom dashboard (I did, thanks to a tut. video), and if i want to do an autonomous demo, I can use the kicker without creating a conflict.
Attached Thumbnails
Click image for larger version

Name:	teleop kick.PNG
Views:	6
Size:	61.5 KB
ID:	10457  Click image for larger version

Name:	periodic kick.PNG
Views:	7
Size:	70.0 KB
ID:	10458  
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.

Last edited by ratdude747 : 22-03-2011 at 00:30.
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 20:40.

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