OCCRA
Go to Post Dave doesn't predict the future. He creates it. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media  
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 03-13-2018, 01:40 PM
Maxcr1's Avatar
Maxcr1 Maxcr1 is offline
Registered User
AKA: Max D "Code Boy"
FRC #2169 (KING TeC)
Team Role: Programmer
 
Join Date: Nov 2016
Rookie Year: 2016
Location: Savage, MN
Posts: 127
Maxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant future
Massive Pathfinder issues

This year, our team is using Pathfinder for autonomous driving. However, we are facing some serious issues.
We are using meters everywhere, the wheelbase, the wheel diameter, etc, and have set up our system with the base-level tuning numbers suggested by Jaci in this post, but are seeing some strange behavior. When we run a path that is supposed to drive straight forward for a meter, our robot accelerates, not stopping until we disable to avoid hitting the wall. We kept working with this, but only get remotely close with numbers that seem ridiculously far off from what is correct:

kP: .0005
kD: .005
kA: .0755
max_velocity: 8
max_acc: 3
jerk: 16

However, when we change the path to run 2 meters, it overshoots it by about a meter. We are considering offloading the profiles to the Talons, but have heard this is inaccurate. Does anybody have any suggestions? Has anybody seen anything similar.

I have made the code public in hopes of fixing the issue, so here is a link to the Drivetrain code. Any help is appreciated. Thank you.
__________________
Max DeVos | Programmer | KING TeC 2169

Reply With Quote
  #2   Spotlight this post!  
Unread 03-13-2018, 01:51 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 9,126
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Massive Pathfinder issues

Quote:
Originally Posted by Maxcr1 View Post
kP: .0005
kD: .005
kA: .0755
max_velocity: 8
max_acc: 3
jerk: 16
Can you ZIP the generated path and post it as an attachment please?


Reply With Quote
  #3   Spotlight this post!  
Unread 03-13-2018, 07:38 PM
gregzetko's Avatar
gregzetko gregzetko is offline
Programming mentor
FRC #2609 (BeaverworX)
Team Role: Programmer
 
Join Date: Mar 2016
Rookie Year: 2016
Location: Canada, Ontario
Posts: 41
gregzetko is a glorious beacon of lightgregzetko is a glorious beacon of lightgregzetko is a glorious beacon of lightgregzetko is a glorious beacon of lightgregzetko is a glorious beacon of lightgregzetko is a glorious beacon of light
Re: Massive Pathfinder issues

Quote:
Originally Posted by Ether View Post
Can you ZIP the generated path and post it as an attachment please?


^ this. Or can you point me to the waypoints that you are talking about? Is it
Code:
Waypoint[] example = new Waypoint[] {
    			new Waypoint(0, 0, 0), 
    			new Waypoint(1, 1, 0),
    			new Waypoint(2, 0, 0)
    	};
?
__________________


2609 Programming Mentor
2017 Curie - 3rd pick, Quarterfinalist

2017-2018 McMaster District event - CSA

2018 Ryerson District event - Field Reset
Reply With Quote
  #4   Spotlight this post!  
Unread 03-13-2018, 09:02 PM
rahilm rahilm is offline
Registered User
AKA: Rahil Mehta
FRC #0668 (The Apes of Wrath)
Team Role: Mentor
 
Join Date: Oct 2009
Rookie Year: 2007
Location: San Jose, CA
Posts: 146
rahilm is just really nicerahilm is just really nicerahilm is just really nicerahilm is just really nice
Re: Massive Pathfinder issues

You forgot to link your code in the original post, but I found it with some Google-ing. I noticed this snippet:

Code:
left.configureEncoder(leftMaster.getSelectedSensorPosition(0), Constants.ticksPerRotation,
				PathfinderData.wheel_diameter);
right.configureEncoder(rightMaster.getSelectedSensorPosition(0), Constants.ticksPerRotation,
				Constants.wheelDiameter);
It looks like the left follower has a correct wheel diameter in meters, but the right does not (6m diameter). This could result in some erratic behavior between the left and right side trying to do different things.
__________________
Team 668 - Apes of Wrath - 2008-2011
Team 668 - Apes of Wrath - 2011-Present (Mentor)
Reply With Quote
  #5   Spotlight this post!  
Unread 03-13-2018, 10:01 PM
TheOtherGuy's Avatar
TheOtherGuy TheOtherGuy is offline
Unregistered User
AKA: Kevin Forbes
FRC #4183 (Bit Buckets)
Team Role: Engineer
 
Join Date: Jul 2006
Rookie Year: 2006
Location: Tucson, AZ
Posts: 417
TheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond repute
Re: Massive Pathfinder issues

