Go to Post Dean looks rather debonaire in a tux. Like some sort of engineer super hero. The tuxedo is like his Clark Kent costume under which lies his amazing denim suit, to be whipped out at a moments notice in the face of uninspired youth and problems unconquered. - phrontist [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 12-07-2013, 22:29
joecloud joecloud is offline
Registered User
FRC #2805
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Texas
Posts: 22
joecloud is an unknown quantity at this point
Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

Hey guys, so I've been testing out Autonomous mode (haven't had a chance to deploy it yet). But the main thing I'm trying to accomplish is learn how to use that tool- Since we didn't use it during the Ultimate ascent competition. But I'm not sure if the code is right, I drew it as what I thought would be a logical manner- But I'm still learning, any tips/feedback is appreciated.
It is designed to shoot at the 1 point corner goals. My intentions with the code is as follows:


-Robots moves for 3 seconds towards goal. and the main shooter motor spins up during that time.
-Robot stops, note: shooter motor (Push 1) will spin until the entire program is done.
-Feeder (arm motor that will push frisbee forward into Shooter motor) will move forward moving frisbee forward.
-Feeder arm retracts, Servo 1 (it acts as a gate, so frisbees can't drop into loader until the loader is empty) opens, allowing frisbees to pass.
-feeder arm pushes forward again, launching frisbee #2. while servo 1 returns to original block position.
-Feeder arm retracts, Servo 1 opens, allowing frisbee #3 to pass.
-Feeder arm pushes forward frisbee to Push 1 motor, which launches frisbee #3 into goal.
-Everything terminates.


I attached a screenshot in this post of what it currently looks like.
As well as the vi itself.


Thanks guys,
Attached Thumbnails
Click image for larger version

Name:	autonomous independent.PNG
Views:	168
Size:	45.9 KB
ID:	15061  
Attached Files
File Type: vi Autonomous Independent.vi (56.0 KB, 12 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 13-07-2013, 00:52
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

Just looking at it briefly, it seems your drive forward would actually drive in an arc either left or right, depending on your mechanical setup. This can be fixed either by using Tank Drive, or by changing the x-value to 0, so no turning occurs.

Secondly, your fire/reset code looks to be fine; however, you may run into an issue that you need to actuate the arm motor and the servo at different times due to the nature of your loading mechanism.

Thirdly, it is worth pointing out that the servo may have ambiguous behavior at the end of autonomous. I do not recall off hand whether the ServoClose resets the servo or just cuts the output. You may need to set the position at the end to reset it, if that is what you want.

I am not seeing anything else, but I may have missed something. I would advise talking to someone from 33, as their code is insane and they are brilliant with LabVIEW.
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner
Reply With Quote
  #3   Spotlight this post!  
Unread 13-07-2013, 05:27
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

Unless the robot runs into something at the end of the driving, it is likely to be inconsistent in the distance it drives, possibly enough that the discs often miss. Perhaps consider using an encoder on the drivetrain and some form of closed-loop control (PID or something as simple as "drive until the encoder reaches a certain count").
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist
Reply With Quote
  #4   Spotlight this post!  
Unread 13-07-2013, 09:37
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: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

Just to add a bit to the other posts. You most likely do not want to close the servo at the end of autonomous. Once closed, it will not work unless reopened in teleop. You are leaving the other references alone, and you likely want to do the same for the servo.

You may be able to test out some of this using the simulator. The servo and motor for shooting will not be controlling anything, but the error with the arc instead of straight line would be pretty obvious when viewed in the simulator. Some of the other values you can chart or observe using probes or dashboard.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 13-07-2013, 13:02
joecloud joecloud is offline
Registered User
FRC #2805
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Texas
Posts: 22
joecloud is an unknown quantity at this point
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

Thank you all for your quick feedback!
I fixed the Servo close, and replaced it with a set angle=0
I also changed the x-value in arcade drive to a 0.

-Aaron.Graeve: I will deploy the code Monday and see if an issue is caused by the reset causes a problem for loading the frisbee. I think I'll go ahead and build a backup fixing the pontential problem though. thanks,

-z_beeblebrox: The encoder and so on, does that work based off a sensor? Like the Allen-Bradley Rightsight? What we've discussed is getting a rough estimate of how much time it takes for the bot to reach the goal, and then allow it to fire, in labview that's how I have it set up right now. But I'd like to figure out how the sensor works in labview, and how it would interact with the drive motors, right now I'm not visualizing it. Thanks though,

-Greg McKaskle: I'm going to load up the simulator when I get a chance, thanks!
Attached Thumbnails
Click image for larger version

Name:	2nd.PNG
Views:	36
Size:	46.9 KB
ID:	15064  
__________________
--
Joe,
Programming: Team #2805
Reply With Quote
  #6   Spotlight this post!  
Unread 13-07-2013, 13:17
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

Quote:
Originally Posted by joecloud View Post
-z_beeblebrox: The encoder and so on, does that work based off a sensor? Like the Allen-Bradley Rightsight? What we've discussed is getting a rough estimate of how much time it takes for the bot to reach the goal, and then allow it to fire, in labview that's how I have it set up right now. But I'd like to figure out how the sensor works in labview, and how it would interact with the drive motors, right now I'm not visualizing it. Thanks though,
An encoder is a sensor that measures the amount rotation of a shaft. By attaching one to the gearbox in a robot's drivetrain, you can measure how far the robot has driven by doing some simple math based on the gear reductions and wheel size.

I'm no expert on LabVIEW so can't explain how to program the robot to use sensors. Others on the forum should be able to help you with that.

Also, I missed that you were shooting at the one-point goal. If so, just driving a little longer than it takes to ram the wall should get you there without a problem.
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist

Last edited by z_beeblebrox : 13-07-2013 at 13:19.
Reply With Quote
  #7   Spotlight this post!  
Unread 13-07-2013, 15:02
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 432
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

It's been a few years since I've worked with labview, but you should be able to easily integrate an encoder to better approximate how far you have driven.

It can literally be as simple as setting up the encoder VI (see first link below for a brief guide on using the encoder), and in the first frame of your sequence structure, have a loop which terminates when the encoder value is greater than the distance you want to travel. You can tune in your motor speeds and the distance to drive empirically.

You're not going to end up at the exact same spot every time this way, but it's going to be A LOT more accurate than time based movements. The problem with using time is that you can't account for the real world variables, like your battery voltage being different every match, wheel slippage, etc.). By adding sensors to your robot you don't have to worry about some of these variables (it doesn't matter if you get to the desired distance in 3.1s or 2.97s, you only care that you got to your desired distance).

You may also find that when sending the same voltage to the left and the right side of your drivetrain, that it doesn't drive straight. This can be accounted for in mechanical differences between each side (different amounts of slop in chains) or that the weight distribution isn't even between the sides, or that the motors themselves actually have different top speeds in fwd/rev.
To account for this you can look into adding a gyro onto your robot.

If you want to learn a few things in the off season to really help your performance in auto mode. You can give yourself a real advantage if you know how to make your robot:
- drive a set distance (encoders) and drive in a straight line (gyro)
- and turn a specific number of degrees (gyro)


Some resources:
How to interface w/ sensors in labview
FRC Mastery - An older, but awesome set of video tutorials on a large number of topics

There are is an encoder and gyro example here
And a number of good examples here
__________________
http://team2168.org
Reply With Quote
  #8   Spotlight this post!  
Unread 16-07-2013, 00:16
joecloud joecloud is offline
Registered User
FRC #2805
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Texas
Posts: 22
joecloud is an unknown quantity at this point
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

Alright, thank you all so much for explaining that. We've looked into it, but I think I'm going to save it for the fall so I can use it as a tool to help teach other programming team members labview. Mainly due to time constraints.
I had the opportunity of working on the code and the robot today.
Based on the code I included above in my first post. I'm having troubles getting the autonomous mode to work correctly, when I enable it- it launches and the drive wheels do spin up- but they are doing what Aaron pointed out (spinning in place), even though I did correct the code and I did set the x-value to 0. The left wheels are going in one direction, while the right side are going the other direction, I don't recall which direction they were going in though. I do know that our begin.vi specifies that the LeftMotorInverted value is set to 'True' on the open4motor block (can jaguar).
I've tried different combinations, but if you all have a specific combination of values that should work-I will test that tomorrow. Also if there is another trick that will fix this problem that only occurs in autonomous, I'd really like to know what your thoughts are.

Another problem I've noticed is with Push1, the Shooter CIM motor, even though I set the value to '1' for Set Motor Output, it only turns on for a fraction of a second, and then winds down. It won't stay on, teleop mode works fine though. I've found a block labeled "Motor Enable" Under the same motor palette, and I currently have it included in the code, but I have not deployed it yet. Do you all think this would solve the issues? And if so, if I need to set any additional values for it besides giving it a reference and connecting the output to the next "Set Output" block? And if it isn't, what might be causing the motor to only do 1 360degree turn before winding down.


Also, as for the Feeder, and Servo 1, I have not yet had the chance to test the effectiveness of having them running concurrently, or switching them so they run separately like Aaron pointed out, but I did have to change the output values for feeder to things such as 90, and -90 (instead of '1', and '-1'), to get it to move the amount of degrees I wanted it to, (I'm not sure what kind of motor it is, but It isn't a cim motor, it acts like a large servo motor that it hooked up to a jaguar.) But anyways, both the servo and feeder are working fine.

Sorry for the large body of text, and thank you all for your suggestions! I really do appreciate it!
__________________
--
Joe,
Programming: Team #2805
Reply With Quote
  #9   Spotlight this post!  
Unread 16-07-2013, 08:33
Doug Norman's Avatar
Doug Norman Doug Norman is offline
Registered User
no team (National Instruments)
Team Role: Engineer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Austin, TX
Posts: 137
Doug Norman will become famous soon enoughDoug Norman will become famous soon enough
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

To determine the correct X and Y axis motor values, one thing you could try would be to run in Teleop mode and probe the wires that go from the joystick to the Arcade Drive while driving the robot in the direction you want. This will help you understand how the X and Y values work.

For the Push1 motor (or any other output), it is expected you write an update value at least every 100ms. Otherwise the Safety Output turns off the motor. This is to avoid a run-away robot. An alternative would be to use the Motor Safety Config to disable/enable this safety mechanism - the same way you did in your drive motor code.
__________________
Doug Norman
National Instruments
Reply With Quote
  #10   Spotlight this post!  
Unread 16-07-2013, 19:32
joecloud joecloud is offline
Registered User
FRC #2805
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Texas
Posts: 22
joecloud is an unknown quantity at this point
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

Thanks! The drive motors are now working, I'm scratching my head about why it is working this time when it wasn't working yesterday (I did try that combination of values before). But now it is set up and moving forward properly.

I'm still having issues getting the Push motor to stay on, It spins up for about a second before winding down.
I did include the Safety config block, the problem might be that I'm not configuring it right though? Do I need to set values? I included a screen shot of what it is like at the moment. I do have the mode on the block set to disabled, but that's it.

Any tips are sincerely appreciated!
Thanks!
Attached Thumbnails
Click image for larger version

Name:	capture34.PNG
Views:	24
Size:	39.1 KB
ID:	15077  
__________________
--
Joe,
Programming: Team #2805
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 21:04.

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