Polar graph controler that uses repetier firmware. Inspired by work at http://www.polargraph.co.uk
C C++ Processing Objective-C Makefile Scilab
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
PenPlotter
Repetier
ScreenShots
README.md

README.md

PenPlotter

PenPlotter controller that uses repetier firmware. Inspired by work at http://www.polargraph.co.uk

I built a plotter like the one described on the polargraph site. I thought it would be a good way to play around with stepper motor control. The software provided by the site worked great, but I wanted to play around with creating my own version to better understand the controls.

First I decided to use the repetier 3d printer control firmware https://github.com/repetier/Repetier-Firmware as a base. As I used this for the 3d Printer I built. It provides very smooth motor control with good path planning so the drawing is much smother. I modified the firmware to support the polar coordinates. The firmware uses standard gcodes with mm units, while the original controller uses a custom command set and native polar coordinates. So the original controller was not going to talk with the new firmware.

Next I wrote a simpler version of the controller that speaks gcode and uses mm units. Here is a list of some of the features of the controller.

Features

  • Supports Gcode files (.gcode, .cnc, .nc, .g, .gco)

    • Standard Gcodes G0, G1, G2, G3 are supported for movement.
    • Standard M340 and G4 are used for servo control and dwell (wait for servo to lift lower pen).
    • Standard M84 is used to disable motors
    • Custom Gcode M1 Y is used to set the home Y position in mm.
    • Custom Gcode M3 X Y P S E to plot a pixel.
      • X is delta x from last pixel
      • Y is delta y from last pixel
      • P is pixel size
      • S is shade
      • E is direction
    • Custom Gcode M4 X E S P to set the machine specs
      • X is machine width
      • E is pen Width
      • S is steps per rev
      • P is mm per Rev
    • When processing a gcode file the pen lift is triggered by the G0 gcode G1 will lower the pen
  • Supports SVG files (.svg)

    • When processing a SVG file disconnected paths trigger a pen lift.
    • The SVG paths are optimized to try and avoid needless moves.
    • The optimizer will auto join paths that touch.
    • The optimizer will remove very short lines in a path
    • Svg files can be scaled and rotated by multiples of 90 degrees
    • Svg files can be flipped about the X or Y axis
    • Export svg file to gcode
  • Supports Image files (.jpg, .png, .tga, .gif)

    • The image preview shows how the pixel size and pen width will affect the plot.
    • Images can be cropped, scaled and rotated by multiples of 90 degrees
    • Images can be flipped about the X or Y axis
    • Images can be plotted as pixels or in a crosee hatched style
  • The controller runs in processing 2 or processing 3

#Compiling The controller can be compiled in processing 2 or 3 just download the source files and open PenPlotter.pde in processing. The code is dependent of the controlP5 and geomerative libraries go to the processing sketch import library menu to import them before compiling.

The firmware is compiled using the arduino IDE. Download the code and load the Repitier.ino into arduino. I have only tested with the mega board with the ramps 1.4 shield. However repetier works with many boards so you may need to change the board type in the configuration.h file if you are using a different board.

WARNING I changed the X Y and ZAXIS_STEPS_PER_MM defines in the configuragion.h to 1mm as I do my own mm to polar conversion based on the machine specs described above so make sure if you change boards the setting remains at 1.

#Usage

  • Load the firmware on arduino board.
  • Make sure once loaded that you disconnect the arduino IDE before trying to connect the controller.
  • Edit the default.properties.txt file in the controller’s home directory and change the following settings to match your plotter. (Sorry I did not include the ability to change this in the GUI)
    • machine.motors.mmPerRev=80.0
    • machine.motors.stepsPerRev=6400.0
  • Launch the controller
  • Connect to the controller to the board using the connect menu (select the same com port the arduino ide was using)
  • Manually position the gondola over the home point and hit the set Home button to sync the controllers and plotters home location.
  • Load a file with the load button, the file extension determines the type so make sure it is one of the supported types
  • Adjust the scale
  • Hit the plot button to start plotting.
  • You can save any changes with the save button, all changes are saved to the defaults.properties.txt file

#Not so obvious GUI controls

  • There is a status line right under the connect menu that shows the last command sent to the plotter
  • The little blue circles at the top represent the motors and will go red when the motors are powered. Hit motor off button to idle the motors.
  • The little square control handles can be dragged to change the Y position and machine width and height
  • The gondola can be dragged around the page and the plotter will move to the new point.
  • You can adjust the placement of the plot on the page by dragging on the page canvas with the right mouse button down.
  • You can scale the page view with the scroll wheel
  • You can move the whole page by dragging with the scroll wheel pressed
  • You can crop an image with the green handles around the image frame

#Screen shots Here are some screen shots of the controler.

Svg Plot

Png Plot

Hatch Plot