robottini / grbl-servo

grbl 0.9i with Servo motor support
299 stars 165 forks source link

A simple g-code example would be great #8

Closed dattasaurabh82 closed 7 years ago

dattasaurabh82 commented 7 years ago

So I figured the servo control go to 0 degree >> M5 go to 30 degree >> M3 S30 go to 0 degree >> M5 go to 30 degree >> M3 S30

Now I've a very simple gcode I wanted to test. What it is supposed to do is basically go to a point location, drop the pen(servo to 0 degree) and lift up again (servo to 30 degree) and go to another location and do the same.

so my gcode is ::

$X // unlock
$H // do a homing
G10 P0 L20 X0 Y0 Z0 // reset to zero

G21 G90 G40 // set some parameters
M3 S35 //lift up
T0 M6
G17 
G0 X-315.5683 Y-181.7437 // go to a location
M5 // drop down
M3 S35 // lift up 
G0 X-296.3772 Y-184.0367
M5
M3 S35
G0 X-283.3244 Y-186.2592
M5
M3 S35
G0 X-278.1033 Y-178.6392
M5
M3 S35
G0 X-268.1902 Y-176.9459
M5
M3 S35

But it just keep going to the locations doesn't do anything with the servo except the first time when it starts. It doesn't do the lift up and down actions ..
If I send it commands from terminal , it does so .. What is the problem, were these commands sent to fast ?

dattasaurabh82 commented 7 years ago

So I found the issue .. If you send two or more consecutive M0x (miscellaneous commands) commands, they don't work.. There needs to be something between two miscellaneous commands.

Because I'm making something like stippling (dot dot dot.. ) and not paths, so I put a dwell command in between. Something like

M05             // Down for my case (servo 0 degree)
G04 P2        // If you want two second gap 
M03 S35     // Up for my case (servo 35 degree)

Now if you want to draw a path it would be

M05
G01 Xx1 Yy1 Fspeed
G01 Xx2 Yy2 Fspeed
M03 S35
:
: