Coder Social home page Coder Social logo

farmbot / farmbot-arduino-firmware Goto Github PK

View Code? Open in Web Editor NEW
393.0 62.0 194.0 1.21 MB

Arduino firmware that executes g-code like commands over a serial line to move the FarmBot and operate the tool mount

License: MIT License

C++ 77.05% C 15.68% Makefile 7.26%
farmbot

farmbot-arduino-firmware's Introduction

farmbot-arduino-firmware

This software is responsible for receiving G-Codes from the Raspberry Pi, executing them, and reporting back the results.

Technicals

Created with eclipseArduino V2 - For more details see http://www.baeyens.it/eclipse/

Development build instructions

This firmware is automatically bundled into FarmBot OS. The following instructions are for isolated Arduino development only.

NOTE: We tag releases when they are stable. The latest version (on main) is not guaranteed to be stable.

See releases to find a stable release.

OPTION A: For less stable "edge" version:

git clone  https://github.com/FarmBot/farmbot-arduino-firmware

OPTION B: For stable release v6.6.20:

git clone -b 'v6.6.20' --single-branch  https://github.com/FarmBot/farmbot-arduino-firmware

Options for compiling and uploading:

  • Arduino IDE:
    • Open farmbot-arduino-firmware/src/src.ino.
    • Select the Mega 2560 board in Tools > Board.
    • Uncomment only the desired board in src/Board.h.
    • To compile and flash the firmware onto the device:
      • Connect a device via USB.
      • Select Sketch > Upload or click the upload button.
    • To compile without flashing:
      • Select Sketch > Export compiled binary.
      • The .hex file will save to the src directory.
  • Make (Linux)
    • Download the Arduino 1.8.19 IDE and unpack to the /home directory.
    • cd farmbot-arduino-firmware
    • To compile:
      • make
      • .hex files for each board type will save to the bin directory.
  • VSCode
    • Set Arduino path and board type.
    • To compile and flash the firmware onto the device:
      • Connect a device via USB.
      • Select Arduino: Upload.

Software overview

All files are in /src

src.ino contains the setup() and main loop(). This is the main sequence:

     +--------------------------+
     |farmbot_arduino_controller|
     +-----------+--------------+
                 v
     +--------------------------+
     |Command                   |
     +-----------+--------------+
                 v
     +--------------------------+
     |GCodeProcessor            |
     +-----------+--------------+
                 v
     +--------------------------+
     |***Handler                |
     +-------+-----------+------+
             |           |
             |           |
             v           v
      +--------+   +-----------+
      |Movement|   | PinControl|
      +--------+   +-----------+

Board Feature Overview

board kit pin encoders SPI encoders SPI motors SPI stall detection peripheral current sensors
RAMPS_V14 Genesis v1.2 x
FARMDUINO_V10 Genesis v1.3 x
FARMDUINO_V14 Genesis v1.4 x
FARMDUINO_V30 Genesis v1.5 x x x
FARMDUINO_V32 Genesis v1.6 x x x
FARMDUINO_EXP_V20 Express v1.0 x x
FARMDUINO_EXP_V22 Express v1.1 x x

Codes used for communication

IMPORTANT

Farmbot will NOT move until the configuration has been approved. To approve manually, send F22 P2 V1 Q0

To move, use the command G00 X0 Y0 Z0 Q0 where you type in the coordinates just after X, Y and Z.

G-Codes

Codes sent to the arduino

