![]() |
Help! Velocity control with Jaguars and CAN
If you are using two jags to control two motors and one gear box, how do you use the jaguar in position or speed control?
Our system is using two jags to power two CIMs and one CIMple gearbox, with one US Digital encoder. So we were trying to tune the PID for our drive, and it was printing the speed and position the first time. However, it would only do it the first time it went though, because we had a function that cleared the driver station LCD and it wouldn't print anything after we ran that. We're also using JAVA and Netbeans. :) We eventually figured out that it was a can timeout exception when we left our coding computer plugged in. Then we kept getting CAN-time exceptions. We thought we were overloading them so we put it in delays -- big delays too, like 0.1. We've tried uncommenting and commenting things and breaking up the try-catch it was erroring in. They seemed to change almost randomly, printing the speed or position for a few seconds before erroring and still moving but not giving us back the values. So we think we could set them always, just not get them.... When we took out the delays and slave motors, it worked, but we don't want to do that because it might burn out the slave motors. We're really confused as what to do, and we don't even really know what the problem is.... so if anything needs clarification.... Thank you!!! :D |
Re: Help! Velocity control with Jaguars and CAN
Not sure exactly what you're looking for, but I think you were asking how teams handled the situation of having multiple drive motors physically connected together and doing closed loop speed control.
On my team, we offloaded the PID control to the robot side of things. We use the encoders connected straight to the Jaguar for logical and wiring simplicity, and query them on the current rate through CAN, then use our own PID code to adjust the output of the Jaguars based on the encoder feedback, and using the PercentVbus control mode, which allows us to command the Jaguars to a certain proportion of their maximum output. We also make use of the Jaguar sync groups to keep them updating together. We wanted to implement a balancing scheme based on current flow, but that's been bumped to an off season project due to time. As far as your problems go, it sounds like you have spotty communications, make sure your motors aren't fighting each other (which could cause overcurrent faults and voltage dips), make sure your CAN network is properly terminated (an unterminated network can have all kinds of weirdness due to communication breakdown). For reference we use a similar delay of about 0.05 in our code to prevent CAN overload. Good luck, Matt |
Re: Help! Velocity control with Jaguars and CAN
I'm not sure but it sounds like you are using the encoders connected to one Jaguar per drivetrain side and then syncing them via the cRIO. There was some extensive discussion on doing this in this thread: http://www.chiefdelphi.com/forums/sh...ad.php?t=89282
One thing to note is that attaching the encoders directly to the Jaguars can introduce ground loops and noise into the system, which could potentially cause the Jaguars to fault. As shown on the 4th page of that thread a solution was posted in schematic form that eliminates these ground loops and attempts to alleviate some of the potential noise issues. Obviously I can't say for sure what is causing your issues but that thread has some great discussion on the issues with what you are trying to do and potential solutions that may help you out. |
| All times are GMT -5. The time now is 03:46. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi