Go to Post To paraphrase a common answer from the GDC: There is no rule that explicitly forbids this. - MechEng83 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-03-2016, 08:51
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: Teleop Automated Sequences

Thank you for the screen shot. It's actually quite different from the example Mark gave. There's no way I could have understood what you were trying to do based on your previous descriptions.

Now for the second part of what I asked: what exactly are you wanting it to do, and with what timing? Give me a detailed script of which motor is supposed to run, at what power and direction, at each moment of the sequence.


Here's what I see the code doing:
  • Wait for a button to be pressed on the joystick (it might take up to 100 milliseconds for the code to notice the button).
  • Run the Kicker motor in reverse at 75% power for 100 ms.
  • Stop the Kicker motor and run both Shooter motors in reverse at full power for 1500 ms.
  • Leave the Shooter motors running and run the Kicker motor forward at full speed for 1000 ms.
  • Stop the Shooter 1 motor and leave the Kicker and Shooter 2 motors running for 100 ms.
  • Wait 1000 ms while the Kicker and Shooter 2 motors continue running.
  • Leave the Kicker and Shooter 2 motors running with Shooter 1 stopped while waiting for the joystick button to be pressed again.

Here's what I see that doesn't look quite right:
  • You have merged Mark's example with the existing 100ms loop in Periodic Tasks. That's probably okay, but it was intended to be its own loop.
  • You're continually calling the RefNum Get functions throughout the sequence. It'll work, but it's a lot cleaner (and less wasteful of CPU cycles) to do it with a single RefNum Get for each motor and tunnel the RefNum between sequence frames the way the example shows.
  • You are wiring the Error values as if to force sequential operation. I don't see anywhere that changes the code's behavior, although the Flat Sequence itself is meant to do sequencing (that's why it has the name it does).
  • Shooter 2 is only controlled once, to turn it on.
  • You are not turning off all the motors when the sequence finishes.

I don't see anything that matches your earlier mention of 5000 milliseconds.
  #2   Spotlight this post!  
Unread 23-03-2016, 09:13
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Teleop Automated Sequences

Here's what Alan is talking about. I also tried to interpret what you're doing by guessing, so this probably isn't correct.

Check out the logic on the last sequence frame... it doesn't do anything unless you want to wait a second between restarting the shooter sequence.

Another added benefit of putting your RefNum Gets before the while loop is you only have one of each, which reduces the likelihood that you misspell the name and have something bad happen (if you have a interference mechanical design, such as what our robot has). This way, the whole mechanism works or doesn't work.
Attached Thumbnails
Click image for larger version

Name:	4368 Shooter Code Screenshot.png
Views:	40
Size:	27.0 KB
ID:	20427  
Attached Files
File Type: vi 4368 Shooter Code.vi (26.5 KB, 4 views)
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364

Last edited by RyanN : 23-03-2016 at 09:15.
  #3   Spotlight this post!  
Unread 23-03-2016, 12:05
Muzzle127 Muzzle127 is offline
Registered User
FRC #4368
 
Join Date: Mar 2016
Location: Kalamazoo
Posts: 5
Muzzle127 is an unknown quantity at this point
Re: Teleop Automated Sequences

Thanks guys, we will try out suggested changes on Thursday night and see if we can get it working.
  #4   Spotlight this post!  
Unread 23-03-2016, 12:58
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Teleop Automated Sequences

Quote:
Originally Posted by Muzzle127 View Post
Thanks guys, we will try out suggested changes on Thursday night and see if we can get it working.
To note, what I posted isn't a suggested change. I don't know what you want the code to do. I only based it off of what was definitely wrong in the code you posted earlier.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Closed Thread


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 04:30.

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