View Full Version : Using encoder with jaguar
demosthenes2k8
20-01-2011, 19:14
My team saw in a PDF that it was possible to use an encoder connected to a jaguar to regulate the speed. Unfortunately, we haven't been able to find any information about actually DOING this in C++. Is there any example code that shows how to do this?
basicxman
20-01-2011, 19:45
Is there any example code that shows how to do this?
If there was example code for everything, FIRST wouldn't exist.
Learn how to use the encoder, learn how to use the Jaguars, research on closed-loop controllers. Do your homework! :D
Alexander Meyer
20-01-2011, 22:04
It's possible, and example code exists (see the CANJaguar project on FIRST Forge) but you'll need to use CAN instead of PWM control for your Jags, which is a whole 'nother can of worms.
demosthenes2k8
20-01-2011, 22:13
Oh, we're already using CAN, so that's not a problem.
We think we ended up finding out what we needed, we just have to initialize it with kSpeed, set the speed reference, and convert joystick values into RPM.
Alexander Meyer
20-01-2011, 22:47
Don't forget to set your PID values..
Kevin Sevcik
20-01-2011, 23:55
Sorry, using velocity or another other closed loop control on the Jaguars has been deemed illegal. See here: http://www.chiefdelphi.com/forums/showthread.php?p=1004743#post1004743
demosthenes2k8
21-01-2011, 11:34
Ouch. Welll...I guess that settles it, then.
it is allowed from what i've seen, check team update 4
http://usfirst.org/uploadedFiles/Robotics_Programs/FRC/Game_and_Season__Info/2011_Assets/Team_Updates/Team_Update_04.pdf
demosthenes2k8
22-01-2011, 11:45
Yeah, we found that. Thank you!
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.