Go to Post I could say that the decline in the population of pirates is responsible for global warming, the statistics correlate, but its obvious there's no causation there. - Racer26 [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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-11-2008, 00:03
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
[FTC]: Progress report on using encoders

I finally got back to FTC programing.

I'm now using the latest FTC update, which has a bugfix for the "FTC MOVE MOTORS.VI" which was apparently having trouble with reading the encoder.

So I took Team 288's template and switched the drive logic for a single stick drive, ensuring that I clip the motor drive signals to +/- 100.

Yay... the program works with no huge delays and no weird "dead times".
It seems like "move motors" is pretty robust at this time.

So, I then had to try what I really wanted to do, and that was to replace "Move Motors" with "FTC Constant Speed.vi"

Constant speed should use the encoders to provide a more consitent driving experience, with better low-speed control and less degredation as the battery voltage drops.

I replaced the VI's and made sure the controls were compatible.

When I initially started running the new program it was great. It could crawl along with good torque, and turning was very nice. Then, the old 2.5 second drive lock started happening, followed by long periods of no control at all. Then everything starts working just fine for a while.

Anticipating this problem I has tied one of the controller buttons to a tone output, so I could verify that even though the drive wasn't responding, the code was correctly seeing the button press., so Comms was good.

I switched back and forth between "move motors" and "constant speed" several times and each time I used Constant Speed, I would get the random drive failures.

It looks to me that there are still issued with the encoders. This is a new set of hardware, so I don't think it's a coincidence that it's hapenning again.

Anyone out there using encoders for speed control? Is it reliable?

Phil.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #2   Spotlight this post!  
Unread 12-11-2008, 08:47
jbbjjbt jbbjjbt is offline
VRC Coach
AKA: Jon T
VRC #0177 (Twisted Botz)
Team Role: Coach
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Gloucester, VA
Posts: 110
jbbjjbt is an unknown quantity at this point
Re: [FTC]: Progress report on using encoders

We've been messing with the encoders for autonomous and haven't much success so far using Labview. We had a lot of difficulty. We'd run the same program 4 times and get 4 totally different results. Sometimes both encoders reset, sometimes only one, sometimes none. I hadn't even thought about them for driving, except for the arm.

However, our when we attempted the same stategy using RobotC sample codes it worked. The Robotc codes had some logic waiting for the encoders to give the correct results. So it may be a coding issue in Labview.
__________________
Jon Thompson
Coach
VRC 177 Twisted Botz
Sponsored by FRC 122
NASA Knights
Reply With Quote
  #3   Spotlight this post!  
Unread 12-11-2008, 08:59
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: Progress report on using encoders

Quote:
Originally Posted by jbbjjbt View Post
We've been messing with the encoders for autonomous and haven't much success so far using Labview. We had a lot of difficulty. We'd run the same program 4 times and get 4 totally different results. Sometimes both encoders reset, sometimes only one, sometimes none.
Hmmm. I had reported that to NI a while back. I found that the "failure to reset" seemed to be related to the speed that you commanded the motors to move afterwards.

If you sent an encoder reset command, and then gave the motor a high power move, it was more likely to ignore the reset state and revert back to the last encoder count. However, if you only gave a low power move, it seemed to keep the reset most times.

It's as if there is some race condition that if the encoder counts before the reset is complete it gets messed up.

I've really been hoping that I could use LabVIEW for both FTC and FRC, but if it's not reliable I'm going to be forced to change.

Any issues to report with RobotC?
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #4   Spotlight this post!  
Unread 12-11-2008, 11:29
jbbjjbt jbbjjbt is offline
VRC Coach
AKA: Jon T
VRC #0177 (Twisted Botz)
Team Role: Coach
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Gloucester, VA
Posts: 110
jbbjjbt is an unknown quantity at this point
Re: [FTC]: Progress report on using encoders

Quote:
Originally Posted by PhilBot View Post
Hmmm. I had reported that to NI a while back. I found that the "failure to reset" seemed to be related to the speed that you commanded the motors to move afterwards.

