Farmbot-Web-App icon indicating copy to clipboard operation
Farmbot-Web-App copied to clipboard

Finding home fails

Open amerkay opened this issue 5 years ago • 7 comments

Expected Behavior

Using v7.0.1, "find home" should go back to 0,0,0 and error correct minor slips during operation.

Actual Behavior

1 out of 10 times, it fails. It just sets x-axis at home when it's actually at x=1000 (!=0). Now it's doing everything at an offset, and not doing what it should.

Steps to Reproduce

Maybe it's my woodwork with the garden bed. Just regular run time, 1/10 times.

Results of git log -1

NA

Am i missing something in the configs (Imgur)? If not, let's add a retry feature to homing if successful in regular operation (not manual calls) - if the homing is way off (>5%) like homing at x=1000 and succeeding incorrectly.

amerkay avatar Aug 09 '19 20:08 amerkay

Maybe it's my woodwork with the garden bed. Just regular run time, 1/10 times.

Your X-axis stalls which causes the encoder to assume that the end is reached. Check your mechanics and moving behavior at those positions where the issue occurs.

If not, let's add a retry feature to homing if successful in regular operation (not manual calls) - if the homing is way off (>5%) like homing at x=1000 and succeeding incorrectly.

How is the bot supposed to know if the homing was truly successful? It just can't detect if it is really at the end. So I don't see a possible software fix. -> The only way to check that properly is by adding a position switch at each home position. But fixing your mechanics should already be enough to find home properly (in case nothing blocks the tracks).

AscendFB avatar Aug 11 '19 10:08 AscendFB

Thanks for the reply.

The way I see it is, if I stop using the "Find Home" in my sequences, I have no problem, as the regular retry mechanism fixes a failed move by retrying (I have it at 7 for z-axis, but 3 default works fine too, just need to grease my z-axis screw with something other than olive oil).

How is the bot supposed to know if the homing was truly successful?

That's why I suggested only enabling this check if we are in a sequence (not manual, calibrating device mode from the "Controls" tab). If it succeeds at what's supposed to be x=1000, we don't trust this result and retry "Find Home". We can add say, if 3 retries fail, just believe x=1000 is now 0.

Thoughts?

amerkay avatar Aug 11 '19 20:08 amerkay

I put together this sequence. It should accomplish the same result. Be at 0,0,0 before trying to home, during normal usage within a sequence. I'll try it over the next few days.

Imgur

amerkay avatar Aug 11 '19 23:08 amerkay

Be at 0,0,0 before trying to home, during normal usage within a sequence. I'll try it over the next few days.

I've been using this for many months now and its working great so far.

If it succeeds at what's supposed to be x=1000, we don't trust this result and retry "Find Home". We can add say, if 3 retries fail, just believe x=1000 is now 0.

Now I got it. But having simple retries would probably not be enough. I'd rather like the bot to move to a preposition right before home just as you did in your sequence. If the motor stalls on the way to that position we will get an error message (maybe after a few retries).

AscendFB avatar Aug 12 '19 08:08 AscendFB

This leads us to, how to we get to this? I did some inspect html cutting and pasting to visualize.

Do you know where to find the code for the "Find home" sequence block?

amerkay avatar Aug 12 '19 08:08 amerkay

@amerkay It's in FarmBot OS here. Like most programming environments, the way that FarmBot OS converts CeleryScript nodes to executable code is somewhat complex. We might have time to do a write up if you are curious.

RickCarlino avatar Aug 12 '19 13:08 RickCarlino

Thanks @RickCarlino! Maybe when we try figuring out the wifi RTL8188 drivers, we can add some beta code to the branch.

For now, the sequence seems to have done the trick. But it seems like a bug during normal operation, that's why I reported.

amerkay avatar Aug 12 '19 21:08 amerkay