|
Joystick motion to CAN connected jaguar
Here's the latest update.
I took Radical Pi's advice (thank you) and called,
SetSpeedReference.
I can now read non-zero values when calling GetSpeed.
I can now use values for Set () greater than one (hurray!).
I STILL can't read the firmware version. I'm okay with that.
I am only able to read zero when calling GetPosition. Maybe you have to be in position mode?
With PID values = 10,0,0 and encoder counts of 360, I got a lot of cogging (chattering?) at speeds less than 10 rpm.
I artificially inflated the encoder counts and got MUCH smoother motion at all speeds.
For the new encoder counts, I used (360 * 12.75 = 4590). I also tried
(360 / 12.75 = 28.2 ==> 28 ) but the cogging was WAY worse than before.
The maximum speed I could achieve that was reported with GetSpeed was about 32. I'm going to have to use something (a strobe light, maybe?) to determine the actual rpm value.
I'm kind of surprised that SetSpeed Reference had to be called. I was looking through the embedded comments in CANJaguar.cpp. The comments stated that the only option for a feedback device in speed mode was ... wait for it
... an encoder!
Thanks to everybody that contributed.
Sam
|