Quote:
Originally Posted by jwakeman
1. US Digital E4P
This one looks like it is only for use with the Andy Mark gear box. I've decided to forget about this one since I'm not using that gearbox in this application. Good?
|
Fair enough. The AndyMark gearboxes are surely easy to use with them. Certainly not the only place they could be used, but other places you would have to fashion the correct sized shaft and mounting holes to use it.
Quote:
Originally Posted by jwakeman
2. Gear tooth sensor
This is the one that is pictured in the "C/C++ Programming Guide" for WPILib. This sensor only uses one digital input. I should use it with the GearTooth class. I can call the Get() and GetPeriod() methods from the Counter class it inherits from to get the count and rate respectively. I'm not sure if I can sense direction or not with this one. I was under the impression you need an A and B channel to sense direction. I see one comment in GearTooth.h that says "but in future versions we might implement the necessary timing in the FPGA to sense direction." But then I see a function named EnableDirectionSensing(). I'm leaning toward the comment being stale. If so then I should be able to call GetDirection() from the Counter class as well. Should this sensor only be used with gears that are in the FRC KOP due to the spacing/shape/number of teeth? Or will it generally work with any gear with ferrous teeth?
|
You can't sense direction with most gear tooth sensors, but there are a few that can. I believe the geartooth sensor class doesn't support that, but the FPGA and the Counter classes support it. You just need to use the kPulseLength mode. Generally works with any gear that fits the specs of which ever geartooth sensor you choose.
Quote:
Originally Posted by jwakeman
3. Magnetic rotary encoder
Does the WPILib support this one yet? In the "2011 FRC Sensor Manual" it says this sensor can be used in applications that typically used quadrature encoders. However the different interfaces it lists don't seem to match up with the Encoder class in WPILib. It talks about a serial interface which is staring to look like it would involve using the I2C class. It looks like this mode would take up 4 digital I/O slots on a digital module. I'm not sure what the address refers to in DigitalModule::GetI2C(UINT32 address). I see the device takes a 5-bit READ Angle command that would return 16-bits. How would this line up with the methods in the I2C class? Is the 5-bit command the registerAddress in I2C::Read(UINT8 registerAddress, UINT8 count, UINT8 *buffer)?
|
It supports in several ways. The serial interface would work with SPI, not I2C. There is also a duty cycle output that you can read with the Counter class. There is also a filtered output of the duty cycle that can be read via the analog input (this is the configuration that has pins wired by default). The last method (I know... there are a ton) is the sin cos test mode. I personally think this is the best way to interface it. You need to do a bit of soldering to enable that mode, but you would then wire the sin and cos signals to the analog input. Those then are configured with 2 analog triggers. and the outputs of those are hooked up to a quadrature decoder. Awesome!
Quote:
Originally Posted by jwakeman
4. Linear Encoder with magnet strip
This one has the familiar A and B channel and seems like it would match up nicely with the encoder class. Is that magnet strip intended to only be laid out flat? Or can I wrap it around a shaft or sprocket that I am trying to measure the pulses on?
|
Yes... the A and B hook up the same way as a typical encoder. You can use the index to figure out if the magnet is in range too.
You could wrap the strip around a shaft, but if you want it to turn 360 degrees, the interface would be shaky. You can get circular strip as well (or so the data sheet claims).
-Joe