The Horus firmware is a program that allows you to control the stepper motors, laser modules and LDR analog sensors using G-code1 commands. It is compatible with Arduino2 based boards and the ZUM SCAN3 shield.
The firmware has been designed to control all physical elements of the Ciclop4 3D scanner, a rotating scanner based on laser triangulation. The base of the code is the Grbl5 project, a program that enables CNC machines to be controlled. It has also been used in other projects such as Marlin, the firmware for 3D printers.
The code has been published on Github, released under the GPLv3 licence6. This licence guarantees the fundamental freedoms associated with the use of open source software. Any code released under this licence automatically becomes part of the Technological Heritage of Humanity.
Compiling and loading
Different interfaces may be used to compile the Horus Firmware, such as de Arduino IDE7 and Sublime with the Stino8 plug-in, etc. These interfaces also allow you to load the compiled firmware in .hex format onto the microprocessor. Another way of loading the firmware is to directly use AVRDUDE9, or the most simple option is using the Horus software.
You can communicate with the board via USB or Bluetooth. There are different open source applications for establishing the connection, such as the Arduino Serial Monitor or CuteCom10. If the latter is used, you will need to select the device, adjust the baud rate to 115200 and set the command ending to LF or CR, ‘\n’ or ‘\r\n’, respectively.
After starting the serial communication, this will be the first message that Horus sends:
Horus 0.1 [‘$’ for help]
After each command is received, the software will answer with ok when the processing of that command ends, either correctly or with an error message. The communication flow is as follows:
→ G1 X360\r\n
The Horus firmware, due to its Grbl heritage, provides a configuring and monitoring interface which uses $ commands, as well as control commands in real time. All supported commands are described in the Grbl wiki.
Yu can also view the help menu on the available configuration commands by sending $:
$$ (view settings)
$# (view # parameters)
$G (view parser state)
$I (view build info)
$N (view startup blocks)
$x=value (save setting)
$Nx=line (save startup block)
$C (check gcode mode)
$X (kill alarm lock)
~ (cycle start)
! (feed hold)
? (current status)
As an example, the commands $110=v y $120=a, adjust the speed and maximum acceleration of the motors to v º/s and a º/s² respectively.
G-code is the most widely used programming language in numerical control devices (CNC). Milling machines, laser cutters and 3D printers use this de facto standard to communicate. Instructions are executed sequentially in this language. These are the G-code commands that have been integrated into Horus:
G1: Circular movement
G1 Fv Adjusts the rotational speed to v degrees per second
G1 Xd Moves the stepper motor to the position d defined in degrees
M0–M2: Pause and program end
M0 Pauses the program. It may only be restarted through the Cycle start (~) command
M2 Stops the program and resets it
M17–M18: Enable / Disable the stepper motors
M17 Enables the motors, maintaining their position. They stay enabled even after sending G1 commands
M18 Disables the stepper motors. They stay disabled even after sending G1 commands.
M50: LDR analog sensors reading
M50 Tv Reads the LDR sensor connected to pin v. Returns an integer between 0 and 1023
M70–M71: Laser modules turn on / off
M70 Tv Turns off the laser module v
M71 Tv Turns on the laser module v. After a four-minute timeout, the laser is turned off automatically
One of the future projects is adapting the firmware to new electronic boards and new processors. The purpose is to increase its functionality and define a standard communication interface, which guarantees compatibility with tools like Horus and derivatives.
Horus Firmware has been developed with simplicity in the structure and code in mind. For example, it contains just enough for controlling 3D scanners such as Ciclop, while easily enabling you to add functionality. As with all open source projects, we encourage you to contribute, improve and evolve this firmware and adapt it for new requirements and projects.
- G-code commands
- Arduino community
- ZUM SCAN power shield
- Ciclop open source 3D scanner
- Grbl CNC control software
- GPLv3 open source licence
- Arduino IDE
- Sublime Text IDE and Stino
- AVRDUDE programming software
- CuteCom communication interface