Go to Post Don't limit programming to just hitting keys, there is a lot of logic/design involved. - Mike [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 18-12-2016, 03:22
Jeremy Germita's Avatar
Jeremy Germita Jeremy Germita is offline
Co-Advisor/Lead Engineering Mentor
AKA: wood is good. plastic is fantastic.
FRC #5012 (Gryffingear) / (Antelope Valley FIRST Teams)
Team Role: Coach
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Lancaster, CA
Posts: 282
Jeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond repute
Re: Wiring Talon SRX PID w/ Beam Break Sensor

Page 49 of the Talon SRX Software Reference Manual says the Talon SRX can be put into counter mode where the edges on the input of Quadrature A are counted.

We've briefly tested a similar setup, except we used sparkfun's photointeruptor sensor connecting it to 5V, Gnd, and QuadA on the talon. Word of warning on using IR-based sensors. We've found that sunlight and venue lighting can often oversaturate the receiver, causing you to lose counts. If you must use an IR-based sensor, try your best to isolate it from ambient light.
__________________
Drive Coach Team 5012 Gryffingear / Antelope Valley FIRST teams / EWCP - (2013 - Current)
Student / Driver / Programmer / CAD - FRC Team 399: Eagle Robotics / FTC Team 72: GarageBots - (2009 - 2013)
Los Angeles Region FTC FTA/CSA/Head Ref
[FF] FIRST Pick
2014 FTC Los Angeles Regional Compass Award Winner.

2017 - Sacramento Regional / Las Vegas Regional
2016 - Los Angeles Regional Creativity + Winners (1197, 987, 5012) / Las Vegas Regional Team Spirit + SF (5012, 5851, 5049) / Galileo Subdivision
2015 - Inland Empire QF (597, 5012, 4413) / Las Vegas Imagery + Winners (148, 987, 5012) / Newton Subdivision and World Champions (118, 1678, 1671, 5012)
2014 - Inland Empire Rookie All Star + Highest Rookie Seed + SF (2339, 1967, 5012) / Las Vegas Rookie All Star / Galileo Division Imagery
Reply With Quote
  #2   Spotlight this post!  
Unread 18-12-2016, 16:24
DaveL DaveL is offline
Registered User
FRC #2976
 
Join Date: Jan 2013
Location: WA
Posts: 171
DaveL is a jewel in the roughDaveL is a jewel in the roughDaveL is a jewel in the roughDaveL is a jewel in the rough
Re: Wiring Talon SRX PID w/ Beam Break Sensor

Thanks for the wiring info and the advice on light shielding.
Dave
Reply With Quote
  #3   Spotlight this post!  
Unread 18-12-2016, 20:06
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,070
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Wiring Talon SRX PID w/ Beam Break Sensor

One quick word of warning...the Talon SRX calculates velocity as "change in position per 100ms". This works well for providing smooth velocity measurements with quadrature encoders (where you are generating tens or hundreds of thousands of pulses per second), but may result in poor velocity resolution with a break-beam sensor and number of counts per revolution. For example, a 5000 rpm flywheel with 2 pieces of retroreflective tape will generate ~167 counts per second, or ~17 counts per 100 milliseconds.

Usually for the latter configuration, you are better off measuring the time period between consecutive rising or falling edges rather than differentiating position over time. You can do this on the RoboRIO, but not on the Talon SRX (at least on current firmware as of today).

Last edited by Jared Russell : 19-12-2016 at 01:10. Reason: s/not//
Reply With Quote
  #4   Spotlight this post!  
Unread 18-12-2016, 21:14
DaveL DaveL is offline
Registered User
FRC #2976
 
Join Date: Jan 2013
Location: WA
Posts: 171
DaveL is a jewel in the roughDaveL is a jewel in the roughDaveL is a jewel in the roughDaveL is a jewel in the rough
Re: Wiring Talon SRX PID w/ Beam Break Sensor

Thanks for the advice.
However, I'm not sure what you are suggesting.

In our current setup we are using an old AM 8" wheel with 6 thin spokes.
I believe we are calling a count 1 on/off cycle (open space / spoke).
We are thus getting 6 counts per revolution.

Are you suggesting that this setup will have problems with Talon PID or that we should define a count as open/spoke (leading edge) - spoke/open (falling edge) to give us finer data resolution?

As a note, we are currently spinning the flywheel at 3,000 rpm but would want to be capable of spinning at up to 6,000 rpm.

Dave
Reply With Quote
  #5   Spotlight this post!  
Unread 19-12-2016, 07:18
phurley67 phurley67 is offline
Programming Mentor
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Michigan
Posts: 63
phurley67 is an unknown quantity at this point
Re: Wiring Talon SRX PID w/ Beam Break Sensor

Not to speak for Jared, but this is my understanding of the issue.

The Talon is counting pulses and uses the pulse count as a proxy for velocity/rpm. In your scenario you are going to initially have ~30 pulses per 100ms (3000rpm / 600 = 50(revs/100ms) * 6 spokes = 30 pulses per 100ms.

Another way to think about this every pulse in a given 100ms window represents 100rpm. If you count pulses to determine, speed you are going to have +/-100 rpm accuracy if everything else is perfect (which it won't be).

Rather than using the Talon to run the PID, you determine velocity by measuring the time between spokes 100ms/30 = 3.3ms vs 100ms/2.9 = 2.9ms if you can reliably measure changes with more accuracy than 0.4ms (3.3-2.9=0.4ms) you should be able to determine velocity greater accuracy than the Talon.

I have not done this, but I would run some tests and probably use InterruptableSensorBase override and use the readRisingTimestamp call to collect the data.

If Java/Linux collude to reduce accuracy, I might also consider using an arduino/teensy to collect this information and report via spi/i2c back to the rio.
Reply With Quote
  #6   Spotlight this post!  
Unread 19-12-2016, 08:27
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,995
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: Wiring Talon SRX PID w/ Beam Break Sensor

Quote:
Originally Posted by phurley67 View Post
I have not done this, but I would run some tests and probably use InterruptableSensorBase override and use the readRisingTimestamp call to collect the data.
WPILib uses the FPGA to timestamp the data.

FPGA samples the edges at 40MHz, and timestamps them with a 40MHz clock (25ns resolution) when detected.



Last edited by Ether : 19-12-2016 at 08:30.
Reply With Quote
  #7   Spotlight this post!  
Unread 19-12-2016, 08:28
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 505
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Wiring Talon SRX PID w/ Beam Break Sensor

https://www.chiefdelphi.com/forums/s...d.php?t=113954

We used a photoeye with two or three sections of reflector tape in 2013 full court shooter mode, speed set to 3700 rpm, max speed was around 4400 on the cim and wheel.

This year 2016 our shooter wheels used Andymark CIM encoder wired to the SRX and the using the PIDF on the srx. The CIM coder is 20 counts per Rev, from website, but the SRX counts the transitions on both channels, so 80 counts per rotation or the wheel. This was enough resolution to work well.

If you do this method, please read the SRX encoder manual and make sure you use the pull up resistors for the cimcoder.

You should probably review the hardware portion of the manual, as you may need pull up resistors for the sensor you are using too.
__________________
The sooner we get behind schedule, the more time we have to catch up.

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 19:51.

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