Go to Post I searched the web for a good forum and it looks like this is the place to be. - Pipisongo [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 24-02-2013, 12:51
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 524
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Gyro - Running robot code from laptop issue.

We have been trying to debug some gyro drive straight code, and have an issue that has been posted before, here about the bad data being coming from the gyro.

We have isolated the issue, think we understand the issue, but do not know how to fix the issue, if there is a fix.

Scenario, you are using labview, you load your code from the laptop, and are running the code from the laptop, so that you can debug.

You enable the bot, gyro is giving good data, you probe, data, see an issue in the code, disable the bot, stop the code from the labview laptop, using the stop sign icon, and fix the code.

At this point you click run again in robot main, and the gyro now is not giving correct data, growing, spinning, etc.

You stop the code, load up the gyro example, everything works, load up the robot code, everything works with the gyro, stop the code, gyro never works the second time.

Now that we have seen this scenario, we can reboot the crio each time and the gyro responds as expected.

We know that when you hit the stop button on the labview laptop, you are aborting code, and the cRio stops without going through the normal shutdown sequences, with the close.vi and closing all the refnum's. We think that this is the main issue with the gyro code.

Question, are we doing something wrong with aborting the code this way, with the stop icon, and we should be stopping the code where it can finish and exit through the close.vi ? Is that even possible?

Have other teams seen this scenario? Can it be coded in a way where this can be avoided, or do we just need to power down between debug sessions, which is more time consuming.

Scott
TORC2137 Programming Mentor.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #2   Spotlight this post!  
Unread 24-02-2013, 14:08
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,835
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: Gyro - Running robot code from laptop issue.

I don't seem to have any problem.
I just ran a test and the gyro is responding properly after a run-re-run.
Anything else that might be a contributing factor?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #3   Spotlight this post!  
Unread 24-02-2013, 16:40
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 524
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Gyro - Running robot code from laptop issue.

Quote:
Originally Posted by Mark McLeod View Post
Anything else that might be a contributing factor?
I am sure there is....

We can run the example code just fine, stop, restart.

We put our drive straight.vi in teleop in a robot project and tested, and that is where we have the issue. We spent the day testing all of the gyros, and analog cards yesterday, and everything was in working order.

Thanks for looking into it, love the website, it is my goto for anything electrical.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #4   Spotlight this post!  
Unread 24-02-2013, 17:28
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,835
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: Gyro - Running robot code from laptop issue.

The likeliest possibility I can think of is that the robot isn't left to sit still long enough the second time through to allow the gyro to initialize and establish a zero movement point.

I should have addressed the matter of Finish.vi, since you asked and you say such nice things.
Normal robot operation/termination never goes through Finish.vi.
The power just gets cutoff and the code ceases mid-execution.
The Stop sign on Robot Main functions the same way.
That big "Finish" button in Robot Main is the only way that Finish.vi ever gets executed.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #5   Spotlight this post!  
Unread 24-02-2013, 20:24
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 524
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Gyro - Running robot code from laptop issue.

Well, I guess I'll say some more nice things... your cute too.

But the robot was not moving, we had it on "stilts", that is what the kids call it, when we have it on 2x4's so the wheels don't touch the ground.

We will keep digging tomorrow. Thanks for the info on the big finish button, I was told this leaving the code hanging with the stop button, is sometimes a problem, by someone that uses Labview everyday.

I understand much of the control code, and understand labview, but stuggle with many things in Labview itself, I am a PLC guy by trade..

Thanks again.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #6   Spotlight this post!  
Unread 24-02-2013, 22:24
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,835
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: Gyro - Running robot code from laptop issue.

The Stop button can be a problem in the commercial world for the same reason we bother with teaching the students to close opened devices in Finish.vi.

When the students move on from FRC and run into LabVIEW later in college or in the working world, some classes of peripheral devices must be shutdown cleanly or they won't initialize properly when LabVIEW is later reconnected to them. FRC just doesn't happen to use any data acquisition devices that are susceptible to that.

Finish.vi is there to teach them good habits even if it doesn't fit our particular use case.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #7   Spotlight this post!  
Unread 25-02-2013, 10:19
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 524
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Gyro - Running robot code from laptop issue.

Mark,

Do you think it could be that the code is given the "reentrant" property? I am not sure if I spelled that correctly, but the property where labview will spawn a new "object" each time the vi is called, so you can have multiple sub.vi's in the code, and they will not interact with each other?

Just trying to think about what the issue may be.

Scott.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #8   Spotlight this post!  
Unread 25-02-2013, 11:17
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,835
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: Gyro - Running robot code from laptop issue.

Being called from a reentrant vi shouldn't affect the Gyro Get.
It's still just operating on the device reference given to it and simply reading the counter published by the FPGA.

If you have a simple case that repeats the problem someone could take a look at it for you. I have a small window to look today, but I'll be volunteering or attending events with my team after today.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 25-02-2013 at 19:31.
Reply With Quote
  #9   Spotlight this post!  
Unread 25-02-2013, 19:24
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 524
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Gyro - Running robot code from laptop issue.

My son just told me that I have stated this wrong, it is not when the code is stopped from the programming laptop. The issue is when the drivers station is enabled, the data is good, and after the drivers station is disabled, and then re-enabled without stopping the code on the programming terminal, the second time the gyro data is not reliable.

Does this change anything? Thanks again.

Sorry.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #10   Spotlight this post!  
Unread 25-02-2013, 19:41
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: Gyro - Running robot code from laptop issue.

Does it depend on how long the code/robot is disabled? The errors will accumulate over time, and restarting the code will calibrate again. If the error is caused by running the code for five or ten minutes while the robot is disabled, then yes, I think that explains it to me. If it happens for a disable of a few seconds, then it doesn't.

Greg McKaskle
Reply With Quote
  #11   Spotlight this post!  
Unread 26-02-2013, 07:32
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,835
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: Gyro - Running robot code from laptop issue.

If it's happening while Disabled, then you can read/display the gyro in the Disabled.vi to watch it while it goes awry. I imagine the center point calibration is off kilter. There are some calibration options on the Gyro Open that you can tinker with.
Disable only stops motor/Relay outputs, everything else keeps running, including the gyro.
Maybe it'll be enlightening.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 26-02-2013 at 08:32.
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 23:00.

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