I am trying to set up a Black Jaguar running firmware version 101 using a direct computer serial connection and BDC-COM so that the Jaguar will operate a CIM motor in speed control mode. Currently, I only have an AS5304 magnetic encoder to provide the feedback. I can interface to the Jaguar over the serial interface fine. I can command it to run forward in Voltage mode (reverse seems to through it immediately into error mode). But neither position nor speed mode seem to have any reading. I tried initially connecting A to A, B to B, Index to Index. Then I tried disconnecting B and Index, and connecting the magnetic encoder index to the A encoder input. Still no joy.
The KOP digital encoders are for 1/4 inch shafts, and the CIMs are 5/16ths. I have ordered a larger unit, but all I have right now is the AS5304. I would like to prove out the concept before trying to program the Jaguar into speed mode through the cRIO, so I would rather get the whole thing running on my test set up with direct PC control before complicating the interface side.
I have been experimenting with Jaguar in speed mode. Refer to the following thread:
It looks like it’s very tricky to get a stable PID control on Speed. I will play with the PID constants some more. If it is still too unstable, I may try to experiment with my own PID algorithm to see if it can do better.
Have you looked at the AS5304 output on an oscilloscope? Do you see pulses?
From the data sheet it appears that the chip needs to be positioned very precisely in relation to the multipole ring magnet to function.
I did it last year with encoders just fine, and will do it this year after the vision code is squared away. Remember, you need to set all the options (PID constants and such), or else it won’t work.
-> Mike, yes, I have played with PIDs before. For the kicking the soccerball game, I suggested to the team we do a swerve drive, all wheel drive with separate all wheel turning. The PIDs to control the steering motors never worked well using PIDs, so I expect to have some work to do there. Fortunately, this year we do not need instant response to improve over PWM open loop Voltage control.
-> Matt I did not drag the scope over. I may try that soon. I did hook up a DVM to the index and A signals and experiment with a hand held magnet. I got beeps out of the DVM to show a rapid signal change on the Index pulse, and could get a moderate region of voltage change on the A channel. From what I can see, the AS5304 is an analog quadrature detector, with essentially one ‘line’ per revolution. To work on the robot, the A and B outputs would have to connect to the Analog sidecar, but the Index pulse should be digital, or better yet an interrupt pin. This would be a great place for an Arduino/Atmel or PIC to convert the A and B quadrature voltages into a digital angle.
-> Dan I believe that P=1.0;I=0;D=0 is a valid equation, but just in case the Jaguar was doing as you suggest and not implementing the PID at all until all 3 terms are none zero, I was using P=1.0;I=0.001;D=0.001 as a starting point. I commanded a minimalist 1 RPM, but with the measured speed always failing to work and recording as zero, I saw the ramp up function of the I term work perfectly until the Jaguar went into fault mode, probably numeric wrap around.
I still do not know why the index pulse, which is a digital signal, when fed into the Jaguar encoder channel A input as described in the getting started manual fails to measure any speed. Since I don't have this working yet, the magnetic encoder is not bolted down, and I can move it freely over the magnet on the shaft to try for the best position. I found the correct tiny button magnets int he shop and took them home for testing, but now I can not find them. So I am using a much larger ceramic magnet taped in the shaft on edge because the magnetic quadrature needs the difference between north and south to rotate. I verified a good signal using that magnet and orientation on the test bench, so it should work.