Go to Post Dean's said it before, and it's been repeated many times, but it clearly hasn't sunk in yet, so I'll say really loudly. FIRST is not a science fair! - Karthik [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-11-2011, 07:45 PM
NicholasRuhland NicholasRuhland is offline
Registered User
FRC #3070 (Team Pronto)
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Seattle, WA
Posts: 5
NicholasRuhland is an unknown quantity at this point
Mecanum and Encoders

We have mecanum wheels with attached Optical Quadrature Encoders. They're hooked up to our CAN Jaguars.

Right now, the wheels are turning at different speeds. And we want them to turn at the same speed because our mecanum system is hard to manually adjust on the field.

Is there a way to use the encoder values to dynamically regulate the speeds of the wheels? Or should we just use the encoders, get some values, find a magic number, and program them in?

We're using Java.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-11-2011, 10:25 PM
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: Mecanum and Encoders

Quote:
Originally Posted by NicholasRuhland View Post
We have mecanum wheels with attached Optical Quadrature Encoders. They're hooked up to our CAN Jaguars.

Right now, the wheels are turning at different speeds. And we want them to turn at the same speed because our mecanum system is hard to manually adjust on the field.

Is there a way to use the encoder values to dynamically regulate the speeds of the wheels? Or should we just use the encoders, get some values, find a magic number, and program them in?

We're using Java.
Look at using the speed control mode of the jaguar. Are you using CAN or pwm?

If you use CAN you can use the speed control mode other wise you need to hook the encoders to the cRio and use PIDController.

As an example for speed control.

Code:
CANJaguar jag = new CANJaguar(channel, CANJaguar.ControlMode.kSpeed);
jag.configEncoderCodesPerRev(ENCODER_TICKS);
jag.setPID(P, I, D);
jag.setSpeedReference(CANJaguar.SpeedReference.kEncoder);
jag.enableControl(0);
replace the following:
channel with the jag number
ENCODER_TICKS with how many pulses per revolution the encoder is
P I and D with your Proportional Integral and Derivative terms

To figure out your PID values you will need to do some tuning. Head over the the Technical->Electrical->CAN section there are many threads there.

When you go to set the value of the jag set it to the speed in RPM not -1 to 1. so for example we limited our output to 400 rpm in normal mode.

Code:
jag.set(joystick1.getY() * 400);
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:26 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi