HELP Swerve Drive!!!!!

Ok I’m actually pretty new to labview and actually programming altogether and this year our team decided on using swerve drive for our robot. I am freaking out because we only have four days left and this drive system is a nightmare. Can somebody help me please. our main problem is getting the pod part of the wheels to act like a servo motor and follow the axis value of the controller we’re using with a max turn of 90 degrees i have the encoder wired correctly and the encoder isnt a problem so how can i make the motor act as described above

Team 358 has graciously posted some labview code on their site here that has a PID example for swerve drive. This example uses a POT instead of encoders.

http://team358.org/files/programming/ControlSystem2009-/LabVIEW/
P(ID) example 2010.

Well we were actually looking into pots right now and my main question is how the PID actually works. The lab view help doesn’t exactly describe it in the terms of a newbie.

What part don’t you understand?

**

The help says that The PID range features control output raange limiting with integrator anti-windup and bumpless controller output for PID gain changes. Use the DBL instance of this VI to implement a single control loop. Use the DBL Array instance to implement parallel multi-loop control.

That is really a fantastic explanation and all plus you can tell national instruments wanted to explain it but what does it mean :confused:

One way to look at it is, PID turns your motor into a servo.

You know what angle you want your wheel to be at, and a sensor knows where the wheel actually is.

The first is called the setpoint, and the second is called the process variable.

You provide the setpoint and the process variable as inputs to the PID, and it takes care of the math to figure out what output to send to the motor to make it do what you want.

Armed with that overview, try reading these and see if they make any sense:

http://www.eetimes.com/ContentEETimes/Documents/Embedded.com/2000/f-wescot.pdf

By the way, you guys should get a team member whose job it is to hang out on Chief Delphi and check things out as your team is making decisions. Had you done so, you’d have known that it is strongly advised that a team not attempt swerve for the first time during build season. I feel your pain.
*
*

Well we are actually a third year team; however this is My first year actually programming the robot our old programmer is going to college and isnt around all the time to help out .

Thanks though for the information and the pdf file i am going to use what i now know with team 358’s example you’ve been a big help

That’s not what I said. It doesn’t matter if it’s the team’s 10th year. The question is, has the team ever done swerve before; and if so, has the knowledge gained from doing so carried forward to this year’s team?

Thats what i told everyone when we started doing this that the swerve drive would be a good summer project i was against doing it as our programming has been simplified before so that we wouldnt need many sensors however they seemed to think it would be a good idea to try it this year

Hey, look on the bright side. Every cloud has a silver lining: think how much you’ll learn.

my thoughts exactly because of swerve ive done work with encoders and potentiometers now

our team burnt our pot up

how do you use encoders with a PID example because I just found out that we cant use them on our bot

I’ve got little experience with PID, however it’s easy to calculate where you are, the error in your system, and set an output based on said error.

I don’t have access to a machine with LabView on it tonight, however if you PM me I can send you an example of correction without PID.

Ok I will thanks

How did that happen? Mechanical or electrical overload? If it was hooked up to the analog breakout properly, electrical load probably would not have been an issue, but I also don’t see how a mechanical failure would cause it to burn up without going wicked fast (its a technical term;) ).

well actually we had it wired wrong it wasnt until yesterday that we found out that they plug into the analog breakout on the cRIO

I’m using the example by team 358, and have figured out the min and max on our pot however the wheels arent doing what i want they are just spinning continuously. Would it have something to do with the gains

this statement is no longer valid as we have solved this problem

The pot was mounted wrong the PID works great thanks to Ether, DominickC, and Matt Krass. Thanks everyone for all the help