Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Wheel encoder to Jaguar Wiring (http://www.chiefdelphi.com/forums/showthread.php?t=86297)

taichichuan 07-12-2010 08:39 PM

Wheel encoder to Jaguar Wiring
 
Hi Gang,

Has anyone had success wiring a US Digital quadrature encoder to the PID input on a Jaguar? If so, what wiring did you use? The Jag has 5 lines, +5, A, B, I, Gnd. Are the A & B the same A & B from the US Digital? And, do you just ignore the I input on the Jaguar? Once that was done, what PID values did you use to close the loop?

TIA,

Mike

Jared Russell 07-12-2010 08:56 PM

Re: Wheel encoder to Jaguar Wiring
 
Quote:

Originally Posted by taichichuan (Post 968858)
Hi Gang,

Has anyone had success wiring a US Digital quadrature encoder to the PID input on a Jaguar? If so, what wiring did you use? The Jag has 5 lines, +5, A, B, I, Gnd. Are the A & B the same A & B from the US Digital? And, do you just ignore the I input on the Jaguar? Once that was done, what PID values did you use to close the loop?

TIA,

Mike

"I" on the Jaguar refers to Index, a feature of some encoders that helps to "home" the system to a consistent zero location. You can safely ignore it. A->A and B->B. The PID values usually require a bit of experimentation to get right; they depend on the specific motor, the load attached to it, and the gearing between the motor and the sensor.

taichichuan 07-13-2010 03:58 PM

Re: Wheel encoder to Jaguar Wiring
 
Thanks, that's what I thought. But, I've been completely unsuccessful at closing the loop with the Jaguars and a Mechanum drive. It seems to work OK at very high speed, but I get a lot of backlash at low RPMs. I've tried tinkering with the PID values, but I just can't seem to get a set that even comes close. I'm having better luck with running the encoders to the DS. But, they eat up my DIOs something fierce with 2 DIOs/wheel. I was just trying to see if I'd missed something obvious.

Thanks,

Mike

Jon Stratis 07-13-2010 04:08 PM

Re: Wheel encoder to Jaguar Wiring
 
You can use the BDC-COMM application to quickly and easily make sure the encoders are hooked up correctly. Simply hook your computer up to the Jaguar, connect the program to it, and spin the wheel by hand - you should see the encoder counts change. We did that when we were trying to figure out our PID loop a while back.

Or you can get your code to periodically report the speed/distance of the wheels to show how it's working.

taichichuan 07-13-2010 04:33 PM

Re: Wheel encoder to Jaguar Wiring
 
We did that too. Everything looked good. But, when you tried to get it to actually work in motion, the wheels started to chatter terribly. It's possible that there was some issue with a couple of the gear boxes. But, there was just no joy :-(. Even when we tried just a P with not I or D, we couldn't get the system to stabilize.

Thanks,

Mike

apalrd 07-13-2010 04:34 PM

Re: Wheel encoder to Jaguar Wiring
 
kP/gain/Proportional: This does most of the work. The output is proportional to the difference between what you want and what you have. output = (setpoint - process_variable)*kP, also known as gain

kI/Integral: This integrates the error over time, multiplies it by kI, and adds it to the output. Be very careful with this one, you should need a very tiny bit (a decimal with at least 2 0's in front of the digit seems about right). Too much and you will overshoot. Because of how it is designed, it will not stop applying power until it overshoots and unwinds the integral.

kD/Derivative: This takes the curve of the past action and accounts for momentum. The faster you have gone, the more this works to slow you down. This is always working against proportional.

you might not be "tinkering" with the PID values enough. Try setting kI and kD to 0 and then tuning kP. If it overshoots too much or oscillates, then turn it down. If it dosen't, increase it till it does and dial it in to the perfect number. You probably don't need kI and kD.

To give you an idea of scale, my inputs are all scaled to inches/second and the gain is 0.01. I did my math on the cRio (using Victors for output).

taichichuan 07-13-2010 05:32 PM

Re: Wheel encoder to Jaguar Wiring
 
Hmm... OK, we tried that. Setting kI & kD to 0 and then trying kP at anything > than .8 caused really bad results (back chatter of wheels) at low RPMs. I have to admit that I'm at a bit of a loss as to what's going on. If I have the kP at .35 and kI=0, kD=.003, it runs well at higher RPMs, but doesn't even come close to max voltage according to BD_COMM. Maybe at IRI I can find someone who's using Jaguars to close the loop and they can enlighten me as to what's going wrong.

Some folks are just saying that the Jags just suck. I'm inclined to give the Jags the benefit of the doubt until I talk with others.

Thanks,

Mike

s1900ahon 07-13-2010 07:16 PM

Re: Wheel encoder to Jaguar Wiring
 
What is the Jaguar firmware. Since you indicated you used BDC-COMM, this should be available to you.

taichichuan 07-13-2010 10:47 PM

Re: Wheel encoder to Jaguar Wiring
 
We were using Rev 89 firmware. I just updated them to Rev 91. Where there problems related to the encoders in Rev 89?

Thanks,

Mike

Joe Ross 07-13-2010 11:14 PM

Re: Wheel encoder to Jaguar Wiring
 
Quote:

Originally Posted by taichichuan (Post 968920)
We were using Rev 89 firmware. I just updated them to Rev 91. Where there problems related to the encoders in Rev 89?

There was a problem with speed PID. See http://www.chiefdelphi.com/forums/sh...ad.php?t=84371

taichichuan 07-14-2010 12:27 AM

Re: Wheel encoder to Jaguar Wiring
 
It figures... That's what we get for not paying much attention to CD lately. I'll give the Jags another try after IRI.

Thanks,

Mike

biojae 07-14-2010 01:54 PM

Re: Wheel encoder to Jaguar Wiring
 
If you still have access to the robot, can you tell us what BDC COMM says for speed when you apply +12v (or +100%) to the motor?

Also, have you set in BDC COMM the number of lines per rotation (360 for this year's encoder, I believe.) ?

Jared Russell 07-14-2010 02:05 PM

Re: Wheel encoder to Jaguar Wiring
 
Quote:

Originally Posted by biojae (Post 968988)
Also, have you set in BDC COMM the number of lines per rotation (360 for this year's encoder, I believe.) ?

250 for the kit encoder from 2009, 360 for 2010.

s1900ahon 07-15-2010 04:03 PM

Re: Wheel encoder to Jaguar Wiring
 
It probably doesn't hurt to suggest that you probably also want to get the latest BDC-COMM.


All times are GMT -5. The time now is 03:58 AM.

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