|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Jaguar Speed & Position Control with Encoders
Last year we tried to use the Jaguar Motor Controller's position and speed control functions in our Ultimate Accent bot. We got the BDC-COMM utility to work but couldn't work out the "C" programming.
We've had good success on the FTC team using the Matrix motor controller and would like to achieve a similar performance with Jaguars. I'd appreciate any feedback or point me to a thread where this is discussed. |
|
#2
|
|||
|
|||
|
Re: Jaguar Speed & Position Control with Encoders
Quote:
While we use Java, that should be similar to the API we use, which can be found here for all of the classes used in WPILibJ, or here for the CANJag class. Does anyone know of similar documentation for C++? |
|
#3
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
Quote:
|
|
#4
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
The PID functionality of the Jaguars does work, but adding CAN can be expensive depending on which adapter you use.
The PID on the cRIO is just as fast and as powerful as the one on the jaguar, but works with all types of speed controllers and sensors. If you're looking for basic getting started examples, there are plenty for PID on the cRIO. |
|
#5
|
||||||
|
||||||
|
Re: Jaguar Speed & Position Control with Encoders
Quote:
The serial CAN interface is somewhat inefficient, and you may find that if you send to many updates, it may use more cRIO throughput then running a 50 or 100hz PID on the cRIO would. One option would be to invest in the 2CAN. Another option would be to limit the amount of CAN traffic. Setting a setpoint every few seconds isn't a problem. Changing setpoints at 50hz to multiple jaguars and requesting lots of status can be a problem. Last edited by Joe Ross : 26-12-2013 at 19:21. |
|
#6
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
Quote:
Also, I don't think that a drivetrain used in FRC will benefit from being updated 100 times a second vs 1000. Where did you find the 1000hz number? I'm not saying it's wrong, but I couldn't find it online. |
|
#7
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
Quote:
Quote:
Quote:
Last edited by Ether : 26-12-2013 at 21:50. |
|
#8
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
Quote:
First- I've read many of your posts and want to compliment you on your contributions to the teams. Your to-the-point, thorough, and expert responses are a pleasure to read. Thank you! I've begun following your links and have a lot of studying to do... |
|
#9
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
Yeah, but the point Jared was making was that the pulse width coming from the sidecar is about 20 ms, so you still can't get better than about 50 hz.
Also, I'm having a really hard time thinking of an FRC application where you need to update 1000 times per second over 100 or 200. It seems to me that in a single millisecond, a negligible amount of change can be done to the speed of a motor, and that some sensors won't show a change over 1/1000 of a second. Has anybody really seen a benefit from really fast PID loops? |
|
#10
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
Quote:
You can change the PWM period coming from the sidecar, so you can send commands at a higher frequency. |
|
#11
|
||||||
|
||||||
|
Re: Jaguar Speed & Position Control with Encoders
The PWM pulse repeat rate can be as high as 200hz. By default, it is 200hz for Jaguars, 100hz for Victors and Talons, and 50hz for Servos.
|
|
#12
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
I was unaware that this works. A while back (2009 or 2010) I looked at the signal with a scope, the pulse width was somewhere between 1-2.5 ms, and the delay in between was 20 ms, no matter what speed controller was selected (in LabVIEW).
|
|
#13
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
We have had a very positive experience using the closed loop PID in the Jaguar with Speed Control. Less than .25 seconds to reach proper speed from 0, even shorter times when returning to speed after a shot.
It doesn't require the CRIO PID to process it which free resources that can be used for other things. |
|
#14
|
||||
|
||||
|
Re: Jaguar Speed & Position Control with Encoders
Quote:
Fast spinup and recovery times are strongly influenced by mechanical design: operating speed, motor(s) selection, gear ratios, wheel diameter, and moment of inertia of the load (including wheel and flyweight). With a proper mechanical design, you should be able to get fast spinup and recovery times with other controllers as well. |
|
#15
|
||||||
|
||||||
|
Re: Jaguar Speed & Position Control with Encoders
It's in the jaguar source code (not sure if it's still available online, used to be available from TI). There is a 1ms timer interrupt. It runs the PID and updates the H-bridge PWM from the same interrupt.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|