Go to Post I like the way you are saving weight by cutting out the center of the speed controllers. - jcatt [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 13-02-2012, 15:44
powerrbill powerrbill is offline
Registered User
FRC #0486
 
Join Date: Jan 2012
Location: Philadelphia area
Posts: 4
powerrbill is an unknown quantity at this point
speed by encoder

In our everlasting wisdom we have decided that trying to maintain shooter precision. To do this we are trying to take output from an encoder in 100 millisecond samples. Is this even feasable? How would we accomplish this?
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2012, 16:39
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,062
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: speed by encoder

Quote:
Originally Posted by powerrbill View Post
In our everlasting wisdom we have decided that trying to maintain shooter precision. To do this we are trying to take output from an encoder in 100 millisecond samples. Is this even feasable? How would we accomplish this?
Read the encoder in a 10Hz thread.

Did you try reading the encoder in TeleOp (50Hz)? If so, why was that not satisfactory?

Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2012, 16:51
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: speed by encoder

Quote:
Originally Posted by powerrbill View Post
In our everlasting wisdom we have decided that trying to maintain shooter precision. To do this we are trying to take output from an encoder in 100 millisecond samples. Is this even feasable? How would we accomplish this?

Or you can use the encoder as the sensor for the PID class - the PID class will start a timer and sample the encdoer regularly for you at 50Hz I think
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2012, 16:56
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: speed by encoder

Quote:
Originally Posted by powerrbill View Post
In our everlasting wisdom we have decided that trying to maintain shooter precision. To do this we are trying to take output from an encoder in 100 millisecond samples. Is this even feasable? How would we accomplish this?
Our team is reading the shooter speed from an optical encoder and applying PID control on the shooter speed. So it is possible. We are using Jaguars on CAN bus, so we connected the encoder directly to the Jaguar. Our PID control reads the shooter speed from the Jaguar and calculate the motor output power using our PID controller.

It is working quite well. The only issue we have is that one of our mentors have a strobe light and decided to check the shooter speed with it. It came out different from our encoder reading. For example, if we set the shooter speed to 3000 RPM (and reading approx. 3000 RPM on the encoder), the strobe light said it was 2400 RPM. No matter what speed we read on the encoder, the strobe light seems to read a percentage lower than the encoder. At first, I questioned how accurate is the strobe light? But the mentor who provided the strobe light said he had sent it in for calibration and just gotten it back, so it is calibrated. So I am entertaining the idea that we did not read the encoder correctly which is possible since this is our first year playing with the Jaguar and the encoder is connected to the Jaguar. So here is our question: Did we configure the Jaguar correctly regarding the encoder?

When configuring the Jaguar, we set it to PercentVbus mode. We also called ConfiguEncoderCodesPerRev() with 360 (we have a 360-line optical disc on our encoder). Then we called SetSpeedReference() with kSpeedRef_QuadEncoder. Our question is: why do we need to specify kSpeedRef_QuadEncoder in SetSpeedReference and what is the difference between kSpeedRef_QuadEncoder and kSpeedRef_Encoder? My understanding of the difference is that quadrature counts both rise and fall edges of the encoder pulse for both channels A and B so it is "more accurate" but since the GetSpeed() function will scale the output according to quad or non-quad, from the caller's point of view, it should have no difference. Am I understanding this correctly?
__________________
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:35.

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