If you sent an encoder reset command, and then gave the motor a high power move, it was more likely to ignore the reset state and revert back to the last encoder count. However, if you only gave a low power move, it seemed to keep the reset most times.

It's as if there is some race condition that if the encoder counts before the reset is complete it gets messed up.

I've really been hoping that I could use LabVIEW for both FTC and FRC, but if it's not reliable I'm going to be forced to change.

Any issues to report with RobotC?
That sounds very much like what we were trying to do: come down the ramp slow, reset encoders, then go full power.

We've spend very little time and effort on RobotC so far. It blows my mind when it compliles and downloads in about 1/2 second.
__________________
Jon Thompson
Coach
VRC 177 Twisted Botz
Sponsored by FRC 122
NASA Knights
Reply With Quote
  #5   Spotlight this post!  
Unread 12-11-2008, 12:20
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: Progress report on using encoders

I just setup a LabVIEW ap to illustrate the problem.

This code runs a loop where the encoders are reset, the motors run for a second, and then stopped for a second. This repeats while the encoder position is charted.

The first attached images are bad case where the motors are turned on immediately after resetting the encoders. The data shows how often the encoders don't get reset.

The second image set is better, I assume, because there is some delay between the reset and move. Only forgets to reset a couple of times

Adding a delay probably helps this code, but I want to know for sure that the encoders will reset properly.
Attached Thumbnails
Click image for larger version

Name:	BadEncoderData.jpg
Views:	53
Size:	84.3 KB
ID:	6951  Click image for larger version

Name:	BadEncoderProgram.jpg
Views:	65
Size:	98.6 KB
ID:	6952  Click image for larger version

Name:	GoodEncoderData.jpg
Views:	44
Size:	83.4 KB
ID:	6953  Click image for larger version

Name:	GoodEncoderCode.jpg
Views:	53
Size:	96.6 KB
ID:	6954  
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #6   Spotlight this post!  
Unread 12-11-2008, 15:23
jbbjjbt jbbjjbt is offline
VRC Coach
AKA: Jon T
VRC #0177 (Twisted Botz)
Team Role: Coach
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Gloucester, VA
Posts: 110
jbbjjbt is an unknown quantity at this point
Re: [FTC]: Progress report on using encoders

Phil,
Please explain how this program works. You are running the motors and encoders on the NXT but plotting on the pc screen. Is that correct?

Are you running this code on the pc or on the NXT? How is the NXT connected to the pc?

I had no idea you could do this, please tell me how.

Thanks,
__________________
Jon Thompson
Coach
VRC 177 Twisted Botz
Sponsored by FRC 122
NASA Knights
Reply With Quote
  #7   Spotlight this post!  
Unread 12-11-2008, 18:35
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: Progress report on using encoders

Hi

What you are seeing is a standard debugging feature provided by LabVIEW in conjuction with the NXT.

If you are using LabVIEW you must be using the NXT Terminal to download and run the program. You are probably pressing the left hand icon on the terminal to run the program.

Instead, if you press the third icon over (Arrow pointing to lightbulb) it will compile and download the program and then maintain a connection with the running program for debugging purposes. Any LabVIEW display elements that you have included in your NXT program will now operate and be visible on the PC's normally-empty front panel. (This is one of the main reasons I planned to use LabVIEW.... it's a powerfull debugging tool).

There are (of course) the usual caveats: It slows down your program a bit, and it only updates at the bandwidth available by your link to the NXT.

For bench testing this program, I don't need the Bluetooth link, so I connect to the NXT with USB. It provides a pretty good debug window.

For robot testing (on the bench), you can download and debug via USB, while the Bluetooth is used by the Controller program.

I haven't found a way to debug while driving on the field yet

Try this yourself by LEFT-clicking on any wire and selecting "Create - Indicator".
The indicator will be added to both the block diagram and the Front panel.
Change it to any graphical type you like.
When you start debugging, there is a several second delay before the Front panel starts updating... so be patient.

