Go to Post Be afraid. Be very, very, graciously afraid. - Rich Kressly [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 09-02-2011, 22:18
stormyweathers stormyweathers is offline
Registered User
FRC #3653
 
Join Date: Feb 2011
Location: US
Posts: 10
stormyweathers is an unknown quantity at this point
Line Following Help

I have carefully looked at the framework auto ind code, but I am still a bit fuzzy.
the driverstation inputs that are fed into the "Left Right Straight" case stucture; how do I pick which one is set?

also just using the default framework, the robot ALWAYS runs in reverse
any ideas on how to fix this?

my team is using mecanum wheels (which run perfectly in teleop), how do I adjust the code to use this drive system?

for reference, our IR sensors are rigged to connect the white cable to DIO, but I have tried the auto code negating the IR input already to no avail.

I have tried doing a complicated alternate drive system as follows:
in "open.vi" I open 3 drive motor control VI's "MainDrive"(4motor) "AutoFront"(2 motor) and "AutoRear" (2 motor)
the four motors are wired appropriately.
In teleop, I run the MainDrive to mecanum cartesian
In Auto, I pass the X axis control to the X input on AutoFront and AutoBack, and pass the Y axis control to the Y input on AutoFront and AutoBack

I expected this to work somewhat, but by doing this, not only did it not work, it prevented my teleop code from working AND shortened the run time in auto to less than 4 seconds.

can anyone help me?
I am coding this alone and have never used labview before
I
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2011, 22:59
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: Line Following Help

For it driving in reverse:
Do you have the motor invert booleans setup right for your wiring in begin.vi?
If this was the case, you should see similar issues in teleop, but it sounds like you are creating seperate dev. Ref.s for auto and teleop. you shouldn't be doing that - I'm not sure if opening two drives pointing to the same pwm channels will break something, but you certainly shouldn't need to do it this way. If you want to do it that way, I would at least try to close the drive when auto finishes, and then open the drive w/ holonomic after.

I would suggest watching this video @ frc master, it should help resolve any lingering questions you have about how the default code is supposed to work

http://www.frcmastery.com/labview-fo...tonomous-code/
Reply With Quote
  #3   Spotlight this post!  
Unread 10-02-2011, 01:28
Acarid Acarid is offline
<3 Nested Clusters
FRC #2521
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Eugene, Oregon
Posts: 10
Acarid is an unknown quantity at this point
Re: Line Following Help

Quote:
Originally Posted by stormyweathers View Post
I have carefully looked at the framework auto ind code, but I am still a bit fuzzy.
the driverstation inputs that are fed into the "Left Right Straight" case stucture; how do I pick which one is set?

also just using the default framework, the robot ALWAYS runs in reverse
any ideas on how to fix this?

my team is using mecanum wheels (which run perfectly in teleop), how do I adjust the code to use this drive system?

for reference, our IR sensors are rigged to connect the white cable to DIO, but I have tried the auto code negating the IR input already to no avail.

I have tried doing a complicated alternate drive system as follows:
in "open.vi" I open 3 drive motor control VI's "MainDrive"(4motor) "AutoFront"(2 motor) and "AutoRear" (2 motor)
the four motors are wired appropriately.
In teleop, I run the MainDrive to mecanum cartesian
In Auto, I pass the X axis control to the X input on AutoFront and AutoBack, and pass the Y axis control to the Y input on AutoFront and AutoBack

I expected this to work somewhat, but by doing this, not only did it not work, it prevented my teleop code from working AND shortened the run time in auto to less than 4 seconds.

can anyone help me?
I am coding this alone and have never used labview before
I
The case structure selects them by converting the true/false inputs from the IR sensors into 1s and 0s of a binary number, and from there into a decimal number. That is why the cases read "7" "1" "0" etc...
You really don't need to understand that though.

The default framework doesn't open the IR sensors in begin.vi, I suspect that is causing your problems. Open 3 DIOs, named IR1, IR2, IR3, wire the sensors to the digital sidecar to match the pwm selected on the open.

You do not need to alter the code for mecanum drive, just make sure the same 4wheel drive reference is wired into the arcade drive vi.
I don't think there is any reason on any normal robot to open more than one drive.

Alone on the first year? That's rough but a lot of fun. Let me know if I should explain this in more detail or if you need help with anything else.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-02-2011, 09:20
MaxMax161's Avatar
MaxMax161 MaxMax161 is offline
Allegedly Useful
AKA: Max Llewellyn
FRC #2791 (Shaker Robotics), FRC #1676 (Pascack π-oneers)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Montvale NJ\Troy NY
Posts: 174
MaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond repute
Re: Line Following Help

If you're a new programmer, or at least new to LabVIEW, I would recommend totally ignoring the default autonomous code. Our programing team looked at it and then decided, this doesn't make any sense, lets write our own.

We mounted our sensors in a triangle that we placed in the front of the robot, so that one was about 2.5'' more forward then the rest. The code was actually very simple. We had a loop feeding 0.5 for both joystick values into our drive.vi until "left sensor" OR "right sensor" OR "middle sensor" was tripped.

Then it moved in to another loop that feed 0.8 for both joystick values in to our drive.vi; however when the left sensor was tripped the left value dropped to 0.5, and visa versa. We did this by arraying the boolens we got from the sensors, turning then in to a number, and then feeding the number in to a case statement that contained the constants we feed in to the drive.vi as the joystick values. This loop would stop when any combination of sensors that wasn't just the left or just the right was tripped.

This followed the line GREAT and stopped when it got to the end. It's simple (don't worry it's much easier to see then to say), easy to debug, and above all works really well.
__________________
2791 Shaker Robotics (2013-present)
--Control Systems Mentor 2013-present
--Drive coach 2015-present

1676 The Pascack π-oneers (2010-2013)
--Drive coach 2011-2013
--Lead Programmer 2011-2013
Reply With Quote
  #5   Spotlight this post!  
Unread 10-02-2011, 13:19
stormyweathers stormyweathers is offline
Registered User
FRC #3653
 
Join Date: Feb 2011
Location: US
Posts: 10
stormyweathers is an unknown quantity at this point
Re: Line Following Help

I did open and close the IR sensors, so that is not the issue.
And I was asking about the case structure that had the conditions "Left" "Right" "Straight" not the "0" "1" "7" struc

any ideas about the backwards movement?
I think I may just have to redo this whole thing
Reply With Quote
  #6   Spotlight this post!  
Unread 10-02-2011, 14:45
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,296
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Line Following Help

We threw out the default code as overly-complex and a bit wonky, too.
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
Reply With Quote
  #7   Spotlight this post!  
Unread 11-02-2011, 08:26
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: Line Following Help

Probe the joystick values when your robot is driving forward in tele. Compare that to the values when auto should drive forward.

If the joystick needs to be a positive number to drive forward, change the Steering Power or Y Power to have positive numbers.

If tele uses negative numbers to go forward, then anywhere else in the code using the same ref should use negative numbers. That implies that the Drive ref has been reopened and opened differently than the one used in tele.

As for the default code, why would you ignore it? Especially if it works or almost works and needs to be tweaked? Writing your own code is great, especially once you understand the problem well enough to see ways of improving the working solution. What you describe of your code actually sounds very similar to the default code modified to only follow the straight line. Can you describe the differences? In general, it would also be useful to know what about the default code was confusing.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 14-02-2011, 03:27
robotjac robotjac is offline
Registered User
no team
 
Join Date: Jan 2011
Location: San Diego, CA
Posts: 5
robotjac is an unknown quantity at this point
Re: Line Following Help

I have tried programming use these steps and when autonomous starts, nothing happens. Would you mind sending me your code or a screen shot?

Last edited by robotjac : 14-02-2011 at 03:28. Reason: Replied to wrong person
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:36.

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