|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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. |
|
#2
|
|||
|
|||
|
Re: Wiring Talon SRX PID w/ Beam Break Sensor
Thanks for the wiring info and the advice on light shielding.
Dave |
|
#3
|
|||||
|
|||||
|
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// |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
||||
|
||||
|
Re: Wiring Talon SRX PID w/ Beam Break Sensor
Quote:
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. |
|
#7
|
||||
|
||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|