Go to Post Learning from the innovations of others is part of what makes FRC great, regardless of your own teams accomplishments or lack thereof. - hg273 [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
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 05-02-2011, 15:16
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 333
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
BDCComm Settings for Speed Mode Testing?

Hi Gang,

We're testing the Jaguars in Speed control mode via BDCComm-92. The Jaguars are updated to Rev 92 of the firmware. I have the KOP encoder (US Digital EAP4 360-250-0-0-0) attached to a CIMple box with 1 CIM attached. The encoder is on the center CIMple box shaft and I have VCC wired to the + on the Jaguar, channel A of the encoder to A on the Jaguar, Gnd on the encoder to -, channel B of the encoder to B on the Jaguar.

For BDCcomm, on the configuration tab, I have the encoder lines set to 360. The mode set to "Speed". My PID values are set low for testing (P=.3, I=.001, D=0). If I set the Reference to "Quadrature Encoder", and try to set an RPM, it takes off at full speed rather than the RPM I set.

If I set the reference to "Encoder", it seems to work at the proper RPM. So, first question is, why not Quadrature Encoder? Do I need to adjust the number of encoder lines or something?

If I try to go into Position mode and set a positive position, the motor takes off in the negative direction and vice versa. Does this mean that it's actually and "Inverted Encoder"? I'm just trying to figure all of this out before committing it to software.

Also, there is a lot of chatter on the motor with low speeds. So, I'm assuming that my PID values need adjusting. But, no matter how I adjust the PID numbers I can't get it to stabilize. Any guidance on this adjustment process would be greatly appreciated.

TIA,

Mike
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2011, 17:59
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,624
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: BDCComm Settings for Speed Mode Testing?

The good news...I know for a fact what you're trying to do works.

Now why it's not working for you:

Couple of things come to mind you might want to check.

Make sure you have A and B of the quadrature encoder in the right place in the wiring. Do this first. If there's anything wrong in the mechanism or wiring there's no point in tuning it won't end well. You can check those encoders if you hook them to the cRIO.

As you're tuning for a set point of RPM (velocity):
Try setting your P gain (Kp) to 0.1 or less and raising your I gain (Ki) between 0.001 and 0.1. If your mechanism can be perfectly driven by the ideal discrete time version of that Jaguar PID loop (in other words it's a near match to some of the assumptions that math makes) you might not need much P gain (Kp) at all (in theory very little or none). If P gain (Kp) is too high it'll oscillate (what you might be calling chatter) and sometimes you can move it up slowly from 0.1 to 0.3 for example and it'll work (you'll hit hard oscillation if you go up say 50%-80% more)...but then when you set it directly to 0.3 it will immediately oscillate when it starts the motor moving from a dead stop.

Try tuning the mechanism off the floor assuming it's a drive mechanism.

Not sure about your encoder setting issue haven't looked at that setting myself will ask the students.
UPDATE: We have our quadrature encoders running as quadrature encoders.
Perhaps A or B is not really connected?

Last edited by techhelpbb : 05-02-2011 at 19:18.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2011, 20:36
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: BDCComm Settings for Speed Mode Testing?

I was having the same trouble with the Quadrature Encoder setting on my team's robot, but I haven't gotten around to testing it.
It may be a bug in the Jaguar firmware.

"Encoder" and "Inverted encoder" only use one channel of the encoder for speed, and assume the direction based on its output. I believe the only difference is that "inverted encoder" switches the "forward" direction for the motor, though I've no idea if this corresponds to the LED color.
One trouble with these modes is that "encoder" will always return a positive value when you ask its speed, and "inverted encoder" will always return a negative.

Quadrature encoder, however, uses both channels of the encoder to determine the speed AND direction.


As for tuning, I found (0.1, 0.05, 0) works well for my team's robot. I think this is due to the slop in the chain. On my test robot, my tuning is around (3, 0.1, 0).


One way to check if your encoders are properly connected is to try them in POSITION mode. Note that your PID coeffecients in Position mode can be significantly different from your coeffecients in speed mode, and you DEFINITELY need integral to get to your setpoint.
__________________
-- Marshal Horn
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2011, 10:59
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 333
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: BDCComm Settings for Speed Mode Testing?

Thanks Gang!

I'll definitely try a couple of these suggestions on the robot. Also, I'll hook my scope up to the encoder outputs to see if we're really seeing quadrature. It's good to know that the BDCComm program should see these as a quadrature encoder. This means that the cables may be hosed up. As soon as I get this beaten into submission, I'll post a write up.

Thanks!

Mike
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2011, 12:14
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: BDCComm Settings for Speed Mode Testing?

Trying using only a negative P constant.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Reply With Quote
  #6   Spotlight this post!  
Unread 06-02-2011, 15:04
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: BDCComm Settings for Speed Mode Testing?

I tried on my test 'bot at home, and the "quadrature encoder" setting works fine.
I'll recheck the team's bot. It probably is an issue with the wires. (Perhaps the encoder connector isn't properly seated)
__________________
-- Marshal Horn
Reply With Quote
  #7   Spotlight this post!  
Unread 06-02-2011, 21:05
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 333
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: BDCComm Settings for Speed Mode Testing?

I'm assuming that there may be something wrong with the cables I was supplied by the controls folks. I just want to verify the cable layout for the connection from the encoder to the jaguar. Could someone who has the encoder working with the jaguar (as a quadrature encoder) please tell me your cable layout so I can verify my cables?

TIA,

Mike
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 17:50.

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