MENU
7 HARDWARE PROGRAMMING
This machine requires of two motors that could be controlled with high precision and because of the physical arrangement of its pieces, it also requires that the motors connected to the dish and the printer belt should be able to rotate more than 360 degrees. There are two types of motors which can be controlled with high precision, and this are the stepper motor and the servo motor. However, only the former can be rotated more than 360 degrees. So, for this machine we used two stepper motors.
A stepper motor is a type of motor which turns by small steps defined by an arrangement of tooth on the rotor and the stator of the motor. Usually, the rotor and its tooth are polarized by a permanent magnet, while the stator and its tooth are polarized by coils. The advance of the motor depends on the polarization of the tooth on the stator; this means, it depends of the polarization of the coils on the stator; and thus, on the direction of current on each coil or equivalently on the voltage supplied on each terminal of the coil.
The difference of angle on each step are quite big (usually 1.8 degrees) and thus, the transition of steps is abrupt and noisy. Luckily, each step can be subdivided into smaller steps, giving a higher sensitivity of rotation and reducing the noise, by a method called micro-stepping, which consists on subdividing a step by controlling the amount of current on the coils.
For working with this motors, we have made use of gestalts nodes, which are electronics boards that has the necessary hardware for controlling four wired (bipolar) stepper motors by serial communication, and the framework pygestalt, for controlling this gestalt nodes. Each node is provided of a motor driver; which supplies voltage to the coils and does the micro-stepping; a differential bus transceiver, which deals with the rs485 serial comunication interface; a microcontroller, which receives and transmits orders coming from a computer to the motors; and a 5 volt voltage regulator, which energizes all the chipsets conforming the board.
While, the pygestal framework, it’s a set of libraries, implemented on python, which does the serial communication between the nodes and the pc, initialize the controllers by identifying the nodes connected on the net and calculates the kinematics of the motor based on some initial coordinates.
The development of the program that controls the movement of the machine was done with pygestalt framework. Luckly, the framework came with the xy_plotter.py example that worked with two motors, from the gestalt kit, that had screws. But since we didn’t need those screws on our motors, we had to work with our own motors and adjust the default configuration of the motors on that example to one that fits to our needs. Also, we needed that each motor moved independently instead of depending both on a pair of coordinates, like the ones in the example, so some extra code was added to this example for having independent control of the motors. Finally, we developed the logic of movement of the machine on code and once all the hardware was connected we made the machine work and found the correct configuration for the advance on the arc of the machine by trial and error.