Tracey - Drawing Machine

7,766

55

52

Introduction: Tracey - Drawing Machine

This Instructable is a work in progress - we will work hard to make it an easier project but the initial drafts will require maker experience, 3d printing, parts assembly, electronic parts soldering, experience with the Arduino IDE etc

Feedback would be greatly appreciated, help to improve the steps and any issues that can be fixed.


Tracey is a servo based panto-graph drawing machine.

It consists of two main parts:

  • Controller board
  • Drawing mechanism assembly.

Once calibrated correctly Tracey can produce nice fun drawings, slightly shaky but this is the nature of the parts used.

There are different fun configurations that Tracey can be used in, some are listed below:

  • Pen on paper drawings. - we will focus on this mode in this Instructable
  • Laser drawing on wood / plastic - using small laser modules
  • UV LED drawing on glow in the dark paint.
  • Drawing on a Magna Doodle.
  • Object scanning with various sensors -infrared heat sensor, light sensors etc
  • Moving objects for games - experimental

The Controller Board:

The controller is based on the ESP8266: low-cost Wi-Fi microchip with full TCP/IP stack and microcontroller

The specific type used for this project is the WeMos D1 Mini, this type has a nice small form factor - other types could be used providing they have enough pin outs.

Using the ESP8266 means we can communicate with the machine using both a WiFi (Telnet) and a Serial interface.

Tracey has a Gcode interpreter and a GRBL interface so -at time of writing- the below software works:

LaserGRBL - this is a great piece of open source software, Tracey works with both Telnet and Serial. -Tracey pretends to be a laser engraver.

Easel - web based carving program, very nice. Set to x carve, x controller * -Tracey pretends to be a carver.

Universal Gcode Sender - Open source Java based GCode sender. *

There is also an Android App called Tracey App Beta, it sends drawings over WiFi -more on this later.

*There is also an upcoming Tracey-Link board to send the serial data from Easel and UGS to Tracey via telnet.

If you want to write you own programs to interface to Tracey, this is very easy too, everything about the interface is very open and all details will be explained.

The Drawing mechanism assembly:

The physical drawing machine consists of number of 3D printed parts and three mini servos along with some 3mm bearings and M3 screws.

Two servos are used for drawing and one is used for a lift mechanism.

The drawing servos should be of good quality, the lift servo should not - its resolution and accuracy are not important and it has to do a lot of work.

We have put a lot of work into keeping the 3D printed parts and assembly as simple as possible and they should be easy to print on any standard 3D printer.

Acknowledgments:

Barton Dring - this guy is a bit of a beast when it comes to drawing machines and controllers.

His blog entry on his Line-us clone was where I was introduced to the idea and it was extremely helpful.

http://www.buildlog.net/blog/2017/02/a-line-us-clo...

And of course, where it all started: the great Line-us

Its a great looking machine, very well designed and there seems to be a great community over there.

https://www.line-us.com/


Supplies:

ESP8266

Capacitors: 1 X 470uf , 1 X 0.1uf

Resistor: 1X 100 Ohm

Push Button

1 X LED

3 X 3mm M3 bolts - 8 mm long.
2 X 3mm M3 bolt - 20mm long

2 X 9G Servo Motor MG90S

1 X SG90 Micro Servo Motor 9G

3mm x 10mm x 4mm Bearings X 3

Tracey - 3D Parts

Step 1: The Controller Board Circuit

The first step should be building the controller board and verifying that all is working.

For very basic testing, you can just upload the code to a "raw" ESP8266 board.

The Circuit above is Tracey in its simplest configuration.

Note: The 5V screw terminal is if you decide to power the board from an external supply, if you decide to power the board through a USB power bank, the screw terminal can be left out - more about this later.

Step 2: Breadboard Circuit

The Breadboard circuit with servos, the power connector is optional.

An important note on powering Tracey, is that with the servos connected it is possible to power the device with a USB power bank, as they can usually supply about 1 Amp at around 5V.

