This is a scribing robot totally designed by myself. It uses 2 accurate stepper motors for elbow and shoulder. The wrist is made with a simple servo. The robot can use 2 tools : one pen and one eraser at the opposite of the pen. The font is a vector font 100% homemade. The robot writes from ASCII files. All design files (code) are provided, it is open source. Mbed repository : https://os.mbed.com/users/F4HDK/code/scribe_stepper_2/
The detailed description in inside 5 blog posts, 5 chapters:
Description of algorithm, from the bottom low level tasks to upper level tasks.
Pulses for stepper motor controllers are generated with interrupts. The function inside interrupts makes 3 things : it pulses the pulse output of the appropriate stepper motor controller; it updates the angular position of each motor (at each step); and it sets a timer for the next pulse interrupt, according to period requested by higher level task
it computes the period of pulses and direction of each stepper motor, with angle consign, and delay. These movements are executed at constant angular position. For most of the movements, this function is only used for very short distances : 1mm.
contains the reverse kinematics algorithm. For each 2D position (X, Y), it computes the angular position of each articulation.
Goto_2D_line and circle_2D :
decomposes the segment or arc requested into small segments of 1mm
for just one character, it reads its font definition, prints the character at the current character position with goto_2D_line and circle_2D, and update the next character position.
prints a character string, and manages line return (without word cut), and line clearing.
The font is a custom vector font. It is designed by myself.
Each character is made of one or several segments and/or arcs. The font is directly inside the source code. The code is available at the start page. It should be easily ported to another microcontroller.
The font definition format is also specific. Each character is defined with a series of one or several instructions. Each instruction can be followed by 1 or several parameter bytes.
X and Y positions refer to a 16x16 grid which contains the character.
2 : line up.
Starts from current position and moves to position X, Y, with pen up
X target position
Y target position
3 : line down.
Starts from current position and moves to position X, Y, with pen down.
The electronic part of this project is quite simple.
One Mbed microcontroller board, with LPC1789 (ARM Cortex M3)
2 x stepper motor controller boards “easy driver” from Sparkfun, equipped with A3967
A 5V switching regulator (for both wrist servo and microcontroller)
One potentiometer which value is read by microcontroller. The user can tune the movement speed with it.
One servo output for the wrist (servo signal is directly generated by GPIO from Mbed)
2 digital inputs for the end-stroke micro switch (needed because stepper motors do not know their absolute position)
The board I use is wire-wrapped, but you can use another solution.
The stepper motor controllers are quite powerful. For just a few dollars, you can have lots of features inside : bi-polar motor compatible, with H-bridge inside, without the need of freewheeling diodes, and optimised for thermal dissipation, with current regulation, and last but not least micro-steps. This greatly reduces the amount of code and the amount of electronic components, compared to stepper motor controllers which were available in the 90s.
The robot is powered with 24V, even if the motors are 12V. We can do it because the stepper motor controllers regulate the current they inject inside the motors. Higher voltage is necessary if you want to use stepper motors at quite high speeds.
The 2 main articulations (shoulder and elbow) are equipped with stepper motors. The transmission uses toothed belts and their pulleys.
These 2 articulations are very rigid. They are made with 3mm aluminium sheet, and braces made with cylindrical aluminium sections.
The articulations use ball bearing, exactly the same than these used on Lynxmotion articulations : 3mm inside and 8mm outside.
The gear ratio is 4.4 for both elbow and shoulder : 10 teeth on motor side, and 44 teeth on articulation side. The 2 motors are at fixed position, on the elbow. The goal is to limit inertia of the arm. Stepper motors are quite heavy compared to their torque.
To achieve this, the motor for the elbow is located on the axe of the shoulder. Therefore, the distance between shoulder and elbow articulations is determined by standard toothed belt lengths. All the dimensions are deduced from that.
Each of the 2 articulations (shoulder and elbow) allows more than 270° of travel. Therefore, we can reverse the shoulder like most SCARA robots. The goal is to use 2 different tools (pen and eraser) at each end of the pen and reach all the working area with these 2 tools.
The forearm and the wrist is made with lighter pieces, from Lynxmotion. We can tolerate more flexibility for these parts. And this part of the arm contributes a lot to inertia; therefore, we want to have lighter pieces.
The length of the forearm and the arm is exactly the same. For forearm, this length is the distance between elbow and tool. This greatly simplifies the reverse kinematics. Warning, the length of the forearm is measured between the elbow and the pen tip (not between elbow and wrist).
The wrist is made with a standard RC servo. This articulation does not require good precision or high torque, unlike elbow and shoulder. I have just added a Lynxmotion parts to reinforce this articulation, and mainly a ball bearing at the back of the servo, in order to limit clearance.