Dynamic map size

Hello,

Has anyone here got some experience with the new dynamic map size feature ?

To get it to work, one has to input a value in the axis length (step) field (device page/hardware panel),
and that should update the size of the map on the farm design page.
Problem is the field is js validated and allow only value <= 32000, practically limiting the maximum
size at 6.40 m. Has anyone found a way to overcome that limit ?

Also, a kind of related problem occur when one is trying to calibrate a bigger than 6.4 m farmbot,
value displayed in the axis length (step) field turns negative.

What would be best approach to let farmbotOS & webapp know about farmbot new size greater than 6,4 m ?

Thank you

Hey Jerome

found this in the nov-bundle[…].js :

The firmware will have an integer overflow if you don’t check this one. */\nvar MAX_INPUT = 32000;

It seems the farmduino is based on the atmega 2060 micro controller, which handle 16 bits at max (2^15, 32768) :

https://genesis.farmbot.io/docs/electronics-and-wiring#section-farmduino

Ha ok,

So it looks like the value is stored as sint16. But in farmduino source[0], one can read :

// Length of axis in steps. Zero means don't care
const long MOVEMENT_AXIS_NR_STEPS_X_DEFAULT = 0;
const long MOVEMENT_AXIS_NR_STEPS_Y_DEFAULT = 0;
const long MOVEMENT_AXIS_NR_STEPS_Z_DEFAULT = 0; 

As well in[1], one can read :

  long getX();
  long getY();
  long getZ();
  long *getPoint();
  void setX(long);
  void setY(long);
  void setZ(long);

Provided i looked at the right place (not sure about that), that code has no reason to throw an overflow,
as each axis actual and maximum value seems to be rightly defined as long, or int32.

I feel like i"m missing some bits. Maybe someone with more experience on the code base will chime in,
eventually.

[0] https://github.com/FarmBot/farmbot-arduino-firmware/blob/master/src/Config.h
[1] https://github.com/FarmBot/farmbot-arduino-firmware/blob/master/src/CurrentState.h

The maximum value allowed for axis length has been increased from 32000 to 2000000000 while using FarmBot OS v6.0.1.

1 Like

Hi Gabriel

Thanks for the info !