Trying to power Tracey from a USB 1.0 or USB 2.0 port will not work reliably or not at all and could even cause damage to the USB port -although most ports have over current protection.

Powering from a dedicated USB hub that can supply 1 Amp per port should work OK.

Powering from a USB 3.0 port seems to work OK.

Step 3: Making Your Own Board

A bread board circuit is fine for testing and making sure everything works but you will need something more sturdy for serious use.

Making your own board is straight forward enough if you have some soldering experience, as the circuit is very simple.

Above photos are some old prototype boards I made -untidily- on strip-board, as you can see there is not much to it.

Also shown is a PCB I had manufactured, If there is enough interest I could distribute these.

Step 4: The Controller Board Code

Note: It is assumed that you have the correct USB driver installed on your PC for your ESP8266 board.

If you have experience with the Arduino IDE and have uploaded code to your ESP8266 board before, then all should be fine.

The code comes in the form of a bin file that is uploaded to the board using the esptool - the process that is used to upload compiled binary files from the Arduino IDE.

A Windows only program is included -with source- called TraceyUploader that makes this process very quick and easy.

Why are we not releasing the C source code? Well, we may release it in the future but at the moment it is too big, complex and going through too many changes, the bin file upload is a far simpler process.

Use the links below to download the binary file and the up-loader tool from Github - choose the "Clone or Download" button for both.

The Binary File

Tracey Uploader Tool

Download both and unpack. Place the Tracey.bin file in the TraceyUploader folder.

Plug your ESP8266 into your computer and wait until it connects.

Run the TraceyUploader.exe, the paths to the bin file and esptool should be correct.

Choose the COM port that your ESP8266 is connected to and click the "Build Bin File Command" button, you should get something like:

"C:\temp\Tracey-Uploader---Stand-Alone-master\TraceyUploader/esptool.exe" -vv -cd nodemcu -cb 115200 -cp COM10 -ca 0x00000 -cf "C:\temp\Tracey-Uploader---Stand-Alone-master\TraceyUploader/Tracey.bin"

in the text box.

Click on the "Send to Device" button, a command window should open and you can see the bin file being uploaded to the ESP8266.

Note: when uploading code using an USB 1.0 or USB 2.0 port the servos must be disconnected!

Using a powered USB hub or USB 3.0 seems to work OK.


Step 5: Testing the Controller Board - 1

Now that the Tracey.bin file has been uploaded to your board - the LED should start flashing after about 15-20 seconds, the slow flashing LED means that Tracey is in idle mode and ready for input.


Note: you can skip to the Connecting to WiFi step now if you don't want to connect using the serial port but the serial port is great for providing information and especially useful if you are having any issues.

You can connect up to Tracey right away by using a serial terminal program like Tera Term:

Tera Term

Install and choose Serial and pick your port -you should know this from the last step.

Navigate to serial setup and choose a 115200 baud rate.

You may need to reset your board after the above.

If all has gone well you should see the Screen in the next step:

Step 6: Testing the Controller Board - 2

Above is the serial output from Tracey on a first time run.

You will notice two things; it is warning that no calibration has been preformed and that it has failed to connect to Wifi, we will address both these things in the coming steps.

You can type a '%' to enter the Tracey help and configuration menus if you wish, there is a lot of info in there and all settings are explained.

Its important to note that Tracey runs "blind" or "open-loop" in that it receives no input from the real world about its drawing tasks, its just moves its drawing arms where it is told and it does this buy sending inputs to its three servos.

Because if this, without any drawing assembly connected Tracey can still receive drawings from the various programs listed above - this can be useful for basic testing.

Those with an oscilloscope and the interest could monitor the servo pins while a drawing is being sent to see the changing PWM signals.

Step 7: Testing the Controller Board - Connecting to WiFI

Note: If you don't plan on using WiFi it can be disabled in the help and configuration menu using the terminal program in the previous step. This will decrease boot up times.

Tracey uses WiFiManager, a library that sets the ESP up in station mode and allows WiFi credentials to be entered in a simple web interface.

