Electronics > Projects, Designs, and Technical Stuff

Strange behavior comparator hysteresis - solved

<< < (3/4) > >>

wraper:
To make it clear. One sensor may look at white surface, another sensor on grey surface and both have identical output current due to their parameter variations. So for reliable operation even grey of medium to high-ish darkness should be detected as light surface. But dark surface should be either really dark or the best would be just a hole with no reflection at all. Also what looks dark to an eye, quite likely might be very reflective at IR spectrum these sensors operate at.
Quite a long time ago I had an issue with that on line following robot competition. Black line on white surface which organizers prepared was almost as reflective as white at IR spectrum. So more than half of robots had an issue following it, including mine since I did not implement individual adjustments for sensors. And even those which performed fine, did so only after fine adjustments.

David Hess:
I am confused about what circuit you are using but that MOSFET circuit will oscillate if the resistances are too high because of capacitive coupling between the output and inverting input.  Add a little bit of AC hysteresis with a capacitor between the output and non-inverting input.

HendriXML:

--- Quote from: David Hess on July 29, 2020, 03:57:13 pm ---I am confused about what circuit you are using but that MOSFET circuit will oscillate if the resistances are too high because of capacitive coupling between the output and inverting input.  Add a little bit of AC hysteresis with a capacitor between the output and non-inverting input.

--- End quote ---

I've added a "decoupling" resistor and the capacitor. Which seems to do the trick. I think the gate drain capacitance of the mosfet was causing it. The situation before the fix, with enhanced sensitivity:



Channel 1 is probing the inverting input, channel 2 is probing the non inverting input, channel 3 is probing the drain (3) of the mosfet (thus the hysteresis offset), channel 4 is probing the trigger output.

After the fix:


As can be seen the drain potential is lifted, when the gate is pulled up and still under the threshold.

HendriXML:
I lowered the capacitor to 47 pF. This is just enough, 100 pF would be better.

Then I did a full scan of this (in reverse)


The response is this:

A more detailed Excel graph is below.

This shows how the sensors react relative to each other. Important is that the trigger lies between the position encodings.
Also the trigger signal should not be covering to much distance.

SCAN CALCULATIONS
  RowDistance                             : 12,52 mm
  StartTriggerA                           : 415,02 ms
  EndTriggerA                             : 425,84 ms
  StartTriggerB                           : 477,78 ms
  TimeBetweenTrigger                      : 62,76 ms
  ScanSpeed                               : 199,5 mm·s⁻¹
  ActiveTriggerTime                       : 10,82 ms
  TriggerActiveDistance                   : 2,16 mm


Which is 2.2 mm, about the size of the trigger bar. This can be made smaller by using a darker reference.
This is important to know because the sensing of the magnets on the other side of the key must overlap this size. So that the data is always sensed when the trigger is fired.
What is also shown is that the sensors act about the same. The scanning was done while lifting the sensors a bit above the key. This influences the sensitivity of the sensor a lot, but using a reference sensor might mitigate the difference.
For this application the results are good enough. The circuit however draws 160 mA which is a bit much (battery power wise).

HendriXML:

--- Quote from: wraper on July 29, 2020, 01:00:31 pm ---To make it clear. One sensor may look at white surface, another sensor on grey surface and both have identical output current due to their parameter variations. So for reliable operation even grey of medium to high-ish darkness should be detected as light surface. But dark surface should be either really dark or the best would be just a hole with no reflection at all. Also what looks dark to an eye, quite likely might be very reflective at IR spectrum these sensors operate at.
Quite a long time ago I had an issue with that on line following robot competition. Black line on white surface which organizers prepared was almost as reflective as white at IR spectrum. So more than half of robots had an issue following it, including mine since I did not implement individual adjustments for sensors. And even those which performed fine, did so only after fine adjustments.

--- End quote ---
My laserprinted drawings luckily give a good distinction between white and black. I think the sensor saturates in both instance. My application of them is quit controlled in terms of measuring distance, angle, environment light, which give me some confedence in that they can work in a reliable way.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod