1.2 Proposed Platform
The platform is intended to be fully open-source
and open-hardware to remain maintained and tech-
nologically sustainable. A large number of commu-
nication interfaces are also required for communi-
cating with sensors, interfacing with the microcon-
troller and logging purposes, such as Ethernet, I
2
C,
SPI, USB, CAN, etc., as well as functional parts
such as Pulse Width Modulation, Analog-to-Digital
Converter and Timer peripherals for the specific de-
sign of field oriented control BLDC/PMSM drives.
The generated code adds computational overhead, so
a microcontroller with a powerful core is required.
The main focus is on the control of PMSM/BLDC,
Stepper (even with feedback sensors), and Brushed
DC motors. However, the platform can also be used
for special actuators e.g. using inverse piezoelectric
effect and others in mechatronics (Gao et al., 2020).
We require the controller to be able to drive
at least two stepper motors, therefore eight control-
lable phases are needed. Eight phases are also enough
for BLDC/PMSM motors with more than three
phases. With a higher number of phases, a utilised
motor can be still operated when one or more phases
are failed. For these advantages, the multi-phase
BLDC motor is taken a good candidate for energy
saving or military application (Moon et al., 2015).
The controller is intended as a generic prototyping
platform with a large number of interfaces, the size
and weight are not a matter. If the control algorithms
are designed and verified on this platform, the hard-
ware can be redesigned to fit certain criteria, such
as size, weight, safety-critical, or space compliance,
keeping the same algorithms. Despite all the pro-
posed features, we strive for an affordable solution
within motion controllers such as ODrive controllers.
Finally, to make the generated code portable
across various platforms, a Real-Time Operating
System (RTOS) is considered. It provides a run-
time environment for multithreaded applications, net-
work stacks and a unified API for accessing hard-
ware dependent peripherals. In this paper, NuttX
RTOS is selected as a suitable OS. Furthermore,
as an experimental but open source code genera-
tion tool, pysimCoder is used, capable of generating
NuttX-compatible code from block diagrams and re-
motely tuning its internal parameters over the network
via the Silicon Heaven protocol (Lenc et al., 2023).
The paper is organised as follows. Hardware
and its implementation are in Sections 2 and 3. Then,
the hardware adaptation to NuttX is described along-
side the pysimCoder suite in Section 4. Finally,
the pysimCoder applications are shown in Section 5.
2 HARDWARE SPECIFICATION
Hardware (HW) design is inspired by the LX-RoCon
controller (PiKRON, 2014). One of the design rules
is to divide the motion controller into a Micro-
Controller Unit (MCU) board and a Power stage
board as two printed circuit boards. The complete
motion control unit then comprises of these two con-
nected boards.
This design rule allows to swap the less complex
Power stage board for a different one while keep-
ing the more complex MCU board the same. Since
the MCU board accommodates most of the used
connectors, it is placed above the power board.
The power board acts as the 5 V voltage source
for the MCU board as well.
2.1 Hardware Analysis
To design and specify motion control unit, a basis
for selecting a micro-controller, the intended periph-
erals and their use cases were summarised as fol-
lows: TTL UART for Simple console user inter-
face; RS232, RS422 or RS485 for Communication
with other devices, sensor data acquisition; (Q)SPI
for Ext. SPI memory, sensor data acquisition; I
2
C
for Ext. I
2
C memory, sensor data acquisition; Counter
for position measurement from quadrature encoders;
JTAG or SWD for program flashing and debugging;
CAN for communication with other devices; Eth-
ernet for data logging, remote access, pysimCoder
parameter tuning; SD slot for data logging; PWMs
for Control of power switches; ADCs for current
measurement for motor field oriented control (FOC)
and GPIOs for reading from hall sensors.
The motion controller should be capable of driv-
ing at least two stepper motors simultaneously since
we require the unit to be used for SCARA-like
or Cartesian robot topologies and axles with two in-
dependently driven wheels.
Since a stepper motor requires 4 half-bridge
switches, 8 half-bridge switches in total are re-
quired. BLDC/PMSM requires 3 half-bridge switches
to be controlled and a DC brushed motor requires
2 half-bridge switches (forming a H-bridge). Choos-
ing 8 half-bridge switches is enough for controlling
2 BLDC/PMSM and 4 DC brushed motors as well.
Furthermore, at least 8 PWM outputs for power
switches and at least 8 ADC channels for current mea-
surement are necessary with two counter peripherals
for encoder pulse counting and all the communica-
tion interfaces in paragraph above. Finally, all compo-
nents should operate in industrial temperature range
of at least −40 to 85
◦
C.
ICINCO 2024 - 21st International Conference on Informatics in Control, Automation and Robotics
580