To get Tracey in this mode you need to press the button (ground D5) for more than two second, the LED should flash twice in quick succession.

You should see an access point called: "Tracey WiFi Config" on the list of WiFi devices.

Connect to the access point and open a browser with URL: 192.168.4.1

Enter your WiFI credentials using the web interface.

Once this is done you should reboot/reset the controller board, you should now see that Tracey has connected to WiFi in the terminal, and the blue light in the ESP8266 should remain on.

Note: A phone or tablet is good for doing this, we have found the Firefox browser to be the most reliable.

Step 8: Testing the Controller Board - Testing WiFi With the App

Now WiFI is configured and Tracey is connected, lets do some testing.

We will start off with the most straight forward and easiest way, using the App..

The App is only for Android devices at the moment -sorry Apple people-, it can be installed here:


Tracey App Beta

As the title says it's in Beta so there is still work to be done, but it works quite well and is very useful.

Start he App and if all is working, it should display Services found:1 on the top left of the screen.

Press the connect button on the bottom right and you should get a menu with your Tracey device and its IP, select it

-the name of your device can be changed in the config menu, useful if you have more that one Tracey device-.

You should now have connection information on the top left.

Hit the Draw button and choose Screen to Tracey, the drawing on the screen will now be sent to your Tracey board, the LED should flash as it receives the different draw codes.

There is much more to say about the App but this is enough for testing purposes.


Step 9: Testing the Controller Board - Testing WiFi With Putty

To test the WiFi connection using a telnet client you can use Putty.

Download here:

Putty

To connect to Putty you will need to know the IP address of your Tracey controller board, below are some ways to find it:

  • Use the Tracey App in the previous step.
  • Open a command prompt on a Windows PC that is on the same WiFi network as Tracey and type "ping Tracey.local" -Note: if you have changes the name of your Tracey controller board you will have to use that name instead of Tracey.
  • View the output of the serial terminal on boot up
  • mDNS service discovery - details of this later on.

When you have the IP address choose a telnet connection for the session and enter the IP address.

Click on terminal and set local echo and local line editing to 'Force Off'

Open the connection and you should see the welcome screen.

You can press '%' to enter the help and config menu, here as with with the serial connection; settings can be changed and calibration preformed.


Step 10: LaserGRBL

I can't say enough good things about this program, its open source, has a ton of features and is being actively developed.

LaserGRBL

It will connect to Tracey using serial or Telnet.

It can convert pictures to Gcode using a variety of techniques, and they can be directly sent to Tracey or saved and sent using the Tracey App.

Its a great way to get started and is highly recommended.

Step 11: Putting Together the Drawing Assembly

Now that the controller is built and tested, lets get on with building the rest!

As stated at the beginning, The drawing assembly is mostly 3D parts along with 3 X 3mm bearings and a few M3 screws.


Print all the parts here:

3D Parts

Note: there are other builds that provide slightly better / cleaner pen down performance, this one was chosen because it is an easy print and build.

The next two steps are the most important of the build.

Step 12: Servo Arms and the Servo Horns

Note: this step will apply to both servo arms.

This is one of the most import steps in the build.

Snip the servo horn as shown in the pictures, make sure it fits in the servo arm, you may need to file the servo horn slightly.

You will super glue this part into the arm shortly.

It's important to make sure the sniped servo arm is straight / level -not necessarily flush- in the arm, if not the arm assembly will not be the same distance from the drawing area for all points and this will cause the pen not to draw in certain areas and is a real headache.

Hopefully I have explained it well enough for you to understand, basically when you insert the servo into the arm it should be level -perpendicular- to the servo in all positions.

Put a small bit of superglue around the hole on the servo arm and insert the servo horn.

A trick to make sure it's level is to quickly insert the servo after gluing and adjust if necessary.

Step 13: Attaching the Servo Arm to the Servo and First Calibration

Note: this step will apply to both servo arms, this step is for the top servo arm. - the long arm


This is another very important step and will involve the first calibration process.

