Cam-Driven Plotter
Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.
Zapisane na tym urządzeniu.
Informacje o modelu
- Źródło
- Printables
- Kategoria
- Other Art & Designs
- Licencja
- Creative Commons — Attribution — Share Alike
First: A Warning
This plotter was designed for a specific event, as it is the only thing it can draw is “BS5” so if you want it to do anything else you will have to make the cams and you should not assume that this will be easy
If you think you want to make this please ensure that you can run the entire software process and make your own cam design before you do anything else. I'm sharing the process as a starting point for others, not as a full, ready-to-go project
At all points this description will assume you know Inkscape, OpenSCAD and Processing fairly well and I'm not kidding, this is not a mature tool chain: it will be annoying to follow and unless you follow it the plotter might not be that much use
How it works
The plotter is a parallelogram arm that is fixed to two cam followers. These rotate the arm assembly and change its shape to follow the path that's programmed into the cams. Two cams are needed to control the two dimensions over a piece of paper. This is a similar kinematic to the line-us plotter although this is electronically controlled and this mechanically programmed
There's no way to have the pen lift from the paper at the moment so everything from now will assume that you want it to draw a single closed shape
Making the Cams
The cams are designed in a set of Processing sketches that are used in conjunction with Inkscape and OpenSCAD (with a bit of post processing in Prusa Slicer or similar).
This involves finding a set of points that define the shape to draw and running an inverse kinematic to come from the pen position to the two cam follower angles. These cam follower positions are then used to cut out the shape of the cams
The Processing code is very rough, has no error traps and was used about three times by me so please don't expect them to work well (or perhaps at all)
The very rough process flow is shown:
Inkscape
- Make (or trace) a shape in Inkscape that you think you'd like to draw - unfortunately it can't be too detailed and you won't know what's too detailed until you make the cams and find this out (like I did with my first shape): to make the cams easier to turn I used bearings as cam followers and because they are quite large this limits the sharpness of the shapes that can be made so keep them simple
- If there are separate shapes they will need to be joined with bridges, use union or difference to join the shapes and the bridges
- Take your processed shape into another document, resize the shape until it's about 60mm wide and probably no more than 40mm high - this will probably work but you will need to check that the cams are the right shape to work in the plotter
- Resize the document to the size of the shape (in document properties)
- Remove any layers: cut the shape, delete any layers, paste the shape in place to get it back
- Approximate curves with straight lines: use the function in
extensions > modify path - Add more points using the node tool until they are approximately evenly distributed around the shape - lines should probably be a max of 5-7mm long between nodes, even on straight lines
- Processing won't like it if there are exponents in any of the points so once you have your final shape select it and use
edit > XML Editor, find the line representing your curve and click again - In the new window select all of the lines and click the button after choosing the highest number of decimal places “N.NNNNN”, you should see that any numbers that were shown as something like 9.2e-4 will start 0.0…
- Save the SVG file
Processing
Unzip all sketches and copy them into your sketchbook folder, open them in the Processing interface - please note that this is the Java interface, p5.js or the other modes will not work. All sketches were written in Processing 4.3 under Linux Mint but newer and/or Windows versions should work the same way, older versions of Processing might work
Processing: svgPoints
This sketch converts the SVG file into a list of points and saves as a text file
- Copy the SVG file you saved above into the
datafolder of thesvgPointssketch - Open the sketch in the Processing interface and edit the line
String fileIn = "bs5only.svg";you will need to change the string from “bs5only.svg” to whatever your file is called - If you wish you can also edit the
fileOutString to have a different output filename, you will need this in the next stage if you do - Run the sketch, you should see your shape open up with points over the outline showing their coordinates
- Data from the SVG file are loaded into the PShape object called
svgIn, one of the children of this shape should be your SVG shape; if the code doesn't run properly you might be able to edit the linevertices = getPoints(svgIn,1);to have a different number instead of 1, it might be 0 or 2, for example - If it still doesn't run you may need to create the output file from this stage manually or by other means - the file is just a text file with the x and y data shown as
x,yon each line, one line per point - The output file is created in the main sketch folder, one level up from the
datafolder
Processing: lineusKinematics
This sketch converts the list of points you made above into a list of cam angles and saves as a text file
- Copy the text file you made above into the
datafolder of thelineusKinematicssketch - Open the sketch in the Processing interface and (if you changed the output file name above) edit the line
String fileName = "bs5logoPoints.txt";to be the name of the file you just copied in - The sketch is set up to include the dimensions of the machine, if you change anything in the OpenSCAD file you will need to re-do this step with the new dimensions (I would strongly suggest that you don't do this)
- The sketch will show the points imported from the text file you made and will show the way that the arm will move around the shape and the corners of the 60x60mm box that is the target for the shape - if your shape does not fit into this box you can edit the line
float pathScale = 1;to change the size but I would strongly suggest that you go back and re-scale your SVG file in Inkscape to no more that 60x60mm wide & high - The output file is a text file called
pathPoints.txtby default, this can be changed if you wish. The output file is created in the main sketch folder, one level up from thedatafolder
Processing: lineusInterpolation
This sketch converts the list of cam angles into a more detailed list that is formatted as an OpenSCAD (*.scad) file that is used in the next stage
- Copy the text file you made above into the
datafolder of thelineusInterpolationsketch - If you edited the file name you will need to edit the input file name variable
- I would strongly suggest that you keep all other settings as they are
- Run the sketch, there is no real display but the output file will be created in the main sketch folder, one level up from the
datafolder
OpenSCAD - make the cams
Copy the output file from the final Processing sketch into the folder where you have the OpenSCAD script, by default this is angs.scad but if you've changed the filename you will need to edit the OpenSCAD file to include this name
Because some of the operations involved in making the cams take a very long time the file is, by default, fully commented out and preview and render will not create anything
You will need to uncomment lines step by step, starting with the cams, before you will see anything
First: please ensure that you're using one of the development snapshots of OpenSCAD as these use the manifold renderer which is much, much quicker than the default one. If you're not already using one of these please go to the OpenSCAD downloads page and choose the one for your system. Open the application and ensure edit > preferences > advanced > 3d rendering backend is set to Manifold (new/fast)
Open the scad file and launch a preview - you should see nothing in the window
Now find the line for the “B” cam //cam(2,0); //cam B - you will need to uncomment it with CTRL+SHIFT+D or by deleting the // at the start. Launch a full render with the F6 key or the render button and wait for the calculation to complete: this will take a long time
When the render is complete you should see a disc with a wavy slot cut into it, export this shape as an STL with a filename that lets you know this is cam B
Comment out the “B” cam line again with CTRL+D or by adding the // at the start
Now find the line for the “A” cam //cam(1,followAngDelta); //cam A - you will need to uncomment it with CTRL+SHIFT+D or by deleting the // at the start. Launch a full render with the F6 key or the render button and wait for the calculation to complete: this will take a long time
When the render is complete you should see a different disc with a wavy slot cut into it, export this shape as an STL with another name that lets you know this is cam A
Prusa Slicer - post process the cams
- Open Prusa Slicer and import either of the STLs that you exported above
- Right click on the model and choose
split > to objects - You can then select the outer part and delete it (remember to deselect the two parts first or you will delete them both)
- Right click on the centre section and choose
export as STL/OBJ…- you can then choose the file name & location, ensure that you label if this is cam A or B - Repeat this process for the other cam
- Ensure that both STL files are in the same folder as your OpenSCAD file
- I would suggest not printing the cams at this stage as it's possible that they will not fit into the assembly and we will check this next
OpenSCAD - check the assembly
Edit the OpenSCAD file lines shown to include the new file names that you made when you exported the centre section of the cams from Prusa Slicer
camAref = "camA_bs5_proc.stl";
camBref = "camB_bs5_proc.stl";Change the file names to the ones you chose, this will ensure that the cam profiles are imported as shapes that are already calculated and should ensure that the assembly can be studied with reasonable ease
Check that both of the cam lines you edited above are commented out, we will not be using them in this stage and they will slow rendering to less than a crawl if they are present
Next find the line with the call to the assembly module //assembly(); and uncomment it, you can preview render the assembly at this stage to check for errors
If all is OK uncomment the line with the cam size check:
//#translate([0,0,0])cylinder(h=1,d=176,$fn=detail);
If any section of either of your cams is larger than this red circle your cam is definitely too big and will probably not fit the plotter. This limitation is most severe on the lower cam, you may be able to use a slightly larger upper cam of around 182mm diameter. If your cams do not fit you must make your shape smaller or possibly you might be able to move it - the angles shown on the lineusKinematics Processing sketch might help with this
Printing
You should be able to download the STL files from here for all parts other than the cams. Some parts will need support but many can be printed without
Note: the cam axle is driven by a printed GT2 pulley, I used the excellent OpenSCAD generator from here to make the base pulley and then modify it for this project
Hardware & (Non Printed) Mechanical Parts
Most of the parts are joined with M3 socket cap screws of various lengths. If you don't have these already I would suggest getting a box with a mix of different lengths. You will also need a fair amount of washers (many for tuning of spacing between arms) and nuts for these screws - ideally you should also have some nylok nuts. The max length of screws used is M3 x 35mm
You'll need an M5x60mm screw for the cam axle
There are some other parts needed:
- Most of the arm joints, cam axle pivots and cam followers are bearings: around 16x (10mm outer diameter, 4mm thick with a 3mm bore)
- 2x 10mm outer diameter, 4mm thick with a 5mm bore for the cam axle
- NEMA17 stepper motor with a 20 tooth GT2-6 pulley
- 300 tooth, 6mm wide circular GT2 belt
- Two elastic bands to hold the cam followers against the cams, you might replace these with springs if you're feeling posh
- Some larger washers (I used ~18mm diameter ones) to get some weight on the pen
Tools
You'll need a 2.5mm Allen key for the M3 screws and (probably) a smaller one for the stepper pulley
Some of the screws are fixed with tapped holes into plastic, I recommend a spiral flute M3 tap. You'll also need an M5 tap for the cam axle
It can also be useful to have a 2.5mm drill bit for reaming before tapping holes. You'll need to have a 5.5mm spanner for the nuts
Electronics
You need something to drive the stepper motor, it doesn't need to be fast so pretty much anything will work. I used an “EasyDriver” I've had for years, you could use a driver from a 3D printer or anything else
You need something to send steps to the stepper driver and detect switch presses, I used an Arduino Nano
I wanted to drive the electronics from a 19V laptop power supply and the Arduino wouldn't want to deal with that so I added a DC-DC converter to step it down to about 12V but the stepper driver gets 19V directly (I could have used the 5V output from the EasyDriver for the Arduino but at this point I didn't know it existed because I'm an idiot who doesn't read documentation)
I used three simple tactile switches because I had a board with them on already although I only needed two for forward and reverse directions and one would work if you only want to go one way. On each switch press the stepper does just over a full circle either forward or reverse
I've included my Arduino code, you can have a look if you want. It requires the AccelStepper library
Assembly
I might make a video to show how the assembly fits together but the best place to look is the OpenSCAD file which will show how the different parts are arranged
The cams have alignment marks so you can get their rotational positions aligned correctly. Cam “B” goes on top, I've no idea what happens if you get the wrong one on top