Main controller AKA motion controller

A project log for Printing bones on a DIY powder bed 3d printer

This project focuses on using building a budget powder bed 3d printer capable of printing bones, and creating the needed ink and powder.

jureJure 05/11/2017 at 19:560 Comments

Today I have been focusing more on completing the firmware of main controller. It is nothing more than movement synchronization, zeroing and movement control algorithms. I am using STM32F103BC microcontroller (micro on the Maple Mini). It has ARM architecture with which I am not so experienced yet. This is why I am still having few problems with SPI communication and so forth. I have also started working with PlatformIO which is slowing me down a bit due to no experience. I have switched from Arduino IDE to PlatformIO, because it is more universal. If I am correct this could allow people to use their own microcontrollers with little or no tweaking at all. It also speeds the development process quite a bit with auto-complete.

The main controller will function more like command to action interface instead of being a GPIO like interface. This way it will get commands from SBC (probably beaglebone black), which will trigger some sort of action. Here is a list of commands that I will almost certainly implement:

Setting commands

I am still deciding on how I want zeroing and calibration to function. One of my Ideas is for main controller to cut power to servos but keep the encoders and servo controllers running. After that the controllers would be sent into calibration mode (via communication line or a pulse on specific input pin). Then one could just move the printhead in to print area zero position. After that main unit would receive the global coordinates of the print area zero position via I2C or some other communication. Second option which is a bit more makeshift is to cut power to the servos, move the printhead into position, reset the controllers and then power on the servos.

Single pass or layer printing function will probably function so that the printhead moves in to desired position. After that the controller will enter the pulse to move mode. This will be done using interrupts, so I will be able to achieve high speeds (hopefully somewhere around the max speed of the printhead). It will function so it moves to next position (set by resolution settings) after receiving a pulse from printhead controller. Then the interrupt would be attached for new pulse. I am still deciding on how I want main controller and printhead controller to talk to each other. I as settling on the idea of having three lines: