Go to Post For me, FIRST is inspiration with a positive feedback loop - it just keeps getting better. I wonder where it will go from here... - petek [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 23-11-2011, 09:50
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: [DFTF] Closing the loop on Wheel Velocity...

Quote:
Originally Posted by Joe Johnson View Post
Has anyone used a Jaguar to close the velocity loop? The standard PID modes do not support this which is a shame (you can input an encoder but the PID loop is then based on position of the encoders not speed).
Joe,

I am confused with your comment here. It does support this; they just call it "Speed Control Mode" See page 12 in the attached manual.

Am I missing something?

-Hugh
Attached Files
File Type: pdf MDL-BDC24_BDC_COMM.pdf (204.7 KB, 25 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 23-11-2011, 10:41
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: [DFTF] Closing the loop on Wheel Velocity...

Quote:
Originally Posted by Hugh Meyer View Post
Joe,

I am confused with your comment here. It does support this; they just call it "Speed Control Mode" See page 12 in the attached manual.

Am I missing something?

-Hugh
No, I guess I have been missing something. I have looked at a lot of Jaguar docs but missed that one.

Looks good.

Has anyone used two (or more) Jaguars driving 1 wheel (or more specifically set of wheels on one side of the robot), with one wheel encoder feeding multiple Jaguars... ...IN VELOCITY CONTROL MODE (phew! that's a mouth full)?

If so, did it work well? Also did you use an I term in the PID loop (i.e. a I gain != 0)?

Finally, digging even MORE into the details, "Speed Ref <val>" command takes an unsigned 8 bit number for <val>. How do you set negative velocities ? Oh... never mind, I see that this is used to tell the Jaguar what is the speed sensor (only the encoder is supported but I guess they are imagining a day when others may be)

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
Reply With Quote
  #3   Spotlight this post!  
Unread 23-11-2011, 10:59
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,072
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [DFTF] Closing the loop on Wheel Velocity...

Quote:
Originally Posted by Hugh Meyer View Post
Joe,

I am confused with your comment here. It does support this; they just call it "Speed Control Mode" See page 12 in the attached manual.

Am I missing something?

-Hugh

I think what Joe was saying is that the encoder is inherently a position transducer and the Jag would have to differentiate the signal to get rate... and at low speeds the signal from the encoder is not changing at 1000Hz so you can't get a 1000Hz rate signal from it.

[edit] I guess I was reading between the lines too much [/edit]


Last edited by Ether : 23-11-2011 at 11:00. Reason: see Joe's response below
Reply With Quote
  #4   Spotlight this post!  
Unread 23-11-2011, 12:40
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: [DFTF] Closing the loop on Wheel Velocity...

Quote:
Originally Posted by Ether View Post
I think what Joe was saying is that the encoder is inherently a position transducer and the Jag would have to differentiate the signal to get rate... and at low speeds the signal from the encoder is not changing at 1000Hz so you can't get a 1000Hz rate signal from it.

[edit] I guess I was reading between the lines too much [/edit]
There is that problem as well. But No, I had totally missed the velocity feedback mode.

As to counts frequency, at 256 counts per output of say a CIMpleBox and a 3:1 to an 8" wheel (1ft per rev) youll get 32 counts per inch (256*3/24). At this resolution you fall below 1000hz update at roughly 2.5fps. BUT... the code may use edges instead of periods to estimate speed (4X) if it does then we'd be pretty close the range where we cover all useful FIRST robot speeds (.6 fps seems slow enough for me)

Even without this, a slower update rate may be fine as long as we don't go crazy with the D gain.

We'll have to try it and see.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
Reply With Quote
  #5   Spotlight this post!  
Unread 23-11-2011, 12:53
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,072
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [DFTF] Closing the loop on Wheel Velocity...


Or you could gear up the encoder a bit I suppose so it is spinning faster. Kind of kludgy but it might work since the encoder is virtually no load. Have to be careful not to exceed signal processing capability of Jag.


Reply With Quote
  #6   Spotlight this post!  
Unread 26-11-2011, 01:54
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: [DFTF] Closing the loop on Wheel Velocity...

Quote:
Originally Posted by Ether View Post

Or you could gear up the encoder a bit I suppose so it is spinning faster. Kind of kludgy but it might work since the encoder is virtually no load. Have to be careful not to exceed signal processing capability of Jag.

It has a 50 MHz Cortex M-3. Unless the PID algorithm onboard is rather complex and heavy on the cycles, how could anything from a digital encoder approach the Jag's limits?
__________________
Attending: MN Duluth Regional
Reply With Quote
  #7   Spotlight this post!  
Unread 26-11-2011, 02:16
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: [DFTF] Closing the loop on Wheel Velocity...

Quote:
Originally Posted by theprgramerdude View Post
It has a 50 MHz Cortex M-3. Unless the PID algorithm onboard is rather complex and heavy on the cycles, how could anything from a digital encoder approach the Jag's limits?
The Stellaris microcontroller does quadrature decoding in dedicated hardware, so there is no additional processing burden for running the encoders faster. The upper limit of that circuitry is 1/4th the speed of the processor. For a part running at 50MHz*, that is roughly 750,000 RPM for a 250 count encoder. However, I doubt you'd get clean signals from the poor encoder at those speeds!

The Stellaris has more computational horsepower available than the entire IFI control system put together several times over. It is an amazing show of what Moore's law does to the industry.

* Edit: I can't remember what speed they actually run on the Jag - there simply is no need to run at the full 50 or 80 MHz. Suffice it to say that it is still overkill.

Last edited by EricVanWyk : 26-11-2011 at 02:22.
Reply With Quote
  #8   Spotlight this post!  
Unread 26-11-2011, 08:07
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: [DFTF] Closing the loop on Wheel Velocity...

Quote:
Originally Posted by EricVanWyk View Post
The Stellaris microcontroller does quadrature decoding in dedicated hardware, so there is no additional processing burden for running the encoders faster. The upper limit of that circuitry is 1/4th the speed of the processor. <snip>
Do you know if the processor "does the right thing" in terms of speed calculations, by which I mean, does it get 4 readings per nominal encoder tick (rising edge channel A, rising edge channel B, falling edge channel A, falling edge channel B) AND create the time as rising edge to (the same) rising edge and falling edge to (again, the same) falling edge?

The reason I say this is that the encoder folks do a much better job at spacing their ticks than they do at getting exactly 50-50 ON-OFF duty cycles and spacing the phasing between the sensors A and B (remember their is only 1 encoder wheel, the 90 degree shift in the signal between the two phases is done by physically spacing the encoders N+/-(1/4) encoder pulses apart.

The reason I ask is that I want to get 4X the speed readings doing it this way provides over just a single speed reading per encoder tick which is the most obvious way to do things (see the above discussion about keeping high PID loop times at slow speeds -- without 1,000Hz sensor reading, it makes little sense to have a 1,000Hz update rate on the PID loop).

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
Reply With Quote
  #9   Spotlight this post!  
Unread 23-11-2011, 12:56
lemiant's Avatar
lemiant lemiant is offline
the Dreamer
AKA: Alex
FRC #4334 (Alberta Tech Alliance)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Calgary, AB, Canada
Posts: 562
lemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond repute
Re: [DFTF] Closing the loop on Wheel Velocity...

I'm not particularily up on the benefits of good quality control loops as our code on my old team looked something like this:

Quote:
x = Joystick.x/JOYMAX
y = Joystick.y/JOYMAX

leftMotor.Set((y+x)*100)
rightMotor.Set((y-x)*100)
The first version was written in 10 minutes by 1114's Programming mentor . But I digress.... What I wanted to make sure gets said in here is that as much as stellar control has the potential to help, a lot of the issues you are referencing are pretty blown out of proportion. e.x. A simple 6-wheel drive with reasonable weight balance will drive straight all on its own. Just wanted to make sure we remember that.

- Alex
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 16:39.

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