Quote:
Originally Posted by Maxcr1 View Post
This year, our team is using Pathfinder for autonomous driving. However, we are facing some serious issues.
We are using meters everywhere, the wheelbase, the wheel diameter, etc, and have set up our system with the base-level tuning numbers suggested by Jaci in this post, but are seeing some strange behavior. When we run a path that is supposed to drive straight forward for a meter, our robot accelerates, not stopping until we disable to avoid hitting the wall. We kept working with this, but only get remotely close with numbers that seem ridiculously far off from what is correct:

kP: .0005
kD: .005
kA: .0755
max_velocity: 8
max_acc: 3
jerk: 16

However, when we change the path to run 2 meters, it overshoots it by about a meter. We are considering offloading the profiles to the Talons, but have heard this is inaccurate. Does anybody have any suggestions? Has anybody seen anything similar.

I have made the code public in hopes of fixing the issue, so here is a link to the Drivetrain code. Any help is appreciated. Thank you.
We made an embarrassing mistake this past weekend. When we cleaned up the wiring after unbagging, we accidentally swapped the encoders for the left and right talons, which resulted in large positive errors on both sides of the drivetrain. This caused it to drive forward full-speed for every trajectory.
__________________
Reply With Quote
  #6   Spotlight this post!  
Unread 03-14-2018, 09:07 AM
Jaci's Avatar
Jaci Jaci is offline
http://imjac.in/ta/name
AKA: Jaci R Brunning
FRC #5333 (Can't C#) #5663 (Ground Control) | (OpenRIO, FRC West Aus)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Perth, Western Australia
Posts: 633
Jaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond repute
Re: Massive Pathfinder issues

I would recommend using 449's drivetrain characteristics paper to determine the proper values for kV and kA instead of going off theoretical values, then adjusting kP followed by kD.

Make sure your control loop is running at a fast, consistent rate (use the WPILib Notifier), since Pathfinder assumes it is being called at this rate.

Also make sure your robot is mechanically and electrically sound (encoders work as they are supposed to, the gyro is recording the correct +/- value, etc). Part of this is also making sure your values in your code reflect those in real life (wheel diameter as rahilm mentioned above, ticks per revolution, etc)
__________________

Curtin FRC (5333+5663) : Head Mentor
WPILib : Developer

Website | Github
jaci.brunning@gmail.com
Reply With Quote
  #7   Spotlight this post!  
Unread 03-14-2018, 12:12 PM
CodeNinja CodeNinja is offline
Registered User
FRC #3997 (Screaming Chickens)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2017
Location: San Antonio
Posts: 66
CodeNinja is an unknown quantity at this point
Re: Massive Pathfinder issues

By WPIlib Notifier, do you mean use timed robot?
Reply With Quote
  #8   Spotlight this post!  
Unread 03-14-2018, 01:30 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 9,126
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Massive Pathfinder issues

Quote:
Originally Posted by Maxcr1 View Post
.
@Max: status update?


Reply With Quote
  #9   Spotlight this post!  
Unread 03-14-2018, 08:42 PM
Jaci's Avatar
Jaci Jaci is offline
http://imjac.in/ta/name
AKA: Jaci R Brunning
FRC #5333 (Can't C#) #5663 (Ground Control) | (OpenRIO, FRC West Aus)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Perth, Western Australia
Posts: 633
Jaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond repute
Re: Massive Pathfinder issues

Quote:
Originally Posted by CodeNinja View Post
By WPIlib Notifier, do you mean use timed robot?
I mean WPILib Notifier, you shouldn't run your control loop inside of your main robot class, whether it's timed or not.

https://github.com/wpilibsuite/allwp.../Notifier.java
__________________

Curtin FRC (5333+5663) : Head Mentor
WPILib : Developer

Website | Github
jaci.brunning@gmail.com
Reply With Quote
  #10   Spotlight this post!  
Unread 03-18-2018, 10:26 AM
Maxcr1's Avatar
Maxcr1 Maxcr1 is offline
Registered User
AKA: Max D "Code Boy"
FRC #2169 (KING TeC)
Team Role: Programmer
 
Join Date: Nov 2016
Rookie Year: 2016
Location: Savage, MN
Posts: 127
Maxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant futureMaxcr1 has a brilliant future
Re: Massive Pathfinder issues

I'm sorry for going silent, as I found myself with no time as our competition occurred over the last few days. I am going to try these things out as soon as I get the chance.

Thank you for your help, and I'm sorry for going silent.
__________________
Max DeVos | Programmer | KING TeC 2169

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 07:20 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi