-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comparator hysteresis #192
Comments
Hm. That makes sense. But I remember the discussion some time ago when somebody convinced me that it should be in parallel. That's why I was afraid of CPU ADC measurement and was so worried about threshold levels precision. And that's why I proposed to increase the values. |
Interesting, I’d love to know what the concern was. We put them in parallel in the boards we fixed and they work fine. |
so shall I place them in series or in parallel? |
@gkasprow I vote for series and here is why:
|
@gkasprow NB the current circuit does not quite fix all the problems. I believe that there is still the possibility of a race when the DFF is reset. The problem occurs partially because the DFF reset is global and applies to all channels at the same time. So, it is possible for the interlock to trip while the DFF reset line is pulled high by the microcontroller (in which case, the DFF will not see the edge of the comparator and will not latch). This is likely to be a very rare case, but still worth considering. |
Would this be fixed if we tie the DFF S and R lines together? That way whenever the DFF is reset the RF switch is opened, ensuring that the comparator output goes low. Since the comparator (after hysteresis) and power detector are slow compared with the DFF reset time, this will ensure that the interlock can only retrigger once the DFF is ready. What do you think? |
with S and R lines tied together the DFF output could be undetermined. |
At least for the CD4013BC, the truth table specifies the output when S=R=1 (Q=Q_bar=1). There could of course be a transient depending on which pin goes high first |
Yes, but after they are released the state could be unknown due to the race condition. |
True. I guess that suggestion is also nasty since it means that all outputs glitch when the interlock is reset. The other idea I had was to put an RC filter (something like 1k + 300pF) between the comparator output and the DFF input. Then add a FET on the DFF input that pulls the DFF input low when the RESET line is high. The RC filter doesn't have a significant impact on the interlock speed, but ensures that whenever the DFF is reset, its input is LOW so we never miss a transition. |
let's put fast DFF from LVC74 series. it has a few ns of propagation delay. |
Sounds good. What about a FET with small RC filter to ensure correct sequencing on RESET? |
DFF needs short rising edge. If you use LPF then it will toggle the output when clock is high but then toggle it back when clock is low. I had such issue in the past |
true. Okay, so then...next try: 1k resistor between comparator and DFF, no capacitor. FET to pull the DFF input low during reset and some kind of delay on the FET gate to ensure it switches after reset (even an inverter should add enough delay for this). |
Or, @gkasprow suggest a suolution that you think will work |
@gkasprow how about we fix this in SW? We can do the following: we make it part of the contract that during interlock RESETS all output channels switch off briefly. So, the interlock reset sequence is:
|
Correct me if I'm wrong but don't we currently use only one line for RF switch & interlock reset? ATM we have procedure like
|
@wizath okay, so when one presses the RESET button/issues a software reset, the switches are all opened (no RF). Is that correct? If so, I think we're okay and there can be no race condition on the output interlock, so long as the interlock is held high for at least a few us whenever it is reset since:
For the input interlock I guess there can still be a race, since the power detector is before the switch. Not much we can do about that. But it shouldn't be too much of a problem since the output interlock will still trip. So long as you're happy that this is all fine and there is no possibility of a race, we can close #200 |
@gkasprow did you implement this? |
Let's use the NC7SZ175P6X DFF. It has only reset signal which is inverted but we can use the signal before the IC2 inverter |
Can we make that 100p and 1k, please? Otherwise it's quite a lot of current for things to source. |
done |
The text was updated successfully, but these errors were encountered: