Go to Post steve, don't hurt me - Alex Cormier [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 13-03-2015, 01:10
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Programming Swerve Drive

Hello Everyone,

We are attempting a swerve drive and could really use some help programming it. We have MA3 Miniature Absolute Magnetic Shaft Encoders on each wheel that measures the angle it has been turned. We need help writing it into the program. We've seen a couple of examples using PID logic, and would love to go that rout, but still are not fully understanding exactly what a PID does or how to implement it into our program. If we have four wheels and four encoders, how do we program PID logic for all four? Is it separate for each wheel? Then how does tele-op work?

Any help or tips would by much appreciated!
Thank you!
Reply With Quote
  #2   Spotlight this post!  
Unread 13-03-2015, 07:41
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Programming Swerve Drive

what motor controller are you using?

i just programmed my team's swerve this season

i'll be glad to help you after work
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #3   Spotlight this post!  
Unread 13-03-2015, 08:47
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Programming Swerve Drive

I never worked with labview but i guess you only need the logic here
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #4   Spotlight this post!  
Unread 13-03-2015, 09:14
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Programming Swerve Drive

Quote:
Originally Posted by TBots View Post
We've seen a couple of examples using PID logic, and would love to go that rout, but still are not fully understanding exactly what a PID does
Watch this video.

Download, install, and experiment with this program.


Reply With Quote
  #5   Spotlight this post!  
Unread 14-03-2015, 00:31
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Programming Swerve Drive

Ether, thank you for the links! I've watched the video and downloaded the program. If I follow the steps for finding KVP that were shown in the video, what would the value of KVP in the example shown for a 6-1 PID controller in ModelQ? What should a "sustained and stable oscillation" look like? I'm having trouble defining what is a stable oscillation in ModelQ.

MaGiC_PiKaChU, we are using Talon motor controllers. If you could help us figure out this swerve drive, that would be fantastic! Our biggest problem in trying to figure out how to implement the PID vi supplied by labVIEW. We don't know what to put in the ports. For example, what do we put in for process variable?
Reply With Quote
  #6   Spotlight this post!  
Unread 14-03-2015, 12:23
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Programming Swerve Drive

if you are using absolute shaft magnetic encoders you have to get it trough an analog channel(how it's called in java)

I dont think you can use one PID subsystem for all your wheels, we used Talon SRX controllers so we could use their PID closed loop and put our swerve drive in a regular subsystem. Correct me if i'm wrong, but you have to use 4 subsystems only for wheels rotation

I recommend you control each wheel's angle individually so they will get to their setpoint no matter what. (each wheel has it's own PID, so you don't send all motors the same command that would mess with synchronization with time.)

if you have any questions on that, feel free to send me an email
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #7   Spotlight this post!  
Unread 14-03-2015, 12:28
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Programming Swerve Drive

Quote:
Originally Posted by TBots View Post
We have MA3 Miniature Absolute Magnetic Shaft Encoders on each wheel that measures the angle it has been turned...how do we program PID logic for all four? Is it separate for each wheel?
I assume since you are talking about a swerve drive and you have an encoder on each wheel that you want to steer each wheel independently.

If that is the case, then you will need separate angle controller code for each wheel (PID or whatever).


Reply With Quote
  #8   Spotlight this post!  
Unread 23-03-2015, 16:25
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Programming Swerve Drive

We've managed to get the robot moving without the use of encoders, but as suspected, the wheels do not turn at the same rate when turning due to the different ages of the motor controllers and the wheels initial starting positions. Now we just need to figure out how to implement the encoders to make the wheels turn simultaneously. We are not particularly worried about making the robot make an angled turn or pivot on a wheel at this moment, so I believe it would be alright to use only one PID since two wheels would be set to the setpoint and the other two would be the same but opposite.

I still need help setting up PID in labVIEW. I believe the MA3 uses analog signal, but I don't know how to set that up in labVIEW.

Thanks for the help!
Reply With Quote
  #9   Spotlight this post!  
Unread 24-03-2015, 22:17
FrankenmuthK's Avatar
FrankenmuthK FrankenmuthK is offline
Registered User
FRC #5215
 
Join Date: Jan 2015
Location: United States
Posts: 34
FrankenmuthK is an unknown quantity at this point
Re: Programming Swerve Drive

Quote:
Originally Posted by MaGiC_PiKaChU View Post
what motor controller are you using?

i just programmed my team's swerve this season

i'll be glad to help you after work
Do you have a picture of the code so I could see it?
Reply With Quote
  #10   Spotlight this post!  
Unread 10-04-2015, 16:11
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Programming Swerve Drive

We still need help programming the encoders. As a clarification, they are 10-bit analog encoders. Any guidance building this code in labVIEW would be great!
Reply With Quote
  #11   Spotlight this post!  
Unread 10-04-2015, 18:14
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Programming Swerve Drive

Quote:
Originally Posted by TBots View Post
We still need help programming the encoders. As a clarification, they are 10-bit analog encoders. Any guidance building this code in labVIEW would be great!
It would help if you would explain what further info you need, beyond what was provided here:

http://www.chiefdelphi.com/forums/sh...d.php?t=136453



Last edited by Ether : 10-04-2015 at 22:03.
Reply With Quote
  #12   Spotlight this post!  
Unread 10-04-2015, 22:43
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Programming Swerve Drive

What vi's to use in labVIEW. Do we use the vi meant for obtaining voltage, or something related to timing?
Reply With Quote
  #13   Spotlight this post!  
Unread 10-04-2015, 23:10
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Programming Swerve Drive

Quote:
Originally Posted by TBots View Post
What vi's to use in labVIEW. Do we use the vi meant for obtaining voltage, or something related to timing?
http://www.chiefdelphi.com/forums/sh...16&postcount=7

http://www.chiefdelphi.com/forums/sh...52&postcount=5

http://www.chiefdelphi.com/forums/sh...17&postcount=4


Reply With Quote
  #14   Spotlight this post!  
Unread 10-04-2015, 23:53
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Programming Swerve Drive

Ok, so we just need to use the get voltage vi then. What about in the begin vi? Is it going to be an encoder vi or an analog vi that we use?
Reply With Quote
  #15   Spotlight this post!  
Unread 11-04-2015, 12:47
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,113
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: Programming Swerve Drive

The programming depends on what it does, not on what it is called. It produces an analog voltage. Treat it the same way you would treat any other analog signal.
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 21:25.

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