Note: I've attached the LV program that shows the bad encoder resets.
Download (debug) it using the method I expalined and just let it tun.


Phil
Attached Files
File Type: vi EncoderTestLoop.vi (36.1 KB, 75 views)
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor

Last edited by PhilBot : 12-11-2008 at 20:24.
Reply With Quote
  #8   Spotlight this post!  
Unread 13-11-2008, 08:42
jbbjjbt jbbjjbt is offline
VRC Coach
AKA: Jon T
VRC #0177 (Twisted Botz)
Team Role: Coach
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Gloucester, VA
Posts: 110
jbbjjbt is an unknown quantity at this point
Re: [FTC]: Progress report on using encoders

Phil,
Thanks for explaining, hopefully I will try this feature tonight. It could be very helpful.
__________________
Jon Thompson
Coach
VRC 177 Twisted Botz
Sponsored by FRC 122
NASA Knights
Reply With Quote
  #9   Spotlight this post!  
Unread 13-11-2008, 18:46
RNasir RNasir is offline
Registered User
no team
 
Join Date: Oct 2008
Location: Austin, TX
Posts: 11
RNasir is an unknown quantity at this point
Re: [FTC]: Progress report on using encoders

I'm in work on a fix for both the resetting issue and the Constant Speed driving issue now. I'll let you folks know as soon as I have something ready.
Reply With Quote
  #10   Spotlight this post!  
Unread 13-11-2008, 23:43
jbbjjbt jbbjjbt is offline
VRC Coach
AKA: Jon T
VRC #0177 (Twisted Botz)
Team Role: Coach
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Gloucester, VA
Posts: 110
jbbjjbt is an unknown quantity at this point
Re: [FTC]: Progress report on using encoders

Quote:
Originally Posted by RNasir View Post
I'm in work on a fix for both the resetting issue and the Constant Speed driving issue now. I'll let you folks know as soon as I have something ready.
Thanks, we are looking forward to it.
__________________
Jon Thompson
Coach
VRC 177 Twisted Botz
Sponsored by FRC 122
NASA Knights
Reply With Quote
  #11   Spotlight this post!  
Unread 13-11-2008, 23:50
jbbjjbt jbbjjbt is offline
VRC Coach
AKA: Jon T
VRC #0177 (Twisted Botz)
Team Role: Coach
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Gloucester, VA
Posts: 110
jbbjjbt is an unknown quantity at this point
Re: [FTC]: Progress report on using encoders

Phil,
We tried your encoder test program and got similar results. We added a loop to reset the encoders again if the encoder value was greater than 5. This worked for resetting the encoders. But the constant speed vi messed up occasionally and the motors ran on for 2.5 seconds. We then replaced the constant speed vi with move motors vi and got identical results.
__________________
Jon Thompson
Coach
VRC 177 Twisted Botz
Sponsored by FRC 122
NASA Knights
Reply With Quote
  #12   Spotlight this post!  
Unread 14-11-2008, 14:01
RNasir RNasir is offline
Registered User
no team
 
Join Date: Oct 2008
Location: Austin, TX
Posts: 11
RNasir is an unknown quantity at this point
Re: [FTC]: Progress report on using encoders

I have a tentative fix available now. I want to do some more testing in-house before officially releasing it, but I can send it to any teams that would like to try it out before that happens (sometime next week). If you're interested, send me an email at ramsey.nasir@ni.com and I'll send you the fixed files. Please be sure to specify in your email whether you use LabVIEW or NXT-G (or both).
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get robot to drive straigth using shaft encoders eccmaster Programming 5 02-02-2008 23:50
Autonomous using encoders Mr.G Programming 11 17-01-2006 03:34
Drive Straight C Code using Encoders without PID? Chris_Elston Programming 17 15-02-2005 23:41
Using Digi-Key Shaft Encoders D.Viddy Programming 45 02-01-2005 20:11
Using Shaft Encoders D.Viddy Programming 7 14-12-2004 18:27


All times are GMT -5. The time now is 12: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