13 Mar

Pycupi v-plotter control software

MakeBmth held its regular monthly meeting at Eagle Labs Bournemouth on Thursday 10th March 2016. We plan to meet there once a month (the second regular monthly meeting will be held at the Uni or under the new Hilton Hotel – check the meetup group or forum for details).

IMG_7035

We spent the evening learning about Brians Python port/rewrite of Gocupi, called Pycupi.

Pycupi (and Gocupi) is a cut down firmware that implements a command queue, stepper motor and servo control functions. Along with a control application written in Python (or ‘Go’ in Gocupis case). The who thing is meant to be run on a Raspberry Pi (though you could in theory run it on any computer).

IMG_7028

Pycupi does the image processing on the Raspberry Pi and can (currently) generate simulations (jpeg images) of the expected output or it can plot that using a suitable stepper controller. The firmware in the Pycupi github repository is currently configured to work with my Eggbot/Polargraph electronics.

IMG_7034

We learned about the multiple co-ordinate systems that are working together to produce a drawing.

Native: The co-ordinate system that works in motor steps.

System: The co-ordinate system that Pycupi maps to the native co-ordinates.

Image: The drawing co-ordinates which defines the drawing area.

We looked at how the native co-ordinates are not Polar (Angle and distance) but is a position triangulated based on the length of the two motor strings or chains. To calculate the position we need to know the machine width and how many mm of string or chain each step of the motor represents and finally a we need a reference or starting point (home).

coordinates

A bit of trigonometry gives us the lengths of the strings/chains for a given position.

IMG_7037

We looked at the different renderers currently avilalbe in Pycupi.

Spiral Arc: Renders an image using tiny spirals of varying size & density and the whole thing plots in on an Arc path from a corner (Defaults to top left (NW)).

renderSpiralArc(filename, x, y, image_width, pixel_size, drawing_object)

  • filename = the image to render (jpg/png/bmp)
  • x = the horizontal position of the top left of the image (bottom left if rotated)
  • y = the vertical position of the top left of the image (bottom left if rotated)
  • image_width = how many pixels wide the render should be
  • pixel_size = how big (in pixels) the spiral elements will be (bigger = less detail)
  • drawing_object = the python object you created to represent the machine

Norwegian Spiral: Renders an image using amplitude modulation along a spiral path from the centre of the image.

renderNorwegianSpiral(filename, x, y,image_width, density, maximum_density,pixel_size, drawing_object)

  • filename = the image to render (jpg/png/bmp)
  • x = the horizontal position of the top left of the image (bottom left if rotated)
  • y = the vertical position of the top left of the image (bottom left if rotated)
  • image_width = how many pixels wide the render should be
  • density = how densely packed the pixels will be
  • maximum_density = pixels will never be more densely packed than this (Need clarification on how these relate)
  • pixel_size = how big (in pixels) the spiral elements will be (bigger = less detail)
  • drawing_object = the python object you created to represent the machine

SVG: Draws vector images. Currently implements paths but not stroke or fill. Will cope with most elements of the SVG specification so it will happily draw curved paths.

renderSVG(filename, x, y, image_width, p)

  • filename = the vector image to render (svg)
  • x = the horizontal position of the top left of the image (bottom left if rotated)
  • y = the vertical position of the top left of the image (bottom left if rotated)
  • image_width = how many pixels wide the render should be
  • drawing_object = the python object you created to represent the machine

IMG_7032

A Kandinsky part way through rendering with multiple colour separations.

IMG_7029

The machine on the left is running Pycupi and has an example vector plot bottom right. The vector on the machine on the right was plotted with the Polargraph.co.uk software.