View Full Version : jaguar scaling factors
MAldridge
22-01-2011, 18:20
My team (3247) just got our bot driving today and we noticed a big problem. With four motors we are using 2 black jags and 2 grey jags. This seemed fine except for a problem where the scaling is not quite right! When driving foward, one side (black side I think) is way faster. As the programer for the team, I was told to fix it. I was thinking that maybe I should attempt to scale the joysticks. The problem with this is that my team also wants to use arcade drive. We used last years DS for testing but they think it will be easier to control with arcade.
My questions are:
How do I make each side move in step so that the bot drives strait using PWM
How do I re-scale the joysticks so that most of the range is for slow speeds and it is still possible to get full speed
Is there a better solution that does not involve buying more jaguar controllers
Thanks in advance
markgryzwa
22-01-2011, 18:57
Same issue for our team. Would love to hear the answer. The black jaguars output about 12.5V in full on, the grey/tan jaguars are about 10.5V. Quite a difference to balance.
Us3rNam3
22-01-2011, 18:59
idk if this would help any but you could always try installing encoders onto each side of the drive train then using those output values and then scaling back each motors output.
Mark McLeod
22-01-2011, 19:46
With four motors we are using 2 black jags and 2 grey jags.
By far the simpler solution would be to pair a Black Jaguar with a Gray Jaguar on each side, rather than having all Blacks on one side and all Gray's on the other.
You can certainly scale back the faster side permanently by multiplying the joystick input to just the Black side by a factor or by using encoder feedback and PID.
MAldridge
22-01-2011, 20:09
because these are the CIMple gearboxes from andymark, I don't think it would be advisable to mix controllers. I see ground gears for anyone who tries that...
The voltage data is very helpful, does anyone know if the speed is ramped in a linear fashion? If it is linear, then it would be some very simple math to make them even.
I would suggest using PID with encoders to get a closed-loop control.
There's nothing quite like feedback for repeatability and low-speed handling.
MAldridge
23-01-2011, 12:14
Can you suggest any good resources for creating PID algorithms? I am used to text based languages on OS/2 so any resources that are labview based would be nice.
If you're using LabVIEW, the FRC version does include a PID toolkit. Note that the LabVIEW toolkit uses the Standard form rather than the Ideal form.
http://en.wikipedia.org/wiki/PID_controller#Ideal_versus_standard_PID_form
Wikipedia has a good article on PID.
MAldridge
23-01-2011, 15:00
I read through the article posted and I am trying to make heads or tails of it. I do not understand how exactly a PID loop will allow me to synchronize the movements of the left and rights drivetrains so that the robot drives in a straight line. PID does however seem to be an excellent way of defining the movements during autonomous to place the ubertube.
More questions:
How do I use PID to make the system drive in a straight controllable line while not sacrificing response times?
Is PID a good choice for autonomous?
Is all of this overkill for what I am trying to achieve?
Vikesrock
23-01-2011, 15:05
More questions:
How do I use PID to make the system drive in a straight controllable line while not sacrificing response times?
Is PID a good choice for autonomous?
Is all of this overkill for what I am trying to achieve?
1. If you use the joystick controls to set a velocity that you use a PID loop to maintain instead of setting the Jaguar values directly the robot should maintain equal velocity on both sides and drive in a straight line.
2. Yes, PID control on position is a good way to handle dead reckoning forward/back movements in autonomous. PID control on angle using a gyro is a good way to make dead reckoning turns.
3. Nope, not at all.
MAldridge
23-01-2011, 19:52
so do I use one PID VI for each input needed on the drive VI?
In my question about autonomous, would I want to use a setpoint VI.
Lastly, does the PID VI need to be in a loop to work? Sorry for all the questions, but short and simple answers for APPLYING code are few and far between over at NI's site.
Al Skierkiewicz
23-01-2011, 20:22
Have you tried calibrating the speed controllers?
MAldridge
23-01-2011, 21:05
I have, but there is still a slight variance from straight on.
Yes, yes, and yes.
I think a global variable would work wonderfully for transferring your setpoint from your autonomous code to your PID loops. Put the PID loops in Periodic Tasks so that they run all the time.
MAldridge
23-01-2011, 22:36
Should the PID Loop run with a delay or should it run at full speed?
Well, the PID probably isn't your most critical task, so a delay would be good. I would give it a delay of 5 to 25ms.
One thing I may have neglected to tell you:
PID doesn't "just work". You have to tune it.
Luckily, temporary deployments in LabVIEW make that easy. Just create a control for the parameters, and tune until it works. Make sure to start with Proportional, and then tune the others to whatever is appropriate.
EDIT:
Feel free to post your code. An easy way to post your whole project is to zip the folder it is contained in, and just upload the zip as a whole. To make it smaller, you can delete the "Builds" folder first.
dyanoshak
24-01-2011, 10:53
Same issue for our team. Would love to hear the answer. The black jaguars output about 12.5V in full on, the grey/tan jaguars are about 10.5V. Quite a difference to balance.
I don't want to move this thread in a different direction, but could you please elaborate on how you measured the output voltage?
Did you use a volt meter, scope, other?
Were motors connected to the outputs?
Did you take these measurements at the same time (measure one, then the other, same setup)?
-David
markgryzwa
25-01-2011, 10:17
I assumed the duty cycle at full on was 100% so I simply used a voltmeter
Set to DC. No motors. No load.
Measured two Black and two Grey
Full forward and full reverse
Same result consistently.
Mark McLeod
25-01-2011, 10:24
I assumed the duty cycle at full on was 100% so I simply used a voltmeter
Set to DC. No motors. No load.
Measured two Black and two Grey
Full forward and full reverse
Same result consistently.
This is a false measurment. The Gray Jags at full really drop maybe .15v more than the Black Jag.
Your measurement was just a by-product of the Gray Jaguar circuit design.
It doesn't measure properly without a load.
The Black Jaguar has a different design that doesn't affect no-load measurements.
I tripped over that myself earlier (http://www.chiefdelphi.com/forums/showpost.php?p=984936&postcount=40), although you have to read several surrounding posts to understand what was going on in that thread.
I liked Eric's way of putting it...
Put simply, it would be physically impossible for a Jaguar (or a Victor) to have an actual 2V drop while driving a motor and not be on fire: It is WAY too much heat to dissipate.
patrick_allen
25-01-2011, 10:52
What about creating a slider "trim" control.
Your "trim" control would run joystick position through a multiplier on one set of Jags. Experiment with trim position until you're satisfied that you're driving in a straight line.
This method will only be suitable if the differences between the Jags are consistent at various speeds.
markgryzwa
25-01-2011, 10:59
Thanks Mark.
We do clearly have a small speed difference between black and grey as well. Much harder to measure though.
I'll measure under load and see what I get.
MAldridge
25-01-2011, 19:40
I don't think the offset is linear. I just tried my code today with the speed being divided by two and the robot drives much straighter. I haven't had a chance to test PID yet. Electronics guys are still trying to get encoders connected.
Al Skierkiewicz
26-01-2011, 07:38
I should have mentioned this much earlier. How much wire do you have feeding the two sides of the robot? A frequent problem is inches feeding one side of the robot with feet feeding the other side. If you are using #12 to feed the drive system, you can accumulate significant loss in the wiring. It amounts to about 0.2 volts per foot at near stall current for CIM motors. Remember you have to count both the black and red wires to arrive at the correct calculation. It is for this reason that I recommend a central location for the PD to balance the wiring.
MAldridge
26-01-2011, 13:44
all wiring runs follow the same path, we had the problem you are describing last year
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.