In BDC-COMM, I can set the control mode of the jaguar to position using a potentiometer.
The little text box that displays the position updates as I move the shaft, but when I try to move the shaft to a set-point, the shaft always turns away from it.
So, when I tried reversing the sign on the PID constants to make it go the other direction, it would turn past the point and never try to come back to the set point.
Also, I tried using the soft-limit feature on the Jag, but the jag happily goes past the limit without stopping.
Position Mode Reference
Sets the reference used for measuring the current speed of the motor. Currently, the only
supported speed reference is an encoder.
Format:
pos ref <val>
Where <val> is a 8-bit unsigned number
Is this merely a typo, or does that mean that the jaguars cant use a potentiometer for position control?
Has anyone gotten position control working with a potentiometer in either BDC-COMM, or C++/Java?
Yes, that looks like a typo. Position mode can operate with either an encoder or a potentiometer.
With regards to you position control problem, first try and download the latest version of BDC-COMM and the Jaguar firmware from http://www.luminarymicro.com/jaguar. The most recent version is 87.
Some things to look at and/or try:
How do you have your potentiometer wired to the Jaguar? The Jaguar’s analog port is designed with an internal 1K resistor in series with the ‘+’ connection so that when using an external 10K potentiometer, the voltage range is between 0V and 3.0V instead of 0V and 3.3V. Check out the wiring diagram on page 22 of the Getting Started Guide (linked to on the Jaguar site).
Are you setting the number of turns correctly in the Configuration tab?
The possible set positions range from 0 to <POT Turns>
Are you setting the desired position at a position that is actually obtainable? Move the potentiometer by hand and see what values are read by the Jaguar. You might be trying to hold a position that will never happen.
If none of that helps, upload some photos of your setup and/or some screen shots.
This can happen if you loaded (Gray) Jaguar code on a Black Jaguar and vice versa.
Firmware for Black Jaguar is “BlackJaguar-87.bin” and the firmware for (Gray) Jaguar is “Jaguar-87.bin”.
There is a way to recover by using BDC-COMM in the command line.
Open up a command line terminal and navigate to the folder where you have bdc-comm.exe. To make it easy you can put it in your ‘c’ drive. I also recommend putting the firmware files in the same folder as bdc-comm.exe so that you do not have to type in a file path.
In the command line run the following:
C:>bdc-comm.exe -c N
replace the ‘N’ with the COM port number you are using
id X
replace ‘X’ with the ID you had previously set for that Jaguar (factory default is 1)
update BlackJaguar-87.bin
if the firmware is in the same folder as bdc-comm.exe, this will work. Be sure to change the file name for Gray Jaguar firmware.
The update should happen, showing progress as a percentage. Hopefully if everything went OK your Jaguar should be blinking again.
The files seem to be miss named, the BlackJaguar-87.bin file worked on a grey Jaguar, but the Jaguar-87.bin file caused it to crash.
Thank you for the help, I will try the position control again tomorrow.
Ok, here is the current set up. I have a potentiometer hooked up to the output shaft of a toughbox.
It is a 1 turn potentiometer, but the output shaft only turns ~200 degrees before hitting hard physical stops.
When the shaft is at the reverse physical stop, the position reported is 0.
When the shaft is at the forward physical stop, the position reported is ~1.
when i try a setpoint of 0.5, directly in the middle of rotation, from the forward limit, the shaft turns further towards the forward limit until it activates the limit switch.
So, I try negating the pid constants, it turns way past the setpoint (0.5) until it hits the reverse limit.
What should the PID values approximately be to get the jag to slowly apply power to turn the shaft?
I would just start with P to begin with. With my setup, a pot on a window motor , my P is at about 500. This moves the shaft pretty quick to the setpoint. I would try stepping up from 50, until you get a good feeling for how much P causes the motor to turn.
I was unsure of how high the values could go, so I tried something pretty high in my opinion (So used to numbers from -1 to 1 :rolleyes: ). When it wasn’t quite working, the next thing i jumped to was I control.
What is the range for the PID constants? 10bits + sign (-1024 to 1023)?
P I and D constants are 16.16 signed fixed point numbers. So 16 bits of precision in the integer part, 16 bits of precision in the fractional part. Approximately -32K to 32K.
Our black jaguar has stopped working as well… We think that we must have uploaded the wrong firmware to it, but whenever we try to fix the bricked Jaguar it never works. We get a progress bar and the “Firmware update” Takes about an hour, but never fixes the Jaguar. Does ANYBODY know how to fix this problem.