Survey
Here are some projects that can be referenced for designing an embedded control system.
Motor Controllers
SimpleFOC
Simple framework based on Arduino that emphasize on simplicity. Motor is controled in a while loop that;
First acquires sensor data such as phase current from ADC or position/speed sensor.
Then caculates the PWM duty cycles.
Finally, applies the PWM duty cycles to each phase.
References
ST Motor Workbench
Hardware timer-driven system where time-critical tasks are executed in ISRs and utilizes Cortex-M’s NVIC to have preemptible interrupts with priorities. Since the hardware is optimized for motor control (specialized timer for three phase PWM), so the software can be simple.
References
Spinner
Motor controller based on Zephyr as a proof of concept project.
For STM32 implementation (currently the only one available), it uses Zephyr’s Direct ISR for;
PWM duty cycle is calcuated and set in the current sampling loop [3].
References
Vechicle Controllers
CogniPilot - Cerebri
Vehicle management unit based on Zephyr for autonomous vehicles.
It is publisher / subscriber model similar to ROS.
References
Flight Controllers
ArduPilot

References
PX4
References
3D Printers
Marlin
Kilpper
Other Zephyr projects
List of Zephyr applications and frameworks: awesome Zephyr
Some popular Zephyr projects: