Log in

View Full Version : Commanding Speed in a Negative Number Results in Runaway


Kingofl337
08-03-2010, 22:12
I'm playing with CAN set Speed a bit in Java and DBC-COMM and setting a Speed of negative RPM causes the jaguar to command full speed. It seems the jaguar doesn't understand a negative RPM value.

duane
09-03-2010, 00:17
This is purely a guess. It's not a negative value but rather an unsigned value. Which translates a negative value into a very large positive value.

That's purely a guess based on experience as a programmer. :-)

Kingofl337
09-03-2010, 11:13
I'm pretty sure this is the issue also, probably in the Jaguar firmware.

dyanoshak
12-03-2010, 11:55
Hi Adam,

Are you seeing this on a Gray or a Black Jag?
What firmware version are you running?
What are your PID values?

-David

Kingofl337
12-03-2010, 22:28
Black Jags,
Firmware 89,
PID 2, .0001, 6

US Digital Kit Encoders 360cpr

I posted sample code on the 2010 beta site

dyanoshak
15-03-2010, 11:25
Hi Adam,

We were able to recreate what you're seeing on my setup here. After doing some testing we noticed that there is a small bug in the PID code that makes the reverse direction more sensitive to PID tuning.

Correct me if I'm wrong, but I bet you tuned your PID constants in the forward direction first, and then tried to move in reverse (I did the same thing). I would try tuning your PID in reverse first. It should be possible to tune in reverse, even with the bug.

I would try lowering P and possibly D and see if that helps tuning in the reverse direction. Once tuned in reverse, forward should work just as well.

We are currently working on a bug fix and the best plan of action on releasing an update if it is deemed necessary.

Thanks for your input and please keep me posted!

-David

Kingofl337
15-03-2010, 15:55
if FIRST doesn't want you to release an update, I'd be willing to test a beta version of the fix.:p

dyanoshak
17-03-2010, 19:42
There is new firmware that should fix this issue. Please see this thread: http://www.chiefdelphi.com/forums/showthread.php?p=938852#post938852

-David