Using the camera to auto position

I’m suspecting something wrong in the find axis length procedure with limit switches. i’m wondering if there is a video somewhere of how farmbot is perfoeming that so i can compare with the behaviour i see.

Just take this piece of code :

https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.correlate2d.html

and apply it between images of the day before and present image (captured by the camera)
it should return the current position

3 Likes

There is really something wrong when using limit switches : i have both changed the arduino and the Ramps board and still get this pathological behaviour :
When i dont plug any limit switches to the Ramps board but enable them and select the normally open mode there should be no effect because the limit switch pins on the board are free so it’s an open circuit. Yet when i try to move the bot, it apparantly receives many fake "limit switch signals"along it’s motion which makes it stop and restart again from a new resetted origin and eventually it can move meters this way with many interruptions even if i asked it to move 10 cm only.

Everything becomes normal when i disable limit switches: bot motions are all right.

So it seems that there is a kind of electronic instability
triggering fake signals when limit switches are enabled even though ther is no limit switch actually connected. I think it’s a bug because as i said i changed the hardware and reflashed several times…
can someone help ?

@fhenryco Have you checked the connectivity of the limit switches with a continuity tester?

As i said , even if no end switch is connected i see the pathological behaviour … but before checking this i of course tested my end switches

Could it be that there is an issue with floating pins? To which potential do they refer if closed? GND or +5VDC? What about using a 100k resistor as either pull up or pull down depending on the potential they refer to?
25 years ago when I was in trainig for electronics it was said that floating pins are bad because they can float to wherever they want. It is always better to either pull them up or down according to the needs.

1 Like

You are certainly close to the correct answer, thanks.

But then according to
https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches

i need to put both capacitors and resistors and the design is more complicated !

i believed that such boards could be used readily without extra electronic manipulations…

I’d just give it a try with the pull up resistors only. That should solve your problems.
If it doesn’t I’d give it another shot with the capacitors.

The resistors alone did not solve the issue but with the capacitors it works !

I dont have the same problem for the y and z axis… only the signal on the x axis was apparantly much too noisy !

1 Like