# How to make a printer bed vibrate using g-code (heated chemical stirrer)?

I was just about to start using my 3D printers heated bed to warm a chemical reaction in a container and was thinking it would be great to be able to get the bed stepping back and forth to stir the pot. Can anyone already up to speed in programming G-code walk me through a quick and dirty way to get the X-axis on my old Printrbot metal doing a couple of micro-steps either way in an endless loop? Or suggest some software out there that could achieve the same effect?

## 3 Answers

Basically you need to write a G-code file yourself. This is a plain text file with a .g extension.

You need to home the printer with G28, then move the Y axis all the way forward (for a Prusa style printer) with G1 F1500 Y{ymax} (where {ymax} is the length of the bed). Now raise the head with a similar command G1 F500 Z{zmax} (where {zmax} is the height of the printer volume).

Heating the bed is done with M190 S60 (set and wait to reach 60 °C).

You can now rock the Y axis by moving it fast, e.g. with G1 F5000 Y{ymax-5}, G1 Y{ymax-1}, Y{ymax-5}, Y{ymax-1}, etc.

Stefan from CNC kitchen already did it: https://github.com/CNCKitchen/3D-Printer-Vibration

Never mind, figured the quickest dirtiest way myself - created a tall thin cylinder shape model in Blender and positioned it in Repetier so the printer head will be clear of the table as it moves. Then just broke off the filament that was currently in the printer so it will stop feeding once the current piece gets to the end of the feeder wheel. - not an endless loop but should give me a good 10 or 20 minutes of agitation before I need to restart the print if necessary.