Since the ESP32 on the board is open for firmware download, first thing before playing with it, i got a backup of the stock firmware and calibration data (nvs partition) via esptool. I strongly recommend this to anyone who's going to play with it or use my custom scripts. They come without any warranty whatsoever. For a full firmware backup, you can use something like:
esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 460800 \
read_flash 0x0 0x1000000 esp32_full_16MB.bin
The stock firmware on my unit is "Marlin bugfix-2.0.x (Mar 30 2025 18:34:32)". You get this information by issuing a M115 command via serial terminal. Now we have a good starting point to look into the firmware, as we know the controller board and have access to the firmware sourcecode and binaries.
You find board information here: https://wiki.fysetc.com/docs/E4
And Marlin sourcecode here: https://github.com/MarlinFirmware/Marlin
The robot does use a customized version of the Marlin firmware, which we know through the custom g-codes used for controlling the modules or querying the encoder positions. Furthermore, the robot uses a custom geometry and internally maps the cartesian coordinate system of the 3D printing world to the robot movements. The nvs partition of the controller holds some calibration data, for example the home position of the robot. This one is really important, as it is the base for all the trajectory done by the firmware and it can be messed up easily by sending g-codes to the machine. This happened to me pretty quickly and i was happy to have my backup...
I found the custom g-codes pretty easily, because the official Huenit software has debug output turned on. So by starting it on the command line, you get the proper g-codes for all actions. Here are the most important ones:
M1400 A[0-1023] turn the vacuum suction module on or off, where A0 is off and A1023 is the strongest
M1008 A[0-3] query encoder positions in different formats 0-3
So the robot does have absolute position encoders built in, which we can use to home or train the robot or build closed loop control systems.
WARNING: Don't ever use the homing command G28. As the robot does not have limit switches, it will crash into its physical limits and in the worst case, break...
You can also use many of the official Marlin g-codes on the robot: https://marlinfw.org/meta/gcode/
That said, the first thing i wanted to do was obviously teach and replay movements by just physically moving the robot joints. This can be done in the official software, but it's a real pain. It's very slow and inefficient. So i wrote a little python script to do this quickly and easily from the command line:
https://github.com/piramja/huenit/blob/main/huenit_teach_replay.py
Also i created a script for direct jogging control:
https://github.com/piramja/huenit/blob/main/huenit_jog_control.py
Next step was some proper AI integration, object detection and manipulation. This is working pretty well and will soon be published here too...
piramja
Dan Royer
lukasz.iwaszkiewicz
Juan Miguel Jimeno
Shinya Ishikawa
Question: when you write "The robot itself is pretty flimsy and instable / inaccurate", do you mean "mechanically, from design or construction" or just because of the mediocre software?