📜 ⬆️ ⬇️

Plotter based on the Makeblock constructor

Photo plotter

I learned about the Makeblock constructor after his kickstarter campaign ended. And it’s a pity, because there was a chance to purchase designer kits at a fairly low price. After a successful campaign, the authors continued to develop their ideas and created a plotter for the plotter - XY-Plotter Robot Kit v2.0 . It cost me $ 300 with free shipping via EMS as part of the "buy $ 500" promotion.

I was interested in the plotter for two reasons: the ability to draw with a pen Circuit Scribe with conductive ink and the ability to upgrade the plotter with a laser cutter . In this article I will tell about my impressions of the plotter in its original configuration.

Delivery


Delivery Details
The plotter is sold in the form of a set "collect it yourself." The weight of the package is a few kilograms, so delivery can be expensive. But I found the Chinese service Seeed , which, when ordered for $ 500, is sent free of charge via DHL / EMS. In addition to the plotter, I took from them a laser cutter, a Raspberry Pi, and a few shields for the Arduino , fitting into the indicated amount and convincing myself that in the future all this will definitely come in handy for me.
')
The package arrived about two weeks after placing the order in the form of a weighty and densely stuffed box of rough cardboard. Inside, everything is in good condition, every detail is in some kind of wrapper, but on one of the frame supporting structures I found an unpleasant dent, which, however, did not affect the functionality of the part.

Disassembled Makeblock Plotter

Assembly


It took me at least 10 hours to assemble a plotter. The build plan is contained in a PDF document where the plotter takes on its appearance step by step. With all the details of the instructions, sometimes it was necessary to disassemble and reassemble individual blocks when the understanding of their function came. I recommend when building run a few pages ahead.

Build issues
The holes in the aluminum parts of the designer are shifted within a millimeter from their intended position, which led to problems in those places in which parts were assembled end-to-end. I found two such places: right in the first step, when the screws fastening the frame, rested against each other; and when attaching the stepper motor controller board, which could not get along with the plotter leg. All this was solved, but in the place of the authors of the designer, I would not count on such accuracy in the shape of my parts.

Once screwed in the sleeve. The fact is that the sleeves are attached to the axis with small capless installation screws. At the initial stage of assembly, it was not indicated that then these bushings should be displaced and aligned somewhere, so I tightened them well. Later it turned out that the screw was stuck - the screwdriver slips and does not want to unscrew. By the way, the material of the attached tools is the cheapest, the metal is soft. I considered several solutions, from buying new items to pulling out a screw by twisting an even smaller left-handed screw. The position was saved by a screwdriver made of harder steel.

Short video about plotter assembly (from the Internet)


Assembled Makeblock Plotter

Mechanics


XY displacement principle
The working part of the plotter is a platform with a pencil, sliding along the guide axes. To understand how this platform moves, take another look at the photo above.

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

The principle of lowering and raising the pencil
I understood the principle of lowering and raising the pencil only at the end of the assembly:

Makeblock Plotter Pencil Platform

The pencil is rigidly attached to the bar, and the bar is attached to the axle. The plank is divided by an axis into two shoulders - on one pencil, and on the other an elastic band is attached so that the plank presses the pencil to the paper. The “blade” of a servo has two working positions: a vertical one, in which the “blade” raises the bar, preventing it from pressing the pencil against the paper, and a horizontal one, in which the “blade” does not prevent the bar from pressing the pencil against the paper.

There is a backlash along the axis of fastening of the strap, which leads to "shaking" of the lines. I managed to remove it by adding the gum that presses the bar to the platform.


Electronics


Electronic components and their connection
The control component of the plotter is a board based on the Arduino Leonardo . Its feature is built-in support for a USB connection to a computer. If Arduino is normally reset when a new serial connection with a computer is established, then the Arduino Leonardo saves its current state, which means you can connect to the plotter as many times as you like, keeping all the settings (first of all, zero in XY).

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 against the frame. Power for stepper motors is supplied separately through the supplied power supply with an American plug.

Electronic components of the Makeblock plotter

Search for optimal microstep engines
While writing this article, I unexpectedly discovered that the plotter requires adjusting two parameters of the controllers of the stepper motors: the number of microsteps per step and the amperage determining the torque. More about setting these parameters here , but not a word about this in the manual!

In theory, an increase in the number of microsteps improves the smoothness of the 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:

Comparison of micro steps in a step

As you can see from this picture, the best quality is 1/8 and 1/4 steps. Then it turned out that with a resolution of 1/8 step, one of the engines begins to slip and "lose" microsteps due to lack of torque. Increasing the current to the maximum only improved the situation slightly, so the 1/4 step mode was the winner. By the way, in the microstep mode the engine makes a lot less noise!

Comparison of micro steps in a step


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 commands for moving the pencil are written in text form.

There are many editors to convert a vector image into a G-code, but the authors recommend using the Inkscape cross-platform and free editor with the plugin installed to generate the G-code Gcodetools .

To send the G-code to the plotter for execution, you need to connect to its control board via a USB cable and open a serial connection. For Windows, this will be some COM3 or COM4 port, for MacOS this is something like /dev/tty.usbmodem1421

User interface
Makeblock plotter control user interface The authors of the constructor wrote a Java program that opens the connection with the device and allows you to control the pencil with the arrow keys, set the zero position, set the axial resolution and send the G code written in the file.

The program was originally designed for Windows, but after downloading the necessary library, it runs under MacOS.

I found that sometimes the connection to the plotter hangs, so I wrote a Python script for this case, sending the G-code directly through the serial connection. In this case, I use the Java program to set the starting point, then run the script.



Python 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() ############################################################################### 

Modification of the program
The program for the control board of the plotter perceives X, Y and Z as three axes, the movement along which is given in millimeters. But the fact is that the Z axis is actually set by the angle of rotation of the servo! In my case, 90 degrees means a lowered pencil, 60 degrees - raised. As a result, from the point of view of the program, raising and lowering a pencil takes as much time as drawing a line at (90 - 60) => 30 mm! The pencil goes down and waits, then draws a line, then rises and waits. Not only is the image drawn longer (as if 30 mm are added to each continuous path), but idle marker or liner on paper adds thick points at the beginning of the path. The program had to be modified by compressing the distances along the Z axis:

 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 launch the plotter to draw some visual pictures for this article, a serious fault was discovered: the lines of the drawing ceased to converge with each other. It turned out that linear bearings scratched the grooves on the guide axles and began to slip from time to time. I suspected that the axles should be lubricated, but I doubted, because there was not a word in the instructions about it. So, the plotter now requires repair and lubrication.

Grease selection and repair
Judging by this article, the best lubricant is Teflon-weighted oil. It is produced in the United States under the brand name Super Lube . In second place - synthetic gear oils (automotive?). Until the Teflon lubricant arrived, I tried domestic machine oil, but it didn’t help much.

I ordered replacement bearings on eBay for $ 2.55 apiece, six in total. The guide axles turned out to be much more expensive, since they were made by special order, but I decided not to change them, but to turn them in order to move the grooves from the bearing tracks.

The problem with the slip caused me to think about controlling the missed steps of the engine with a laser mouse. Judging by the articles found, this would be a very effective and beautiful way of solving the precise positioning of stepper motors.

Finishing the article, I still take the risk and draw several pictures in a less accurate 1/2 step mode, without waiting for the components and lubrication. Images are made with a liner with a line width of 0.3 mm

Comparison of a plotter drawing with a ruler

Sample plotter drawing: greeting

Sample plotter drawing: labyrinth

Source: https://habr.com/ru/post/247045/


All Articles