Go to Post Whether or not your team has the technical mentors, as long as your kids are still inspired by the adult technical mentors of other teams, and get the picture that we're trying to portray in this program, the best that you can do is the best you can do. Do it, and be proud of your results. - Beth Sweet [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #19   Spotlight this post!  
Unread 02-08-2011, 10:34 PM
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 800
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Sync Two Jags

Quote:
Originally Posted by kamocat View Post
I'm planning on wiring the encoder to both motors, and having the PID independent. Because both Jaguars are subject to the same conditions, I'm hoping I won't get significant integral windup. (Also, the integral is reset when the Jaguar output is "0")
Warning: I haven't tested this or tried to model it, but it should work in theory... Of course, the devil is in the details.

Try wrapping a control loop around the two control loops on the Jaguars to sync their voltages up. The pseudo code would be something like the following, and you can make it more complicated if the nieve implementation doesn't work. This is assuming that you are sampling the voltages of the two jaguars at the same time, and I'm not sure how much a difference in sample time between the two jaguars would effect things. Probably depends on how aggressive you are trying to sync the two.

Code:
v1 = jag1.getVoltage()
v2 = jag2.getVoltage()

error = (v1 - v2)

jag1.setX(goal - error * Kp)
jag2.setX(goal + error * Kp)
The basic idea is that you wrap a proportional loop around the two PID loops running on the jaguars in order to drive the voltage error between the two loops to 0. This should cause them to provide the same voltage to the two motors, and share the load nicely. It might also work if you try to drive the errors in the current that the two motors are drawing to 0, or something clever like that.
Reply With Quote
 


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 03:51 AM.

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