Go to Post Mr.Lavery You Make My Day - Rohith Surampudi [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 24-01-2015, 20:04
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: Mecanum Encoders

I have seen both of those threads and we are using the CAN bus. I suppose our largest problem right now is that the robot drifts when it drives forward and backwards, and strafes. The turning also seems to be terrible in the Holonomic Drive for Labview.

We basically followed this guide (http://www.pobots.com/files/8213/5726/0394/mecanum.pdf) step by step except for the new labview updates. I would think that I need to set the speeds of the talons through PID but I'm not sure how.
__________________
The Eagle - By Alfred, Lord Tennyson

He clasps the crag with crooked hands;
Close to the sun in lonely lands,
Ring'd with the azure world, he stands.

The wrinkled sea beneath him crawls;
He watches from his mountain walls,
And like a thunderbolt he falls.
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2015, 20:12
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Mecanum Encoders

Quote:
Originally Posted by Nunez4296 View Post
I have seen both of those threads
are you referring to the TalonSRX PDF documents I linked?

Quote:
The turning also seems to be terrible in the Holonomic Drive for Labview.
Please describe in greater detail what you mean by "terrible".

What is your wheelbase and trackwidth?

What is your total speed reduction from motor to wheel?

How many motor(s) per gearbox?

What is the wheel diameter? (e.g. 4" 6" 8")


Quote:
I would think that I need to set the speeds of the talons through PID
You set the desired speed for each motor by issuing a CAN command to the Talon for each motor. There's probably a LabVIEW vi for this.

You must also tune the P, I, D, F parameters in the Talon's built-in PIDF controller. Have you done that? What values did you use?



Last edited by Ether : 24-01-2015 at 20:17.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2015, 22:30
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Mecanum Encoders

Using the built-in PID of a Talon SRX is easy for a random motor. There's a LabVIEW example project that shows you exactly how to do it. However, it gets kind of complicated when you want to use the Drive functions. Those functions are not really designed to give values outside the -1 to +1 range to the drive motors, but the Talons in PID mode want values that match the encoder resolution. It's also not obvious how to set the individual motors to PID mode when they've been opened as a 4 Motor Drive.

But it can be done. We had it working properly today (before the temporarily-mounted robot battery shifted and broke one of the encoder mounts).

Tuning a drivebase's PID parameters isn't trivial either. You can't do it with the robot on blocks and the wheels spinning freely. It's best done with the robot moving on the surface that it will actually be running on, though if you're clever you can get started by pressing a patch of carpet lightly against the wheels to give them some load.

If your problem is primarily with the robot not going straight, you might do better to use a gyro as the feedback for a PID controlling the rotation. Our robot's closed-loop mecanum motor speed control is not sufficient on its own to produce the desired motion, because the weight balance lets some wheels slip more than others.
Reply With Quote
  #4   Spotlight this post!  
Unread 24-01-2015, 23:17
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: Mecanum Encoders

Thanks for the replies. We have a gyro on the front of our mecanum chasis and coded in, however values only seem to range from 0.0-0.3. Is this normal? Also, we did believe that weight distribution among the wheels was a problem for rotation, but it seems that the wheels just are not spinning properly all-together. This might be due to a motor being inverted, I'll have to test this theory on Monday.

Also, could you explain how to either set the PID paramaters for each motor or use the gyro properly? I figured out how to set each individual PIDF for the 4 Talon SRXs in the loop so that shouldn't be a problem but only testing will tell.
__________________
The Eagle - By Alfred, Lord Tennyson

He clasps the crag with crooked hands;
Close to the sun in lonely lands,
Ring'd with the azure world, he stands.

The wrinkled sea beneath him crawls;
He watches from his mountain walls,
And like a thunderbolt he falls.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2015, 14:25
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Mecanum Encoders

What kind of gyro are you using, and how do you have it wired? Does it work properly when you use the LabVIEW gyro example?

For completeness, are your mecanum wheels mounted correctly? At the top of the wheel, the roller axles should point toward the center of the robot. It should look sort of like an X from above, and the rollers should sort of form an O or diamond shape on the floor. If you have them reversed, the robot will not be able to control its direction very well. It might not be able to turn in place at all, and it will very likely rotate some when you don't want it to while trying to drive straight.
Reply With Quote
  #6   Spotlight this post!  
Unread 25-01-2015, 16:15
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Mecanum Encoders

Quote:
Originally Posted by Nunez4296 View Post
it seems that the wheels just are not spinning properly all-together. This might be due to a motor being inverted, I'll have to test this theory on Monday.
It would be helpful if you would test it like this and post your results here.


Reply With Quote
  #7   Spotlight this post!  
Unread 25-01-2015, 17:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Mecanum Encoders

The Talon SRX always uses raw encoder counts as its PID unit. If you want to control them in closed-loop speed mode, you have to give them set points in "encoder counts per one hundred milliseconds".
Reply With Quote
  #8   Spotlight this post!  
Unread 25-01-2015, 18:55
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: Mecanum Encoders

When we meet again on Monday, I will check exactly how the wheels are mounted and post a picture. I will also check everything about the gyro. Lastly, I will post the results of that "test" of yours Ether
__________________
The Eagle - By Alfred, Lord Tennyson

He clasps the crag with crooked hands;
Close to the sun in lonely lands,
Ring'd with the azure world, he stands.

The wrinkled sea beneath him crawls;
He watches from his mountain walls,
And like a thunderbolt he falls.
Reply With Quote
  #9   Spotlight this post!  
Unread 26-01-2015, 08:04
jman4747's Avatar
jman4747 jman4747 is offline
Just building robots
AKA: Josh
FRC #4080 (Team Reboot)
Team Role: CAD
 
Join Date: Apr 2013
Rookie Year: 2011
Location: Atlanta GA
Posts: 418
jman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond repute
Re: Mecanum Encoders

Quote:
Originally Posted by Alan Anderson View Post
The Talon SRX always uses raw encoder counts as its PID unit. If you want to control them in closed-loop speed mode, you have to give them set points in "encoder counts per one hundred milliseconds".
Where was this documented?
__________________
---------------------
Alumni, CAD Designer, machinist, and Mentor: FRC Team #4080

Mentor: Rookie FTC Team "EVE" #10458, FRC Team "Drewbotics" #5812

#banthebag
#RIBMEATS
#1620
Reply With Quote
  #10   Spotlight this post!  
Unread 26-01-2015, 09:40
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Mecanum Encoders

Quote:
Originally Posted by jman4747 View Post
Where was this documented?
I found it in the TALON SRX Software Reference Manual, specifically the second paragraph of section 17.1. (Quadrature) Encoder Position.
Reply With Quote
  #11   Spotlight this post!  
Unread 27-01-2015, 11:18
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: Mecanum Encoders

Just as an update, I checked all wheel positions and they are mounted in the proper orientation where the rollers make an "X" towards the center. I also figured out what was wrong with the strafing/rotating. All I had to do was invert 2 motors, both of the left side mecanum wheels and the robot now can strafe, drive foward/backwards and rotate with ease. previously we could only Go forward and backward and rotate or go forward and backward and strafe. This brings up the old problem however...

Upon strafing at higher speeds, the robot spins out since the wheels don't turn at a constant speed. I have everything programmed in, the encoders, accelerometer, and gyro, I just need to know how to implement them into the code. Thanks!
__________________
The Eagle - By Alfred, Lord Tennyson

He clasps the crag with crooked hands;
Close to the sun in lonely lands,
Ring'd with the azure world, he stands.

The wrinkled sea beneath him crawls;
He watches from his mountain walls,
And like a thunderbolt he falls.
Reply With Quote
  #12   Spotlight this post!  
Unread 27-01-2015, 11:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Mecanum Encoders

Quote:
Originally Posted by Nunez4296 on Jan24 View Post
our largest problem right now is that the robot drifts when it drives forward and backwards, and strafes. The turning also seems to be terrible in the Holonomic Drive for Labview.
Quote:
Originally Posted by Nunez4296 on Jan27 View Post
I also figured out what was wrong with the strafing/rotating. All I had to do was invert 2 motors, both of the left side mecanum wheels and the robot now can strafe, drive foward/backwards and rotate with ease.
For rookie teams who might be reading this thread, you can quickly resolve problems like the above by running the test described here, and posting your results for analysis.


Reply With Quote
  #13   Spotlight this post!  
Unread 27-01-2015, 11:43
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Mecanum Encoders

Quote:
Originally Posted by Nunez4296 View Post
Upon strafing at higher speeds, the robot spins out since the wheels don't turn at a constant speed. I have everything programmed in, the encoders, accelerometer, and gyro, I just need to know how to implement them into the code. Thanks!
If the problem is mostly with the robot turning when you don't want it to, use the gyro to determine how far you're off heading and derive a "turn" correction to feed into the rotation input of the Mecanum Drive function.
Reply With Quote
  #14   Spotlight this post!  
Unread 27-01-2015, 11:45
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: Mecanum Encoders

Sorry Ether, I forgot to record this but I will do it tonight.

Alan, the problem is I don't understand how to incorporate the gyro back into the code after pulling the value out.
__________________
The Eagle - By Alfred, Lord Tennyson

He clasps the crag with crooked hands;
Close to the sun in lonely lands,
Ring'd with the azure world, he stands.

The wrinkled sea beneath him crawls;
He watches from his mountain walls,
And like a thunderbolt he falls.
Reply With Quote
  #15   Spotlight this post!  
Unread 27-01-2015, 12:39
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
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: Mecanum Encoders

Quote:
Originally Posted by Nunez4296 View Post
Sorry Ether, I forgot to record this but I will do it tonight.
If it's working fine you don't need to. It's part of a troubleshooting procedure which lets you quickly determine how to correct your code and/or wiring.


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 08:57.

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