i want my bot to move to the end of an axis and write the axis-length to variable. Any ideas how i could do this?
My aim is a sequence which do the following:
calibrate an axis
move to the end of an axis
write the axis-value in a variable
send the value to the log-console
repeat this 4-5 times
I want to have some values to calculate the variance of an axis. In the long-run I want to auto-calibrate all axis and only if the fault-tolerance decreased an fixed value I will continue with my sequences. Besides the winter is coming and i don’t want to remember how i have to calibrate my bot for the next year
Farmware? although interesting you have so much seasonal variation when you calibrate. Why not just set up an event to call a sequence to recalibrate more regularly?
@whitecaps thanks for your answer but I’ve heard that farmware will be obsoleted in the near future.
I’m a farmbot-newbie and building the bot was fun but calibrating wasn’t so i thought it would be nice to save my experiences in a sequence. Besides that the winter is coming so I will unmount the gantry from the tracks and next year i have to remember all the calibration-stuff.
@fafi I’m not sure I understand the question completely, so apologies ahead of time if I misunderstood. It seems that you are trying to reliably back up the length of the bot’s XYZ, is that correct?
Quick side note about Farmware: as you mention no one should be writing new farmware in 2020 and they will be deprecated soon. With that being said, you could just as easily use FarmBotJS, which has long term official support. Farmware is not the only way to write FarmBot code!
Use FarmBotJS. You will want to listen to the "legacy_status" event and record the bot’s x/y/z status to a Javascript variable. I’ve written a code snippet to help you get started. You can test the code from the Javascript console (ctrl + shift + j in Chrome).
Use the Import / Export feature. The Web App has the ability to import / export firmware settings. Please see the screenshots below. You will need to save the information in a text document somewhere safe (thumb drive, local desktop, Dropbox, etc…).
Use the SEND MESSAGE block. Send message allows reporting of XYZ values. I’ve attached an example screenshot below.
// ======= BEGIN SETUP
// If using the Javascript console at my.farm.bot,
// you can skip this step
import { Farmbot } from "farmbot";
// If using the Javascript console at my.farm.bot,
// you can skip this step.
//
// The `current_bot` variable is available at my.farm.bot for
// debugging and testing.
const current_bot = new Farmbot({ see_the_documentation: true });
// ======= END SETUP
// We will modify this variable later when the bot's location
// changes.
const xyz = { x: 0, y: 0, z: 0 };
// Every time the device updates its state,
// This function is called.
current_bot.on("legacy_status", (state) => {
const { x, y, z } = state.location_data.position;
xyz.x = x;
xyz.y = y;
xyz.z = z;
});
// Extend Axis X to the max.
// Log the results to the console.
// This would be a good place to write real application logic.
// Make sure you understand Javascript promises before proceeding.
current_bot
.moveRelative({ x: 0, y: 99999, z: 0 })
.then(() => console.log(`Y Axis @ ${xyz.y}`))
.catch(() => console.error("Movement failure?"));