Makeblock Designer Plotter

I learned about the Makeblock designer after his kickstart campaign ended . It’s a pity, because there was a chance to buy designer kits at a fairly low price. After a successful campaign, the authors continued to develop their ideas and created a set for the plotter -
The plotter interested me for two reasons: the ability to draw a
Delivery
The parcel arrived approximately two weeks after placing the order in the form of a heavy cardboard box tightly packed with details. Everything inside is in good condition, every detail is wrapped in some kind, but on one of the supporting frame structures I found an unpleasant dent, which, however, did not affect the functionality of the part.

Assembly
It took me at least 10 hours to assemble the plotter. The assembly plan is contained in a PDF document , where, step by step, the plotter takes on its form. For all the details of the instructions, sometimes it was necessary to disassemble and reassemble the individual blocks when it came to understanding their function. I recommend to run a few pages ahead when assembling.
Once stuck a screw in the sleeve. The fact is that the bushings are attached to the axis with small set screws without a hat. At the initial stage of assembly, it was not indicated that then these bushings must be shifted and aligned somewhere, so I tightened them well. Later it turned out that the screw was stuck - the screwdriver skidded and did not want to unscrew. By the way, the material of the supplied tools is the cheapest, metal is soft. I considered several solutions, from buying new parts to pulling a screw by screwing an even smaller left-hand screw. The provisions were saved by a screwdriver made of harder steel.

Mechanics
There are two stepper motors, one for each axis of movement. Using transmission belts, fixed by the ends on the platform, the rotation of the engine axis is converted into linear motion of the platform along the "rail".

pencil is rigidly attached to the bar, and the bar is mounted on the axis. The bar is divided by an axis into two shoulders - on one pencil, and on the other an elastic band is attached so that the bar presses the pencil on the paper. The “blade” of the servo-driver has two working positions: vertical, in which the “blade” raises the bar, preventing it from pressing the pencil to the paper, and horizontal, in which the “blade” does not prevent the bar from pressing the pencil to the paper.
Along the axis of the mounting strap there is a backlash, which leads to a "jitter" of the lines. I managed to remove it by adding an elastic band, pressing the bar to the platform.
Electronics
The board has 8 RJ25 ports through which the controllers of two stepper motors, a servo drive and four switches are connected in case the platform rests on the frame. Power for stepper motors is supplied separately through the supplied power supply with an American plug.

In theory, an increase in the number of microsteps improves the smoothness of lines and reduces noise, but also significantly reduces the torque of the engines. I tried to compare the quality of the resulting image depending on the number of microsteps:

As you can see from this picture, the best quality gives 1/8 and 1/4 steps. Further, it turned out that with a resolution of 1/8 step, one of the engines starts to slip and “lose” microsteps due to lack of torque. Increasing the current to maximum only slightly improved the situation, so the 1/4 step mode came out the winner. By the way, in microstep mode the engine is much less noisy!

Control
At the end of the assembly, the plotter control board must be programmed. The program implements the translation of the so-called G-code , in which the pencil movement commands are written in text form.
There are many editors for converting a vector image into G-code, but the authors recommend using the cross-platform and free Inkscape editor with the installed plug-in for generating G-code Gcodetools .
To send the plotter a G-code for execution, you need to connect to its control board via a USB cable and open a serial connection. For Windows it will be some kind of COM3 or COM4 port, for MacOS it will be something like /dev/tty.usbmodem1421
The designer’s authors wrote a Java program that opens a connection to the device and allows you to control the pencil using the arrow keys, set the position to zero, set the axis resolution and send the G-code written in the file. The program was originally designed for Windows, but after loading the desired library, it launches under MacOS.
I found that sometimes the connection to the plotter freezes, so I wrote a Python script for this case, which sends G-code directly through a serial connection. In this case, I use the Java program to set the starting point, then I run the script.
###############################################################################
import serial, re, time
import sys, argparse
SERIAL = "/dev/tty.usbmodem1421"
parser = argparse.ArgumentParser(description = "G-code file sender")
parser.add_argument("--input", help = "file to send", required = True)
args = vars(parser.parse_args())
###############################################################################
def send(stream, command):
if command[-1] != "\n": command += "\n"
sys.stdout.write("<= " + command)
stream.write(command)
while True:
s = stream.readline()
sys.stdout.write("=> " + s)
if s[0] != "#": break
fin = open(args["input"])
stream = serial.Serial(SERIAL, 115200)
send(stream, "$1 X8 Y12 Z21")
send(stream, "$2 X11 Y13 Z9")
send(stream, "$3 X22 Y19 Z22")
send(stream, "$4 X23 Y18 Z23")
send(stream, "$6 X88.0 Y88.0 Z40.0") # set axis resolution
send(stream, "G90")
send(stream, "G21")
for s in fin:
s = re.sub(r"\([^)]*\)", r"", s)
if s.strip(): send(stream, s.strip())
fin.close()
###############################################################################
long calculate_feedrate_delay(float feedrate)
{
//how long is our line length?
float distance = sqrt(delta_units.x*delta_units.x + delta_units.y*delta_units.y + delta_units.z*delta_units.z / 100.f);
...
}Result
When I was about to start the plotter to draw some visual pictures for this article, a serious malfunction was discovered: the lines of the drawing stopped converging with each other. It turned out that linear bearings scratched the furrows on the guide axles and began to slip from time to time. I suspected that the axles should be lubricated, but doubted, because there was not a word in the instructions about this. So, the plotter now requires repair and lubrication.
I ordered replacement bearings on eBay for $ 2.55 apiece, a total of six. The guide axes turned out to be much more expensive, because they were made by special order, but I decided not to change them, but crank them to move the furrows from the bearing paths.
The problem with slipping gave me the idea of controlling missed engine steps with a laser mouse. Judging by the articles found , this would be a very effective and beautiful way to solve the exact positioning of stepper motors.
Finishing the article, I still take the risk and draw a few drawings in a less accurate 1/2 step mode, without waiting for the components and lubrication. Images were taken with a liner with a line width of 0.3 mm