Good calibration is key to good drawings, there are two calibration steps -first calibration and later on, precision calibration.

You can preform this step with a serial port connection (Tera Term) or a telnet connection (Putty).

Open a terminal connection to Tracey.

Press '%' to enter help and config

Press '4' for servos

press '3' for Top servo calibration

'a' and ;'d' are used for moving the servo, use 'a' to get to the lowest number where the servo still moves.

Insert the servo arm and get it it as close to 45 degrees from the body as possible -see the picture above.

The teeth on the servo and the servo horn will mean you might not be able to get it at exactly 45 degrees -use 'a' and 'd' to adjust it until it's exactly at the correct angle - a 45 degree set square will help greatly here.

Note: the servo minimum being at exactly 45 degrees is very import and a bit tricky,keep at it until you are happy that it is the correct angle.

Press 'o' to record the value.

Now press 'd' until the servo hits its maximum and stops moving, ideally this would be 180 degrees from the minimum but don't worry if it's not, press 'o' to record.

You should now see an array of calibration values and a minimum and maximum, press 'y' to save.

The servo is now calibrated with the servo arm, insert the locking screw.

Well done, this is probably to most difficult step. repeat the steps for the bottom -small-servo arm.


Note: there seems to be a bug, where after each calibration step the servos will not move for around 40 seconds when you go to the the next calibration - you may need to reset the controller for each calibration - this bug is on a list and will be addressed soon.

Update: This has been improved in V1.05, I thought it was gone but on one test it reappeared. Feedback from people who experience this bug would be welcome, its a very strange bug.

Step 14: Attaching the Cam to the Lift Servo and Calibration

This time the all parts need to be removed from the servo horn except the cylinder - this will be simplified in the future.

Clip off as much as you can and file the rough bits off, - see picture above.

Glue the cylinder into the cam - this step does not require you to be careful about leveling as in the previous steps.

The calibration in the step is much easier too:

Get to the lift servo calibration on a terminal -you should be able to do this from previous steps.

Press 'a' to get to a low value where the servo still moves.

Attach the servo cam to the servo so the cam nose is pointing straight out from the servo -see photo.

Press 'o' to record position.

Press 'd' until the nose of the cam is 90 degrees or above to the servo body.

Press 'o' and 'y' to save.

That's it for the lift servo, hopefully it went well, this step is very forgiving.

Step 15: Attaching the Servos to the Body + Base

From the picture above it should be clear where the servos are attached.

The wide thread screws that come with the servos should be screwed into the hole before hand to create threads - bit hard sometimes.

Attach the servos to the body.

Attach the base to the body using an M3 bolt equal to, or longer than 20mm

A trick here is to first screw the bolt into the body, then keep screwing until it starts slipping - bit nasty I know - this will make the body move more easily on the bolt.

Once the body and base are connected, keep working them both, the body should easily flop down and be firm in it's seated position.

Note: for this the lift servo cam should be 90 degrees or above from the servo. - the nose should be facing out or above facing out.

Step 16: ​Precision Calibration

This is the second and final calibration, it is for the top and bottom servos only.

It's very important and will help with the best drawings from your servos.

Use a terminal to enter the help and config menu.

Press '4' to enter the servo menu.

Press '5' to enter precision calibration.

The keys used here are a/d for moving the small arm and j/l for moving the long arm.

Carefully move the small arm until its at exactly 90 degrees left from the body and the long arm is pointing straight up.

Press 'o' to record the value.

Use the same keys but this time the long arm should be 90 degrees right from the body and the short arm should be straight up.

Press 'o' to record value and choose 'y' to save.

Step 17: Pen and Link Arm

Now that all the calibration has been preformed it's time to add the pen and link arms.

A note about the 3mm bearings- you should not go too cheap on these as the really cheap ones will have too much slop / play.

Two of the bearing should be inserted into the link arm by pushing them in, they should fit snugly.

One should be inserted in the long servo arm.

3 X 3mm M3 bolts - 8 mm long.

1 X 3mm M3 bolt - 20mm long - for locking the pen

