Setting up encoders and calibrating axis

I have all the hardware set up (Farmbot 1.2 with OS 3.1.0) and I’m ready to start setting coordinates for tools and plants. I understand that the encoders are used so that farmbot always knows the exact position of the axis, correct? So there is no need to use end stops or some other form of calibration before each job, like on most 3D printers?

Setting up the encoders I see that encoders are set to ‘off’ by default in the web app. When I turn them on and try moving the axis using the relative motion controllers, I see that the registered millimeter position behaves strangely. When I use the relative motion controls without the encoders, I see the MM values increment as expected. As I increment by 10mm, I see the relative values increase to 10, 20, 30, etc. However, when the encoder is turned on, and I increment by 10mm, the recorded position shows numbers like 2, 6, then back to 0, in that order. What is going on here?

What is calibration used for in this process? Do I need to input the exact length of each axis or does calibration solve that?

Basically, what I’m asking for is a step-by-step guide for setting up the software for precise movement. I don’t see anything like this in the available documentation. Thanks!


I am just at the same point and with the same doubt as you. Additionally my z axis goes down with gravity when the machine is off. Does this happen to you as well?

No - and that doesn’t really make sense, seems like the friction would be too much…

It will absolutely move, depending on the weight of the tool you have in the head. Especially when water is in that hose. There’s no electronic lock/break and the drive is 1:1 at the motor and the threaded rod is not that high of a pitch. Once the Delrin is good and broken in and that rod is coated with it, it will turn real smooth and will drop on a power loss.

I actually measured the drop on my machine of 1-5 mm, even without water in the head. It might actually run all the way down with water in there, but I’m not ready to fill the hose with water yet :slight_smile:

We’ve been talking about this subject in another thread here: Documentation for using the web app -- setup

Regarding calibration and encoders: calibration info can be found in the documentation here. Support for rotary encoders is coming soon, some background info can be found here.

FarmBot can still move with millimeter accuracy without using rotary encoders, as is the case with 3D printers.

There is a topic about z-axis movement here.

Can Farmbot identify tools, plant seeds and water without the rotary encoders being calibrated? How is that setup?
The introduction video has it looking like you use the farm designer, sync, and it works automatically. I don’t see anything in Openfarm and the Farm designer that accomplishes that. I can do my own weeding for now. How do i get plants in the ground?

FarmBot can definitely move around and do all its functions (except auto-calibration) without rotary encoders, just like virtually all 3D printers and a lot of other CNC equipment. What rotary encoders do is provide “closed-loop feedback control” which allows us to detect when a motor is stalled either because FarmBot is jammed on something like a vining plant, or because it is at the end of its physical limits. So once we have the encoder support fully functioning at the firmware level, then FarmBot simply becomes more reliable (jam detection) and more automated (auto-calibration). Because right now if it gets stuck on something it won’t know it, and calibration to a Home position can only be done manually.

Manual calibration can be done by moving FarmBot by hand to the (0,0,0) position of your choice and then firing it up so that the firmware identifies that location as Home. Assuming FarmBot does not lose power or stall on anything, then it can operate without the encoders just fine for weeks on end, again like other CNC equipment without encoders.

As far as the introduction video goes: this is what we are working towards - a drag-and-drop experience where FarmBot does the rest. Though we have a ways to go before that is achieved. Right now the user needs to do a lot more configuration because FarmBot is still very much a platform for experimentation and finding out ways to do things rather than a plug-and-play consumer electronic. Sequences need to be made which dictate how FarmBot “plants a seed”, how FarmBot “waters”, and how FarmBot does any other operation. Then those Sequences need to be compiled into Regimens which describe how to take care of a plant or the garden over time. Eventually we hope to ship the software with built-in Sequences and Regimens which will come from OpenFarm as they are slowly crowdsourced from all FarmBot users. Though that is a ways off.

This is super cutting edge technology and it has a ways to go before our dream of FarmBot becoming a “home appliance” is realized. Thank you for helping us troubleshoot and work out the kinks as early adopters! What’s so exciting is how rapidly things are improving with our expanded team here at the company and with the whole community coming online to improve the docs, brainstorm here in the forum, test and contribute software, etc. :slight_smile:

Thanks, this all seems reasonable. I’ve been relying on the boot-up zeroed coordinates already, just wanted to make sure that was a reliable method for the moment.

Thanks for the feedback Rory. It’s good to know that a working Farmbot is possible. I was beginning to think that sequencing and regimens were still “under construction” as well. I don’t mind putting in the effort of building sequences. If I’m understanding you correctly, each plant needs its own sequence for each task and regimen? Documentation on setting up sequences and regimens for tasks like watering and planting would be very helpful. I’ll post any tips or tricks that I come across to help document sequencing. I look forward to the day when the Farmbot is plug and play.

Here are some helpful links to the software documentation (creation examples in each):

I appreciate it Gabriel. That will be very helpful.

hello actually i completed the mechanical and electronic assembly of the farmbot .When we open the web api the farmbot is working for just two minutes .After that it stops working and the arduino voltage regulator starts heating a lot .And One more thing .Actually we have not used encoders with NEMA 17 so will that be a problem .If we dont use encoders then should we edit the arduino code .If yes please tell me what to do .Please do reply as soon as possible as we have only 3 days to complete the project .Thankyou !!

Hey @Tejas
you probably expect an answer from Rory, but since you need a fast response I’ll try to help out as much as I can.

To your first Problem we could use more information like:

  • After that it stops working -> is it disconnecting in your webpage or just not moving anymore?
  • arduino voltage regulator starts heating a lot -> do you mean the Power Supply?
    Topics like this should be posted in the Hardware section to make it easier for other users.

To your question

Actually we have not used encoders with NEMA 17 so will that be a problem .If we dont use encoders then should we edit the arduino code.

You don’t necessarily need Encoders. You just don’t have the feature to track your moved distance then.
If you don’t use them, there is no need to change anything in the code of arduino or raspberry. You can simply deactivate the Encoder feature as seen in the Picture below (Summary).


1 Like

Is there an update on where you are now in the process you describe above? (thanks by the way for the explanation, makes sense!). I am particularly interested in the rotary encoder functionality.

If anyone has seen an update, please post link.

I’ve been trying to troubleshoot the rotary encoders for a while and FarmBot will not move (motors start but don’t move continuously) when I enable the encoders. It works fine with the encoders disabled. This is the first I’ve seen that the encoders might not be a usable feature yet at the firmware level. Thanks!

This is a very old thread, but the link posted above to the calibration and homing documentation still has information about the process.

Additionally, you can try checking your wiring or changing your settings as mentioned in these encoders troubleshooting tips.

If you search the forum for “encoders” and sort by date, you should find some more recent posts. If you don’t find an answer to your issues, please feel free to start a new topic.