|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
Quote:
|
|
#17
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
|
|
#18
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
Age is catching up with me :-(
|
|
#19
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
We have now ordered the first round of circuit boards. Everything should arrive around May 14. These are for test and verification of the design, before we commit to making a bunch. I and several other students will be soldering the boards.
With the circuits we have ordered resistors with different values so we can do some testing and fine tune our encoder.The resistors that will most likely need fiddled with are involved with the voltage divider feeding into the first op-amp. We just don't know how sensitive the SMT phototransistors will be, compared to the through-hole version on the wire-wrapped prototype. |
|
#20
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
For illustrative purposes, this is the current schematic of the encoder. The voltage dividers Brooke is referring to are R1/R3 and R5/R7, on the left side of the schematic. These dividers set the threshold for a high or low value.
Maybe now would be a good time to expand our in-team discussion to the wider CD community. Initially, we had intended to offer this encoder as a completely assembled component, and as a kit. Our thinking was that the kit could be used for skill building, while a commercially assembled board should be more reliable for competition use. Going to the Kickstarter forced us to be more pragmatic. I used to memorize Heathkit catalogs in my youth, but couldn't see the volumes for kits being worth the headache of confused parts or damaged components. The truth is, we just don't know if it is better to keep on the road that we are on, or re-think the option of offering kits. Any thoughts? |
|
#21
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
I didn't expect crickets. Well, we have some new news. Our SMT components arrived today, and my tracking info on the boards says that they should arrive tomorrow. This is ahead of our original schedule. We will post pictures when the boards arrive. Unfortunately, this doesn't advance our schedule any sooner than assembling on Monday, With college placement tests, Special Olympics, and Mother's Day all happening this weekend, we have no confluence of students and time. Looking at the size of the components we used to fit everything on the board, while not an absolute position, I've moved decidedly against offering kits. I can now see why Heathkit had trouble being reborn recently. It looks like successful assembly will take the skills of a dentist or a damond cutter. That being said, if there is interest, we may add a lower award tier for a kit of parts, with one extra component of every type. I'm sure there are a few masochists like me around that would love the challenge. |
|
#22
|
|||
|
|||
|
Re: Arbitrary Quadrature Encoder
Why are you guys using op-amps instead of comparators? Comparators output a direct digital signal. Response times will be better, since you don't need to worry about slew rate (not as if that was a concern in the first place)—something like the LM339 instead of the LM324.
|
|
#23
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
This isn't a good fit for the Jag, but for teams wanting another way to interface an encoder, this part is a good choice and sets up an interesting software project.
This project is very good to see as-is, just wanted to offer another avenue in case it is helpful to anyone. Also, studying the data sheet enough to understand it can be a good way to learn -- possibly with some mentor or student discussion mixed in. Last edited by nuttle : 10-05-2013 at 23:53. Reason: fixed link |
|
#24
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
Quote:
There are several reasons that are tied together, but I'll start with the easiest first. Comparators are specialized op-amps. Our original circuit was attempted with comparators, and didn't "work". Switching to more general-purpose LM741 op-amps, which were available at the local Radio Shack, made it work, and the LM324 is a quad version of this op-amp. In reality, the first phase probably worked fine, but we couldn't sink or source enough current to drive the second phase LED's for feedback. That's the problem with using comparators for this circuit. They are typically connected to high-impedance logic inputs and not driving current consumers. Using the LM339 for example, it sources nil current at high signal, and only sinks 15 mA at low signal. While this will light our indicator LED's, it would be at a much lower intensity. In our circuit, we source the current for the LED's from the op-amp, rather than sinking or switching a transistor. There are comparators that can sink or source comparable current to what the LM324 can supply, but they are much more expensive than the LM324. We could have split the phases apart and used a dual comparator for the first phase and a dual op-amp for the second, but we wanted to reduce component count. |
|
#25
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
Quote:
If you use a chip like this, you would have to use I2C to make it practical. It would also need an easy way to change the address, so it does not conflict with the existing accelerometers that can use I2C. If you used SPI or RS-232, then you would only have one encoder per robot. You could hang more off of an onboard laptop or Raspberry PI, but that would probably violate current rules. In the end, we figured we could expand in this direction if it made more sense in the future. I guess we'll find out in August if it would just be cool to play with, or more useful for the next system. This is the engineer's conundrum of doing it because you can versus canning it because you should. Last edited by Levansic : 11-05-2013 at 09:50. |
|
#26
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
The prototype boards have arrived!
![]() Boy are these things small. If all goes well, we should have the first one assembled tomorrow. |
|
#27
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
Looks nice -- have fun!
BTW, I think you could connect up to 8 of the encoder chips I mentioned over SPI, using something like a 74LS138 (and even more using a similar scheme with more/different parts to select which chip to enable). The datasheet for the encoder chip shows this in Fig 15. You'd hook the SS* line from each chip to one of the outputs from the 74LS138, and inputs to the 74LS138 would be three digital output lines, plus the original chip select line from the digital side car. You would use the three digital output lines to choose which encoder chip to interact with, one at a time. Other than this, the rest of the SPI usage should be unchanged. If someone out there is looking to try something like this, I just wanted to follow up. Good luck with the project, it will be very useful I'm sure and to others as well. Thanks for sharing! Last edited by nuttle : 13-05-2013 at 10:39. Reason: fix links |
|
#28
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
Quote:
That sounds like a lot of work. It also sounds like a central interface for a bunch of encoders, rather than individual encoders. Nothing wrong with that, but that would be a bit more specialized than our plain encoders. We kind of ignore SPI existing on the digital sidecar, as we've never got it to work correctly. This contrasts with our experience with I2C, which just works. Perhaps it is the programming environment and libraries that we use (LabView), or perhaps the implementation of SPI on the accelerometer. Sometimes should work and does work aren't in the same ballpark. |
|
#29
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
First round of hand-soldered printed circuit boards work! For actual production we do plan on soldering the boards with a machine but for the prototype boards it will easier and cheaper to do it by hand. We have done minor testing; there needs to be a few adjustments to the values of some resistors but other than that it is successful.
[IMG]http://tehachapi-stem.org/images/First_born.jpg[/IMG] Last edited by Bneufeld235 : 15-05-2013 at 01:38. |
|
#30
|
||||
|
||||
|
Re: Arbitrary Quadrature Encoder
You have to pay attention to signal integrity when working with anything even slightly high-speed on the digital side car. We've had good success with SPI, but I don't want to take things off topic. Your project is great!
FWIW, here's a photo of a 6-encoder board we used for Lunacy, before it was legal to use CAN. This worked really well, it used the digital I/O lines as a bus to interface a similar (but non-SPI) encoder chip. At first, the digital I/O lines had enough bounce to cause occasional problems, one major source was the long round cable used to connect the cRIO to the DSC that year, at least if you went with the KoP solution. The ribbon cable connected to the digital I/O on the DSC and the other connectors were to encoders and coast/brake inputs (I think we decided this wasn't legal and left these off). This type of thing is a good off-season project, it does normally take a while to get everything working well, including the software! Again, it is great that this is being done; thanks for sharing and good luck! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|