Home > Mindstorms > Mindstorms Pen Plotter

Mindstorms Pen Plotter

August 18th, 2023 Leave a comment Go to comments


My first pen plotter project inspired by the classic LEGO Technic Control Center set.  

Datasheet:

Completion date: 10/08/2023
Power: electric (Mindstorms brick)
Language: Scratch
Bricks: 1
Motors: 1 x Spike Prime S, 3 x Spike Prime M
Sensors: none

The classic 8094 LEGO Technic Control Center set from 1990 was one of the coolest contraptions I could feast my eyes upon while browsing LEGO catalogs as a kid. I have long wanted to build a programmable pen plotter of my own design, but I was concerned that the standard LEGO worm gears and gear racks had too much play in them to offer truly satisfactory precision. This has changed with the arrival of the new type of a LEGO worm gear, which I found to be unusually tight-fitting and precise with the special brick it’s designed to move. So, I’ve decided to put this gear to use in a plotter built for a single purpose: being able to write any text.

The plotter was mechanically simple, with one transverse slider moved on two longitudinal sliders that were not mechanically synchronized but simply controlled by two motors running simultaneously. Thus it took three motors to move the plotter, which made things complicated on the software side. A fourth, small motor, was responsible for raising and lowering the pen using a linkage similar to a Scotch yoke.

The software would take a text input and analyze it character by character, running each character through a switch statement that would perform a different set of instructions for different characters. I have initially attempted to draw curves and rounded edges, but I found that Mindstorms motors struggle with moving by just a few degrees and stopping, and that the LEGO gel pen I was using would spill ink into the paper if it was moved very slowly. So I settled for letters of simple shapes that would be drawn one by one, with the plotter also handling spaces and line breaks. It worked, but not perfectly, as there was a certain amount of tension that would sometimes prevent the pen from exactly moving as intended, and I also found that returning to the beginning of a new line by detecting when a motor moving the pen stalls was unreliable, because it kept detecting stalls prematurely, long before the motor reached the end of its range of movement.

I have initially programmed the plotter in Python, but found it insufficient in running more than two motors simultaneously. So I eventually programmed the plotter using Switch and having several threads running at the same time and being activated by changes of global variables. When one thread changed a variable, another would react e.g. by moving a motor, then reset that variable back to the original value. It worked reasonably well but I found that multiple threads apparently didn’t always run in perfect sync, so diagonal lines would often be drawn skewed. It was a software issue that I found no solution to.

To sum up, the plotter was quite simple and plagued by a number of problems, but it was a good first lesson for me and it performed its essential goal.

Photos:

IMG_1115.JPG IMG_1117.JPG IMG_1118.JPG IMG_1121.JPG

Video:

Categories: Mindstorms Tags:
  1. No comments yet.
  1. No trackbacks yet.