Code type Number Parameters Function
G G-Code, the codes working the same as a 3D printer
G 00 X Y Z A B C Move to location at given speed for axis (don't have to be a straight line), in absolute coordinates
G 01 X Y Z A B C Move to location on a straight line (not implemented)
G 28 Move home all axis (Z, Y, X axis order)
F Farm commands, commands specially added for FarmBot
F 01 T Dose amount of water using time in millisecond (not implemented)
F 02 N Dose amount of water using flow meter that measures pulses (not implemented)
F 09 Reset emergency stop
F 11 Home X axis (find 0, 3 attempts) *
F 12 Home Y axis (find 0, 3 attempts) *
F 13 Home Z axis (find 0, 3 attempts) *
F 14 Calibrate X axis (measure length + find 0) *
F 15 Calibrate Y axis (measure length + find 0) *
F 16 Calibrate Z axis (measure length + find 0) *
F 20 List all parameters and value
F 21 P Read parameter
F 22 P V Write parameter
F 23 P V Update parameter (during calibration)
F 31 P Read status (not enabled)
F 32 P V Write status (not enabled)
F 41 P V M Set a value V on an arduino pin in mode M (digital=0/analog=1)
F 42 P M Read a value from an arduino pin P in mode M (digital=0/analog=1)
F 43 P M Set the I/O mode M (input=0/output=1) of a pin P in arduino
F 44 P V W T M Set the value V on an arduino pin P, wait for time T in milliseconds, set value W on the arduino pin P in mode M (digital=0/analog=1)
F 51 E P V Set a value on the tool mount with I2C (not implemented)
F 52 E P Read value from the tool mount with I2C (not implemented)
F 61 P V Set the servo on the pin P (only pins 4, 5, 6, and 11) to the requested angle V
F 81 Report end stop
F 82 Report current position
F 83 Report software version
F 84 X Y Z Set axis current position to zero (yes=1/no=0)
E Emergency stop
@ Movement abort

* Requires the use of encoders or end stops.

Codes received from the arduino

Code type Number Parameters Function
R Report messages
R 00 Idle
R 01 Current command started
R 02 Current command finished successfully
R 03 V Current command finished with error
R 04 Current command running
R 05 X Y Z Report motor/axis state
R 06 X Y Z Report calibration state during execution
R 07 Retry movement
R 08 Command echo
R 09 Command invalid
R 11 X axis homing complete
R 12 Y axis homing complete
R 13 Z axis homing complete
R 15 X Firmware used a different X coordinate than given in move command
R 16 Y Firmware used a different Y coordinate than given in move command
R 17 Z Firmware used a different Z coordinate than given in move command
R 20 Report all parameters complete
R 21 P V Report parameter value
R 23 P V Report updated parameter (during calibration)
R 31 P V Report status value (not enabled)
R 41 P V Report pin value
R 61 P V Report pin monitor analog value
R 71 X axis timeout
R 72 Y axis timeout
R 73 Z axis timeout
R 81 XA XB YA YB ZA ZB Report end stops
R 82 X Y Z Report current position
R 83 Report software version
R 84 X Y Z Report encoder position scaled
R 85 X Y Z Report encoder position raw
R 86 Report movement abort
R 87 Emergency lock
R 88 No config (see configuration approval)
R 89 U X V Y W Z Report # axis steps (U,V,W) and highest missed steps in last 500 (X,Y,Z)
R 99 Debug message

Error codes (R03)

Value Description
0 No error
1 Emergency stop
2 Timeout
3 Stall detected
4 Calibration error
5 Movement abort
14 Invalid command
15 No config
31 Stall detected X axis
32 Stall detected Y axis
33 Stall detected Z axis

Axis states (R05)

The state is reported for each axis individually, using the prefix X, Y or Z

Value Description
0 Idle
1 Starting motor
2 Accelerating
3 Cruising
4 Decelerating
5 Stopping motor
6 Crawling

Calibration states (R06)

The status for calibration is also reported for the axis that is calibrating

Value Description
0 Idle
1 Moving to home
2 Moving to end

Parameters for commands

Parameters Description Unit of Measurement
X X movement millimeters
Y Y movement millimeters
Z Z movement millimeters
A X speed steps/second
B Y speed steps/second
C Z speed steps/second
Q Queue number #
T Time seconds
N Number #
P Parameter/pin number #
V Value number #
W Secondary value #
E Element (in tool mount) #
M Mode (set pin mode) 0 = output / 1 = input
M Mode (read/write) 0 = digital / 1 = analog
XA End stop 1 on x axis 0/1
XB End stop 2 on x axis 0/1
YA End stop 1 on y axis 0/1
YB End stop 2 on y axis 0/1
ZA End stop 1 on z axis 0/1
ZB End stop 2 on z axis 0/1

Arduino parameter numbers

ID Name Unit Notes
2 PARAM_CONFIG_OK 0 / 1
3 PARAM_USE_EEPROM 0 / 1
4 PARAM_E_STOP_ON_MOV_ERR 0 / 1
5 PARAM_MOV_NR_RETRY integer
11 MOVEMENT_TIMEOUT_X seconds
12 MOVEMENT_TIMEOUT_Y seconds
13 MOVEMENT_TIMEOUT_Z seconds
15 MOVEMENT_KEEP_ACTIVE_X 0 / 1
16 MOVEMENT_KEEP_ACTIVE_Y 0 / 1
17 MOVEMENT_KEEP_ACTIVE_Z 0 / 1
18 MOVEMENT_HOME_AT_BOOT_X 0 / 1
19 MOVEMENT_HOME_AT_BOOT_Y 0 / 1
20 MOVEMENT_HOME_AT_BOOT_Z 0 / 1
21 MOVEMENT_INVERT_ENDPOINTS_X 0 / 1 switch ends
22 MOVEMENT_INVERT_ENDPOINTS_Y 0 / 1 switch ends
23 MOVEMENT_INVERT_ENDPOINTS_Z 0 / 1 switch ends
25 MOVEMENT_ENABLE_ENDPOINTS_X 0 / 1
26 MOVEMENT_ENABLE_ENDPOINTS_Y 0 / 1
27 MOVEMENT_ENABLE_ENDPOINTS_Z 0 / 1
31 MOVEMENT_INVERT_MOTOR_X 0 / 1
32 MOVEMENT_INVERT_MOTOR_Y 0 / 1
33 MOVEMENT_INVERT_MOTOR_Z 0 / 1
36 MOVEMENT_SECONDARY_MOTOR_X 0 / 1
37 MOVEMENT_SECONDARY_MOTOR_INVERT_X 0 / 1
41 MOVEMENT_STEPS_ACC_DEC_X steps
42 MOVEMENT_STEPS_ACC_DEC_Y steps
43 MOVEMENT_STEPS_ACC_DEC_Z steps (away from home)
44 MOVEMENT_STEPS_ACC_DEC_Z2 steps (toward home)
45 MOVEMENT_STOP_AT_HOME_X 0 / 1
46 MOVEMENT_STOP_AT_HOME_Y 0 / 1
47 MOVEMENT_STOP_AT_HOME_Z 0 / 1
51 MOVEMENT_HOME_UP_X 0 / 1
52 MOVEMENT_HOME_UP_Y 0 / 1
53 MOVEMENT_HOME_UP_Z 0 / 1
55 MOVEMENT_STEP_PER_MM_X steps
56 MOVEMENT_STEP_PER_MM_Y steps
57 MOVEMENT_STEP_PER_MM_Z steps
61 MOVEMENT_MIN_SPD_X steps/s
62 MOVEMENT_MIN_SPD_Y steps/s
63 MOVEMENT_MIN_SPD_Z steps/s (away from home)
64 MOVEMENT_MIN_SPD_Z2 steps/s (toward home)
65 MOVEMENT_HOME_SPD_X steps/s
66 MOVEMENT_HOME_SPD_Y steps/s
67 MOVEMENT_HOME_SPD_Z steps/s
71 MOVEMENT_MAX_SPD_X steps/s
72 MOVEMENT_MAX_SPD_Y steps/s
73 MOVEMENT_MAX_SPD_Z steps/s (away from home)
74 MOVEMENT_MAX_SPD_Z2 steps/s (toward home)
75 MOVEMENT_INVERT_2_ENDPOINTS_X 0 / 1 switch NO and NC
76 MOVEMENT_INVERT_2_ENDPOINTS_Y 0 / 1 switch NO and NC
77 MOVEMENT_INVERT_2_ENDPOINTS_Z 0 / 1 switch NO and NC
81 MOVEMENT_MOTOR_CURRENT_X milliamps TMC2130 only
82 MOVEMENT_MOTOR_CURRENT_Y milliamps TMC2130 only
83 MOVEMENT_MOTOR_CURRENT_Z milliamps TMC2130 only
85 MOVEMENT_STALL_SENSITIVITY_X integer -63 (high) to +63 (low), Express only
86 MOVEMENT_STALL_SENSITIVITY_Y integer -63 (high) to +63 (low), Express only
87 MOVEMENT_STALL_SENSITIVITY_Z integer -63 (high) to +63 (low), Express only
91 MOVEMENT_MICROSTEPS_X integer TMC2130 only
92 MOVEMENT_MICROSTEPS_Y integer TMC2130 only
93 MOVEMENT_MICROSTEPS_Z integer TMC2130 only
101 ENCODER_ENABLED_X 0 / 1 enables stall detection on Express
102 ENCODER_ENABLED_Y 0 / 1 enables stall detection on Express
103 ENCODER_ENABLED_Z 0 / 1 enables stall detection on Express
105 ENCODER_TYPE_X 0 differential channels disabled
106 ENCODER_TYPE_Y 0 differential channels disabled
107 ENCODER_TYPE_Z 0 differential channels disabled
111 ENCODER_MISSED_STEPS_MAX_X steps
112 ENCODER_MISSED_STEPS_MAX_Y steps
113 ENCODER_MISSED_STEPS_MAX_Z steps
115 ENCODER_SCALING_X integer 10000*motor/encoder (except Express)
116 ENCODER_SCALING_Y integer 10000*motor/encoder (except Express)
117 ENCODER_SCALING_Z integer 10000*motor/encoder (except Express)
121 ENCODER_MISSED_STEPS_DECAY_X steps 1-99
122 ENCODER_MISSED_STEPS_DECAY_Y steps 1-99
123 ENCODER_MISSED_STEPS_DECAY_Z steps 1-99
125 ENCODER_USE_FOR_POS_X 0 / 1 except Express
126 ENCODER_USE_FOR_POS_Y 0 / 1 except Express
127 ENCODER_USE_FOR_POS_Z 0 / 1 except Express
131 ENCODER_INVERT_X 0 / 1 except Express
132 ENCODER_INVERT_Y 0 / 1 except Express
133 ENCODER_INVERT_Z 0 / 1 except Express
141 MOVEMENT_AXIS_NR_STEPS_X steps 0 = limit disabled
142 MOVEMENT_AXIS_NR_STEPS_Y steps 0 = limit disabled
143 MOVEMENT_AXIS_NR_STEPS_Z steps 0 = limit disabled
145 MOVEMENT_STOP_AT_MAX_X 0 / 1
146 MOVEMENT_STOP_AT_MAX_Y 0 / 1
147 MOVEMENT_STOP_AT_MAX_Z 0 / 1
161 MOVEMENT_CALIBRATION_RETRY_X integer
162 MOVEMENT_CALIBRATION_RETRY_Y integer
163 MOVEMENT_CALIBRATION_RETRY_Z integer
165 MOVEMENT_AXIS_STEALTH_X 0 / 1
166 MOVEMENT_AXIS_STEALTH_Y 0 / 1
167 MOVEMENT_AXIS_STEALTH_Z 0 / 1
171 MOVEMENT_CALIBRATION_DEADZONE_X integer
172 MOVEMENT_CALIBRATION_DEADZONE_Y integer
173 MOVEMENT_CALIBRATION_DEADZONE_Z integer
175 MOVEMENT_CALIBRATION_RETRY_TOTAL_X integer
176 MOVEMENT_CALIBRATION_RETRY_TOTAL_Y integer
177 MOVEMENT_CALIBRATION_RETRY_TOTAL_Z integer
198 PIN_REPORT_1_PIN_NR integer reports every 500ms, 0 = disabled
199 PIN_REPORT_2_PIN_NR integer reports every 500ms, 0 = disabled
201 PIN_GUARD_1_PIN_NR integer
202 PIN_GUARD_1_TIME_OUT seconds
203 PIN_GUARD_1_ACTIVE_STATE 0 / 1
205 PIN_GUARD_2_PIN_NR integer
206 PIN_GUARD_2_TIME_OUT seconds
207 PIN_GUARD_2_ACTIVE_STATE 0 / 1
211 PIN_GUARD_3_PIN_NR integer
212 PIN_GUARD_3_TIME_OUT seconds
213 PIN_GUARD_3_ACTIVE_STATE 0 / 1
215 PIN_GUARD_4_PIN_NR integer
216 PIN_GUARD_4_TIME_OUT seconds
217 PIN_GUARD_4_ACTIVE_STATE 0 / 1
221 PIN_GUARD_5_PIN_NR integer
222 PIN_GUARD_5_TIME_OUT seconds
223 PIN_GUARD_5_ACTIVE_STATE 0 / 1

Pin Numbering

RAMPS 1.4 (for other boards, see /src/pins.h)

Tag Pin Nr Comment
X_STEP_PIN 54 X axis step signal
X_DIR_PIN 55 X axis direction choice
X_ENABLE_PIN 38 X axis enable
X_MIN_PIN 3 X axis end stop at home position
X_MAX_PIN 2 X axis end stop at far position
X_ENCDR_A 16 X axis encoder A channel
X_ENCDR_B 17 X axis encoder B channel
X_ENCDR_A_Q 31 X axis encoder A channel for quarature (not implemented)
X_ENCDR_B_Q 33 X axis encoder B channel for quarature (not implemented)
Y_STEP_PIN 60 Y axis step signal
Y_DIR_PIN 61 Y axis direction choice
Y_ENABLE_PIN 56 Y axis enable
Y_MIN_PIN 14 Y axis end stop at home position
Y_MAX_PIN 15 Y axis end stop at far position
Y_ENCDR_A 23 Y axis encoder A channel
Y_ENCDR_B 25 Y axis encoder B channel
Y_ENCDR_A_Q 35 Y axis encoder A channel for quarature (not implemented)
Y_ENCDR_B_Q 37 Y axis encoder B channel for quarature (not implemented)
Z_STEP_PIN 46 Z axis step signal
Z_DIR_PIN 48 Z axis direction choice
Z_ENABLE_PIN 62 Z axis enable
Z_MIN_PIN 18 Z axis end stop at home position
Z_MAX_PIN 19 Z axis end stop at far position
Z_ENCDR_A 27 Z axis encoder A channel
Z_ENCDR_B 29 Z axis encoder B channel
Z_ENCDR_A_Q 39 Z axis encoder A channel for quarature (not implemented)
Z_ENCDR_B_Q 41 Z axis encoder B channel for quarature (not implemented)
LED_PIN 13 on board LED
FAN_PIN 9 RAMPS board fan pin
HEATER_0_PIN 10 RAMPS board heating pin 0
HEATER_1_PIN 8 RAMPS board heating pin 1
SERVO_0_PIN 4 Servo motor 0 signal pin
SERVO_1_PIN 5 Servo motor 1 signal pin
SERVO_2_PIN 6 Servo motor 2 signal pin
SERVO_3_PIN 11 Servo motor 3 signal pin

Peripheral current sensor pins (Genesis v1.6)

peripheral peripheral pin current sensor pin
Lighting 7 A0 (D54)
Water 8 A1 (D55)
Vacuum 9 A4 (D58)
Peripheral 4 10 A3 (D57)
Peripheral 5 12 A2 (D56)
Rotary Tool Forward 2 A6 (D60)
Rotary Tool Reverse 3 A6 (D60)

farmbot-arduino-firmware's People

Contributors

connorrigby avatar gabrielburnworth avatar jsimmonds2 avatar kant avatar mattlech avatar rickcarlino avatar roryaronson avatar timevww avatar vaibhavgupta3110 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

farmbot-arduino-firmware's Issues

Build steps have changed.

I'm not sure what the build steps are doing, but it looke like:

wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python

Now drops a *.zip file into current directory, which must be extracted and CD'ed into before installation can continue.

Wont compile

It had a few issues when I first compiled. One was defining NULL and others were something about long ints? I had to change a few 0.0 to 0 to make it compile. Why was this?
I managed to make a few changes and now it compiles but I cant remember what I changed.

NTH? Support for one more axis? A?

In the cnc world there is support to make an extra axis ..

To make a rotary tool in a flat bed cnc for example..

Would it be possible to add an extra axis to make it possible to travel between beds in the future?

Im thinking a carrige or similar that moves the gountry to another bed..

Regards
Marcus

Z-movements don't work

The connection to my motor is good, the issue is that the Arduino doesn't seem to be sending any steps. This is what happens:

z=0
I send a command to move to z=1000
Pi receives the command
Bot does not move
Pi updates log with current location, which is still z=0

TMC2130 firmware support

  • Movements
  • Stall detection (Express)
  • Ability to use encoders (Genesis)
  • Tuning parameters (motor current, stall sensitivity, microstepping)

Error while performing ino build

I receive the following error when I issue "ino build"

~/working/farmbot-arduino-firmware$ ino build
Searching for Board description file (boards.txt) ... /usr/share/arduino/hardware/arduino/boards.txt
Searching for Arduino lib version file (version.txt) ... /usr/share/arduino/lib/version.txt
Detecting Arduino software version ... 1.0.5 (1:1.0.5+dfsg2-2)
Searching for Arduino core library ... /usr/share/arduino/hardware/arduino/cores/arduino
Searching for Arduino variants directory ... /usr/share/arduino/hardware/arduino/variants
Searching for Arduino standard libraries ... /usr/share/arduino/libraries
Searching for make ... /usr/share/arduino/hardware/tools/avr/bin/make
Searching for avr-gcc ... /usr/share/arduino/hardware/tools/avr/bin/avr-gcc
Searching for avr-g++ ... /usr/share/arduino/hardware/tools/avr/bin/avr-g++
Searching for avr-ar ... /usr/share/arduino/hardware/tools/avr/bin/avr-ar
Searching for avr-objcopy ... /usr/share/arduino/hardware/tools/avr/bin/avr-objcopy
src/src.ino
Searching for Arduino lib version file (version.txt) ... /usr/share/arduino/lib/version.txt
Detecting Arduino software version ... 1.0.5 (1:1.0.5+dfsg2-2)
Scanning dependencies of src
Scanning dependencies of arduino
Scanning dependencies of EEPROM
Scanning dependencies of Servo
src/CurrentState.cpp
src/F41Handler.cpp
src/ParameterList.cpp
src/TimerOne.cpp
src/F44Handler.cpp
src/F82Handler.cpp
src/PinGuardPin.cpp
In file included from src/ParameterList.h:6:0,
from src/PinGuardPin.h:17,
from src/PinGuardPin.cpp:2:
src/PinGuard.h:35:2: error: ‘PinGuardPin’ does not name a type
PinGuardPin pinGuardPin[5];
^
make: *** [.build/mega2560/src/PinGuardPin.o] Error 1
Make failed with code 2_

Soil Moisture sensor

ICP-10111.pdf

The new soil sensor has an ICP-10111 i2c device required to measure temperature and pressure.

New GCODES could look something like
F85 P<sensor type> for reading a sensor.
and
R85 P<sensor type> V<sensor value> for the report from the firmware.

Types would be:
0 - temperature
1 - pressure

We may also need to add new params for Celsius and Fahrenheit.

param name param number param value example
SENSOR_TEMPERATURE_UNITS 224 0 for Celsius 1 for Fahrenheit F22 P224 V0

read temperature ( Celsius )

F85 P0
R85 P0 V20.33

read pressure ( kpa?)

F85 P1
R85 P1 V101.35

I've only lightly tested the sensor but sending 0x68, 0x25 to i2c address 0x63 resulted in
2 bytes for temperature, 4-1 bytes for pressure.

bonus points

The sensor also exposes calibration values. Maybe we need to implement this as well?

3.0.3 Version Problem

Hi i install new release and bot connect and disconect every 1 sec to api(log devise online, offline)
Previos version work normaly but more unhandled errors in logs

Support G codes in mm

It seems like it would be nice if the G codes could be sent to the Arduino with the units in mm and for the Arduino to have a EEPROM stored configuration parameters with the conversion of mm to pulses with separate conversion factors for X, Y, and Z.

Perhaps I have just missed how this is all supposed to work as I am still getting up to speed on it.

How to use Steppers without Encoders?

I am developing this FarmBot and currently, I am buying the hardware parts. I will use Arduino Mega + RAMPS Shield + DRV8825, Drivers, instead of the Farmduino board, so any suggestion to use this Arduino+RAMPS combination???
I also want to know that can I skip the encoders and use the steppers in the open-loop mode. Would the FarmBot work without encoders?

Movements switch direction inadvertently

There is some weird stuff going on with the moments. Sometimes a command to move in one direction causes it to move a bit, then reverse for no reason, then move forward again. Its weird. Its like the direction pin on the RAMPS board is flipping inadvertently... This has been happening for a while, but I was never sure if it was weird stuff with the pi controller or the meshblu commands, etc. I think it has to do with the Arduino. Any ideas?

Verification of Tool Mounting

The Universal Tool Mounting System currently incorporates 4 electrical contacts (+12V, GND, and two for data from the Arduino [input or output]). These contacts connect with matching contacts on tools to support a variety of operations.

It will be important to verify that a tool has been mounted or dismounted correctly. This could be done by having an extra electrical contact that is an input to the Arduino. This extra connection could have a jumper on the tool to one of the data wires acting as a 5V output. When the tool is mounted, the extra contact will read 5V, when it is dismounted, it will read 0V.

Hmmm now that I think about it, we may not want a tool to become active (via the 5V on the data line) right when the tool is mounted. So maybe there should be two extra connections that are dedicated to detecting if tools are mounted?

What do you think @TimEvWw?

GetCodeEnum () is always equal to CODE_UNDEFINED

Hi,

We used the last stable version "Version 2.0.0 (Biennial Bignonia)" to use the serial debugging tool to test the send instruction is valid, but the latest code to compile will not work, do not know why?

We will open the code of the log, found getCodeEnum () is always equal to CODE_UNDEFINED, what is the reason?

thank you very much!

Arduino is going sloowwww

My commands seem to be delayed by 30+ seconds. I tried rebuilding everything (rpi controller first, then Arduino) I was then getting the problems that these folks are having, where I can't successfully upload the sketch to the Arduino due to a timeout error. If I try pressing the reset button a few times and immedietely try uploading after, then it sometimes completes, but it still operates very slowly...

By that forum thread, it may be a issue with the bootloader in the Arduino, a clean power source problem, an issue with avrdude, or an FTDI driver issue.

The only other thing I can think of is that maybe the EEPROM got filled up and is causing errors? Does the arduino-controller currently clear the EEPROM on boot? http://arduino.cc/en/Tutorial/EEPROMClear

Servo Support

Hi,

Did some research after our discussion in the comments last night.

Turns out that analogWrite cannot be used for servos, as the pulse widths and duty cycles are incompatible.

http://forum.arduino.cc/index.php/topic,5701.0.html

So I had a look around at how the merlin 3d printer firmware does it. They simply use the arduino servo library:

https://github.com/ErikZalm/Marlin/blob/Marlin_v1/Marlin/Marlin_main.cpp#L495

Servo servos[NUM_SERVOS];
servos[0].attach(SERVO0_PIN);

The Gcode they use is:

  • M280 - Position an RC Servo P S, ommit S to report back current angle

Do you reckon we can add this?

PS: What timers on the arduino are already used?

the stepper moved too slow?

hi my friend bought a farmbot genesis, and found it moved too slow, well, if we replace the builtin arduino board to another one, they will become extreming fast, but lost acurracy.

currently i tried connect to that arduino directly with my pc and send gcode and other commands via serial console. the problem is they just act too slow while using G00 and G01.

i tried to add a duplicate PORTF |= B00000001; in StepperControlAxis::setMotorStepWrite54 and it made the x axis moved faster twice, but it might not the a right solution, just need some technical expanation

F21/R21 broken

when i send F21 216 (the param id doesn't matter) it returns R21 P0 V1 (the P<id> part is always 0)

Arc support?

In standard g-code/CNC machines, there is usually support for arc commands that allow smooth circular movements. I think they're usually defined by a center coordinate and a radius.

This would be really nice for watering plants as they get bigger, in addition to watering at the center. Or for other operations such as weeding around a plant.

Motor X2 not working

Hello everyone,

my second motor on X-Axis is still not working at all. Using the newest firmware.
What I tried so far:

  • update via staging.farmbot.io
  • upload directly to arduino
  • versions a few commits earlier

Uploading the dual motor version of fluffy helps out, but i think it may be outdated since its from mid December.

Is there anything needed to be done manually to get the X2 motor running? Or is it just activated by default?

Also there are sometimes messages from arduino, just like this:
image
but they appear for every axis.

Calibration and Homing Improvements

Eliminate one leg of the journey

Currently, calibration is performed as: current position > find home > find max > go to home.

This should be changed to: current position > find max > find home. This will save time by eliminating one leg of the journey, which is significant for XL bots.

Touch the axis ends multiple times

Currently, both our calibration and homing sequences "touch" the axis ends just a single time before turning around to go find the other axis end or calling the sequence complete.

Most 3D printers touch their axis ends multiple times during calibration and homing to maintain high precision without sacrificing speed: They move at full speed until an axis end is touched the first time, then they back up about a centimeter, and then they move towards and touch the axis end a second time at a slower speed. We could do the same thing.

More importantly though than improving precision and speed, this change would reduce the risk of a premature or erroneous stall causing FarmBot to incorrectly set the home position or axis length.

I suggest the following for both calibration and homing sequences:

  1. Move forwards at max speed in search of an axis end
  2. Once the axis end is reached, back up 10mm at 20% of max speed
  3. Move forwards at 20% of max speed, expecting to find the axis end a second time in 10mm
    4a. Once the axis end is found the second time, turn around to find the other axis end (if calibrating) or call the homing sequence complete
    4b. If the axis end is not found a second time within, say, 12(?)mm, consider the first stall to have been a false axis end. Return to step 1.

This change would deprecate the Calibration Speed parameters in favor of max speed for the long legs and a percentage of max speed for the slower, second touches.

Change parameter units

Use microstep and steps per mm settings to calculate step and distance parameter values. This will allow the firmware to accept parameters in step and mm units and will require fewer changes to other parameters when microstep settings change.

Parameter old unit new unit
MOVEMENT_STEP_PER_MM microsteps per mm steps per mm
ENCODER_MISSED_STEPS_MAX microsteps steps
ENCODER_SCALING microsteps per encoder line steps per encoder line
ENCODER_MISSED_STEPS_DECAY microsteps steps
MOVEMENT_STEPS_ACC_DEC microsteps mm
MOVEMENT_MIN_SPD microsteps per second mm per second
MOVEMENT_HOME_SPEED microsteps per second mm per second
MOVEMENT_MAX_SPD microsteps per second mm per second
MOVEMENT_AXIS_NR_STEPS microsteps mm

[FEATURE REQUEST] Repository for Farmbot PCBs

As there aren't any repositories for PCB design thought it would be best to open an issue in the repository which is closest.

Having version-controlled based repository may help certain users which want to test and build the PCBs in order to improve or adapt them to weird edge cases to have a repository specifically for PCBs which contain the source files (EAGLE, KiCad etc) and the Gerbers. That way users can use tools like kitspace to easily order components based on the BOM and Gerbers.

Existing CAD models can be found here but think that having a repository for will improve the update and development of PCB based designs from the community and may simplify your workload as well - https://genesis.farm.bot/v1.5/Extras/cad

Example repositories which do this well
Open source e-reader - here
Open source filament diameter checker - here

Would love to get your thoughts on this and would be happy to generate the Kitspace files if given Gerbers and an electronics BOM if any of the component suppliers you use are integrated into Kitspace.

Bug reported by @fluffy on the forum

I saw that @fluffy reported this bug on the forum, but I thought this might be better discussed as a bug report rather than a general discussion. Here's the text of the post:

I went to https://my.farmbot.io/app/devices1 and changed the steps/mm from 500 to 2500. This seemed to send the system into and endless loops of bad GCodes. I just get a stead stream of errors on the the place on web where errors seem to go.

Any thoughts on what went wrong or ways to test it and log proper bugs?

An example of the errors look like

{
"id": 29092,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"Q0\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:58.968Z",
"updated_at": "2016-12-27T23:58:58.968Z"
},
{
"id": 29093,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"Command: F21 P62d wh ode: : : : : V W:: : : : ecmd Q:2\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:58.972Z",
"updated_at": "2016-12-27T23:58:58.972Z"
},
{
"id": 29094,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"denu - \n0112and:21 62 Q0\r,\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:58.976Z",
"updated_at": "2016-12-27T23:58:58.976Z"
},
{
"id": 29095,
"message": "Farmbot got a message from my arduino: Command with code: 121, X: 0.00, Y: 0.00, Z: 0.00, S: 0.00, P: 62, V: 0, W: 0, T: 0, E: 0, M: 0, Q: 0",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:58.982Z",
"updated_at": "2016-12-27T23:58:58.982Z"
},
{
"id": 29096,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"exec cmd Q: 0\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:58.989Z",
"updated_at": "2016-12-27T23:58:58.989Z"
},
{
"id": 29097,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"c2\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:58.992Z",
"updated_at": "2016-12-27T23:58:58.992Z"
},
{
"id": 29098,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"c3: 121\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:58.996Z",
"updated_at": "2016-12-27T23:58:58.996Z"
},
{
"id": 29099,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"code Enum C - 121\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:59.000Z",
"updated_at": "2016-12-27T23:58:59.000Z"
},
{
"id": 29100,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"Q0\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:59.003Z",
"updated_at": "2016-12-27T23:58:59.003Z"
},
{
"id": 29101,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"Command: F21 P63 Q0\r,\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:59.006Z",
"updated_at": "2016-12-27T23:58:59.006Z"
},
{
"id": 29102,
"message": "Farmbot got a message from my arduino: Command with code: 121, X: 0.00, Y: 0.00, Z: 0.00, S: 0.00, P: 63, V: 0, W: 0, T: 0, E: 0, M: 0, Q: 0",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:59.010Z",
"updated_at": "2016-12-27T23:58:59.010Z"
},
{
"id": 29103,
"message": "Farmbot got an unhandled gcode! {:unhandled_gcode, \"exec cmd Q: 0\"}",
"meta": {
"x": -1,
"y": -1,
"z": -1,
"type": "info"
},
"channels": [],
"device_id": 250,
"created_at": "2016-12-27T23:58:59.014Z",
"updated_at": "2016-12-27T23:58:59.014Z"
}

CC: @ConnorRigby

z-axis is moving due to its own weight

If z-axis is running smooth using high quality grease, the z-axis moves down due to gravity.

The stepper motors usually (CNC, 3d-printer) can be disabled and enabled. Have a look at http://reprap.org/wiki/G-code
In the disabled state, they can be moved freely, wherever in the enabled state, they are blocking. This seems to be a software issue as the enabled state should be the correct one. Several users are facing the issue in the Farmbot Europe community.

X2 Dont work

I use b7465ae-ramps_figure_edit
X2 dont work
only X1

farmbot-arduino-firmware - latest

the calibration?

Could you tell us what process takes place in the calibration?

Where to buy a new Farmduino?

Yesterday we found out that we will need a new Farmduino.

Searching for a solution about our Problem with getting our Farmbot started we got to this link:

https://forum.farmbot.org/t/message-broker-not-communicating-with-farmbot-failed-to-start-child-enoent/3127

There they are telling that you should buy a new Farmduino if you have such problems. Now I am searching for where to buy a new Farmduino. Maybe you can help me!
Will the new Farmduino be totally set up for using? Or this there further programming required?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.