*1a) What is the most reliable and accurate way to connect the signal on pins 2 and 4 of the Bosch Seat Motor to the roboRIO and decode the signal to obtain an output shaft position?
1b) How could you connect those pins to an SRX to do closed-loop position control in the SRX?
I pulled up the spec sheet after OP, and found what appeared to be conflicting information, as to whether it was an encoder/digital system or an analog system. Given the number of problems the team is working through, and as I did not have one of these motors in hand, I decided to let this one wait until at least after competition.
Just spitballing here: based on Kevin’s description above, it appears that the voltage falls sharply but not perhaps not enough to trigger a DIO change. If that is that case, I would try adding an amplifier of about 6db (2x voltage) to the signal(s) from the motor - in the direction coming DOWN from 5V. I would then feed that gained signal to a DIO and let the RIO’s internal counters keep track of the cycles. Once the gain was added, this might also be a suitable signal for an SRX.
As suggested I tried a schmitt trigger…seems like the logical choice. Unfortunately the one’s I found only trigger between 2V and 3V. Should have looked closer at the spec sheet :(. MM74HC14 not the right choice.
Sorry, will try and fix that for next year and update the spec sheet after we get some team feedback on what works best with RoboRIO and SRX.
It’s actually an analog output but not in the sense that most may assume. The voltage falls pretty sharply and looking at it may in some way be read as digital if only you could get the drop to fall to zero.
Update: I did a quick check with 5V and my home scope. You get no signal above around 500 ohms. ~300 ohms you start getting a lot of noise. The sweet spot seems to be between 100 and 250 ohms. 120 ohms gives 1V drop (4.6V-3.6V) 220 ohms gives 1.28V drop (4.2V-2.9V)
Thanks for running that test. I was afraid that would happen, but it was worth checking.
The problem is there are only 2 pins (pin4 and pin2). Pin2 serves as both signal output and power input. So when the Hall circuit drops the signal voltage, it also drops its own circuit supply voltage.
A Schmitt trigger with properly set thresholds should do the trick. Anybody willing to give it a try?
Seems like a Schmitt trigger would definitely do the job. Just a matter of finding one in the right trigger range. If that is not possible, I wonder if an Arduino mini could do a similar function. A bit overkill but the benefit is you can customize.
Update: First test went very well for using the suggested transistor based Schmitt trigger circuit. I got 3V drop square wave using some trial and error and an online calculator. Is that enough for a good read by the SRX and RoboRIO DIO?
No problem. I don’t get to play with electronics as much as I like so good practice and it’s fun.
Hmmm.:mad: Guess it’s back to further playing with resistor combinations. I was getting something on the order of 4.7V to 1.7V. Will also check again if maybe there was an error on the breadboard.
I haven’t dug into these yet, but these two screenstepslive pages hint that you could do this for up to four Bosch motors with no additional hardware. Finding thresholds which are reliable might be an issue.