LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help interfacing the Arduino mega 3d printer setup via com port

Hello.

I am working on building an interface for a custom 3d printer. I use an Arduino mega with ramps 1.4 (marlin firmware installed), stepper motors for the x & y-axis, and an SMC100CC motion controller for the Z-axis to achieve that. There are two tabs in the vi file attached: one for manually giving commands to Arduino and the other for automatic movement of the stage according to the gcode file uploaded. The former is working perfectly alright but not the latter. My main aim is to make an interface that can run any gcode file automatically in the following fashion:

  1. The stage moves to the coordinates mentioned in the first line of gcode file.
  2.  a) A servo motor connected to the ramps board rotates up to some mentioned angle; b) Servo halts in that position for a controlled time (t1); c) Servo rotates back to the original position; d) Servo halts in this position for a controlled time (t2). (This whole 2nd step was executed by adding a series of GCODE commands corresponding to each as seen in the vi file.)
  3. Stage moves to the second line.

And so on.. 

Basically, I want the servo motor to rotate up and down with custom time delays after executing each line in the gcode file that I upload. The problem that I am facing currently is that when I execute the code, the arduino restarts after executed few lines in the gcode and then starts doing the same thing from beginning.

Please help me solve this. Also, please suggest a better code if you can think of any.

Thank you. 

 

P.S: To install the user library, extract the zip file and place the unzipped folder titled "Machine Control Toolkit" in your National Instruments user.lib folder

Download All
0 Kudos
Message 1 of 1
(1,190 Views)