Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Programming Swerve Drive (http://www.chiefdelphi.com/forums/showthread.php?t=135739)

TBots 13-03-2015 01:10

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!

MaGiC_PiKaChU 13-03-2015 07:41

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 ;)

MaGiC_PiKaChU 13-03-2015 08:47

Re: Programming Swerve Drive
 
I never worked with labview but i guess you only need the logic here

Ether 13-03-2015 09:14

Re: Programming Swerve Drive
 
Quote:

Originally Posted by TBots (Post 1457170)
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.



TBots 14-03-2015 00:31

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?

MaGiC_PiKaChU 14-03-2015 12:23

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

Ether 14-03-2015 12:28

Re: Programming Swerve Drive
 
Quote:

Originally Posted by TBots (Post 1457170)
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).



TBots 23-03-2015 16:25

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! :)

FrankenmuthK 24-03-2015 22:17

Re: Programming Swerve Drive
 
Quote:

Originally Posted by MaGiC_PiKaChU (Post 1457193)
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?

TBots 10-04-2015 16:11

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! :)

Ether 10-04-2015 18:14

Re: Programming Swerve Drive
 
Quote:

Originally Posted by TBots (Post 1469290)
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



TBots 10-04-2015 22:43

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?

Ether 10-04-2015 23:10

Re: Programming Swerve Drive
 
Quote:

Originally Posted by TBots (Post 1469414)
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



TBots 10-04-2015 23:53

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?

Alan Anderson 11-04-2015 12:47

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.


All times are GMT -5. The time now is 10:22.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi