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

“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.

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

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.

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

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

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

What is the Jaguar firmware. Since you indicated you used BDC-COMM, this should be available to you.

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

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

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

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.) ?

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

It probably doesn’t hurt to suggest that you probably also want to get the latest BDC-COMM.