WriterBot: build the attachment

In this project we will design a pen attachment for the standard Lego 'driving base' model. This will include a medium motor that will lower the pen onto the paper when appropriate, and lift it off the paper when not needed. The design will make the pen touch the paper at the midpoint between the wheels - this will make the code much easier to write because it means the pen tip will remain stationary when the robot turns on the spot.

I spent a number of hours designing a mechanism that can lower a pen into the ideal location, midway between the driving wheels, while maintaining compatibility with the standard Lego Driving Base model (also called the Educator Vehicle'). That means my pen mechanism is a simple add-on that can be attached to the Driving Base without dismantling the model. The trick was to have the pen held at an angle, as shown in the following photos (clickable):

I hope the above photos (and the accompanying video) are sufficiently detailed for you to recreate the attachments if you wish. My attachments work well with the felt tip pen shown but obviously might not work with a thicker pen - the pen must be able to slide up and down freely.

The lower attachment needs to be adjusted back and forth such that the pen touches the paper as close as possible to the midpoint between the wheels. As you can see in the last two photos, I used a folded orange paper 'shim' to help place the pen with precision. A good way to determine whether your pen needs to be further forward or further back is to have the robot turn 360° on the spot with the pen down. The command Motor.MoveSync("BC", 15, -15, 640, "True") should make the robot turn roughly 360° clockwise if you are using the Lego standard driving base model. A perfectly placed pen would draw a dot but in reality the pen will never be perfectly placed so it will draw a tiny circle. Watch the pen as is draws that circle - if it draws a clockwise circle then that means that the pen is too far forward and vice versa. Don't confuse the pen's motion with the robot's motion - it's perfectly possible that the pen will draw a counter-clockwise circle while the robot turns clockwise.

A medium motor attached to port A has an axle inserted and around this axle some cotton thread has been wrapped. The other end of the thread is taped to the midpoint of the pen. The motor is used to raise or lower the pen. In the raised position the pen should be about 3mm above the paper. You may find the following program helpful as you adjust the vertical position of the pen:

'You may have to reverse the motor speeds according to which

'way you wrapped the thread around the motor axle

While "True"  ' loop forever

  Buttons.Wait()

  mybutton=Buttons.GetClicks()

  If mybutton="U" Then

    Motor.Move("A",20,30,"True")

  ElseIf mybutton="D" Then

    Motor.Move("A",-20,30,"True")

  EndIf

EndWhile

I find it helpful to run this program from within the brick's menus. Don't forget to exit this program once you have adjusted the height of the pen tip. 

When the pen is lowered it is simply the weight of the pen that pushes down on the pen tip - it may be necessary to attach a weight to the pen (e.g. a metal nut wide enough to fit around the pen) in order to obtain the optimum force on the pen tip, though this was not necessary with the felt tip pen shown above (the brand is Stabilo). A ball-point (Biro) pen would have the advantage of not drying out but would certainly need more force on the pen tip than a felt tip pen would.

The design of my attachment is compatible with the use of a USB cable connection between the EV3 and the PC, though inserting the end of the cable into the EV3 is slightly awkward.

By the way, for my site ev3python.com I developed a much better drawing robot in which the pen is vertical. It can accommodate much thicker pens, like dry-erase markers, and there is no fiddly cotton thread to adjust.