Assemble as shown in the pictures.

Once fully assembled, send a few drawings without attaching the pen to make sure all is working as it should.

Note: if the bearing are too loose in the arms you could try a small bit of glue to secure them better - dont get glue on the inner workings of the bearings.

Step 18: Setting the Pen Height


Toggling the pen up and down can be done by pressing the button -for less than 2 seconds.

It's important to get the pen at a good height so it does not drag too much and not too high that is will not draw.

The pivoting body build helps here because if the pen is a bit too low the body will pivot and not put too much strain on the arms.

Step 19: Securing Tracey When Drawing

Currently, a good way to secure Tracey when drawing is with two small pieces of blue tack.

In this way, the paper can easily be replaced.

See picture above.

Step 20: Videos

Some videos of Tracey drawing in different modes.

Step 21: Gallery

Some drawings - anything on wood is done by a laser.

Step 22: List of Supported G Codes



G0 X50.5 Y14.7 Z0 - move to position 50.5,14.7 not in a straight line with pen up.

G1 X55.4 Y17.7 Z-0.5 - move to position 55.4,17.7 in a straight line with pen down.

G4 P2000 - Dwell - example waits for 2000 milliseconds

G20 - set units to inches

G21 - set units to millimeters- this is the default

G28 - move to home position (0,0)

M3 - Pen down, when 'laser no lift's is enabled this will set D8 to high

M4 - Pen down, when 'laser no lift's is enabled this will set D8 to high

M5 - Pen Up, when 'laser no lift's is enabled this will set D8 to low

M105 - Report battery voltage

M117 P10 - Set Interpolation points for linear drawing, 0 is Auto, play with this at your peril!

M121 P10 - Set draw speed, 12 is default, 0 is fastest possible, this can be set in the Tracey menu too. -value won't be saved.

M122 P10 - Set Move speed, 7 is default, 0 is fastest possible, this can be set in the Tracey menu too. -value won't be saved.

M142 -toggle laser no lift, when enabled the body will not preform a pen lift but will enable/disable D8 instead.The state will not be saved when rebooted, to save this state set it in the Gcode configuration menu.

2 People Made This Project!

Recommendations

  • The 1000th Contest

    The 1000th Contest
  • Battery Powered Contest

    Battery Powered Contest
  • Hand Tools Only Challenge

    Hand Tools Only Challenge

52 Discussions

0
TarsisP
TarsisP

Question 5 months ago on Step 22

Hello BitSand,

Once again, thanks for sharing this great project. Here comes a picture from the new design I am still working with low cost step motors 28bjy-48. I really would like to make it work with step motors, even with small NEMA 17. I would really appreciate if you could share the code for step motors. Any help is welcome.

Thanks very much!

Tracey_28bjy.jpg
0
ithinkido
ithinkido

Tip 9 months ago

When generating G-codes with any standard G-code generator for the Tracey app my images are always rotated 90deg when imported into the app. It looks like the X and Y axis is swopped in the app code. It would be great to be able to import the generated G-code directly without having to modify the orientation each time. Do you think it would be possible to change this in the app ? I guess it would also need to be changed in the Tracey firmware as it expects x=y and y=x at the moment. You can see this quite easily if you import the "TRACEY" logo G-code file from the app into any G-code visuliser.

tracey.png
0
BitSand
BitSand

Reply 5 months ago

Hi itninkido,

Thanks for the interest in the project and nice to see you using the app.

I will have a look at this, and add a swap function on the next release.

Best regards,

BitSand





0
ErwinM5
ErwinM5

10 months ago

These drawings are from BitSand, I do have a few questions
1: the owl looks okay, but it takes a long time because it is oversubscribed 2.3x, why?
2: 1337 same as above
3: E: M there is an error in it, I don't know why this is (maybe in the drawing itself)
4: Thingiverse, in my opinion okay one-time drawing so this went pretty fast (the drawing is a bit lightly drawn but that is because my pencil does not print very much on the paper
see also https://www.thingiverse.com/thing:3716151/comments
How you make this pictures please

DSC01966a.jpg
0
BitSand
BitSand

Reply 9 months ago

Hi Erwin,

I created some of the drawings using Easel -details above- its designed to be used with carving machines so the g-code it produces have a couple of passes, this can be useful if you are using a pencil on Tracey.

I mostly use LaserGBRL for creating g-code from pictures these days.

E=Mc2 probably failed because it was too big, its a good idea to load the drawings into the app and resize if needed.

Your drawings are actually very good, looks like you got good servos and preformed good calibration.

Well done.

0
oopfuture
oopfuture

1 year ago

Hi BitSand,
I found that all the servo arm hold is too small for the bearing to fill in. any idea?

0
BitSand
BitSand

Reply 1 year ago

Hi oopfuture,

I'm not sure what you mean, can you post some pictures?

thanks,

0
oopfuture
oopfuture

Reply 1 year ago

Hi BitSand,

Here is the pictures.

2019-09-03-21_46_35.JPG2019-09-03-21_46_57.JPG
0
BitSand
BitSand

Reply 1 year ago

Hi oopfuture,

That hole is for the servo horn, not the bearing.

If you look closely ate the instructable you should figure it out.

Regards

0
oopfuture
oopfuture

Reply 1 year ago

ok,I make some mistake. But it seems the other hole is too big for the 8mm bearing to insert.

2019-09-04-07_10_54.JPG
0
BitSand
BitSand

Reply 1 year ago

Hi,

Can you please measure the diameter of the bearing show in the picture and can you also measure the diameter of the hole in the printed part? Please measure in mm.

regards,

0
oopfuture
oopfuture

Reply 1 year ago

Hi BitSand,
the diameter of the hole is 10mm, and the bearing is 8mm.

0
BitSand
BitSand

Reply 1 year ago

Hi oopfuture,

I have uploaded two new files to Thingieverse:

https://www.thingiverse.com/thing:3716151/files

They are called:

Long_Servo_Arm_For_8mm_Bearings.stl
Link_Arm_For_8mm_Bearings.stl

Let me know how you get on with them.

Regards,

0
oopfuture
oopfuture

Reply 1 year ago

Hi BitSand,

I am almost done. I want to test now, but I use Mac, and the LaserGRBL can not work on Mac. can you send me some g-code file? I found a python lib can send g-code to the machine.

IMG_8561.jpegIMG_8562.jpeg
0
BitSand
BitSand

Reply 1 year ago

Hi oopfuture,

It looks great, well done.

I have uploaded some files here for your testing:

https://github.com/BitSandDev/Test-gCode-files

Please post some pictures if it works or let me know if you have any problems.

Regards,


0
oopfuture
oopfuture

Reply 1 year ago

Hi BitSand,

It works.

2019-09-08-02_56_20.JPG2019-09-08-02_57_06.JPG2019-09-08-02_58_15.JPG2019-09-08-03_01_09.JPG2019-09-08-03_01_32.JPG2019-09-08-03_02_06.JPG2019-09-08-03_02_32.JPG2019-09-08-03_03_43.JPG
0
BitSand
BitSand

Reply 1 year ago

Hi oopfuture,

Thanks for posting the pictures.

Its draws well and the lifts are very clean.

Have you preformed all the calibration steps?

When the drawing is skewed like that it usually means that all the calibration has not been done.

Regards,


0
BitSand
BitSand

Reply 1 year ago

Hi oopfuture,

I will make some STL files for servo arms with 8mm bearings and post a link here when done.

Hopefully it will be this evening.

Sorry for this mistake.

Regards,

0
BitSand
BitSand

Reply 1 year ago

Hi oopfuture,

apologies, a mistake was made with the bearing size, they should be 10 mm

I am going to change the instructable.

Do you have experience with 3D print design to make the arm hole smaller?

If not I will make an arm design with a 8mm hole.

regards,


0
oopfuture
oopfuture

Reply 1 year ago

no, i don't know how to change the STL file.