How to setup the plotter for g-code use


#21

Thanks i was now able to draw the fish.
Currently im working on communication via python.
It works fine. But i was wondering if i could make the init sequence faster because the stepper motor is really moving slow to its destination (zero point). Well i could do it by hand but i want to make some tests.


#22

Also using a serial read command in python shows me what happens after every command is done i get a list of this:
init

Waiting 60 Seconds for init Sequence
Sequence 1
ok

Sequence 2
OK

Sequence 3
Grbl 0.8

Sequence 4
OK

Sequence 5
OK

Sequence 6
OK

you can ignore the Sequence thats a print i made for my self
but it looks like sometimes he uses ā€˜OKā€™, ā€˜okā€™ and ā€˜Grbl 0.8ā€™ These are the Gcode Commands i give to the plotter at the diffrente Sequences:

Sequence 1
G01 X100 Y100 Z30 F2500
Sequence 2
G01 X80 Z30 F2500
Sequence 3
G01 X70 Z30 F2500
Sequence 4
G01 X60 Z30 F2500
Sequence 5
G01 X50 Z30 F2500
Sequence 6
G01 X40 Z30 F2500

why isnt there always the same command comming back, you have any idea?


#23

Looks like Iā€™ve got bugs.

The only time you should see ā€œGrbl 0.8ā€ is at the end of the init sequence where ā€˜startā€™ was returned before. I see that on line 93 thereā€™s also a ā€œGrbl 1.0ā€ so thatā€™s probably a bug but itā€™s in the Makeblock repository. Iā€™m canā€™t explain why you see that ā€˜Grbl 0.8ā€™ except that maybe the board got reset but then youā€™d also expect to see an ā€œinitā€ in the log.

I uppercased all of the "ok"s except the one in the stepper control file. Interestingly that is also where the ā€œinitā€ comes from (goto_machine_zero). So my strong suspicion is that your python code is out of sync with the board.

Hereā€™s a possible timeline:

  1. Init starts and ā€œinitā€ is sent
  2. Your code waits 60 seconds
  3. Your code sends Seq 1
  4. The board finishes its move to zero and sends ā€œokā€
  5. Your code gets ā€œokā€ and sends Seq 2
  6. The mainboard responds with an ā€œOKā€ to Seq 1 (?)
  7. You send Seq 3
  8. The board finally finishes init and sends ā€œGrbl 0.8ā€
  9. Your code sends Seq 4
  10. The board responds with an ā€œOKā€ to Seq 2
  11. Your code sends Seq 5
    etc.

If this is completely accurate then you should see a series of "OK"s at the end corresponding to the command queue. Itā€™s also possible that the first three commands are just getting dropped on the floor and the "OK"s are for the sequences that are actually requested.

I think you have to watch the machine very carefully to see which commands are executed when and also make sure that whatever else your code does it outputs everything that it gets via serial regardless of when it comes in and whether it thinks itā€™s finished or not.

Edit: actually I think the fix is probably for the script to wait for the ā€œGrbl 0.8ā€ before sending any commands because anything before that is just pre-initialization messages.


#24

Hi Charlieb,

I may not get the details for that. While it looks like that the Port 8 may not control the RJ25 adapter very properly. Then our engineer changed to Port 6,7 and have updated all the new document to use Port 6,7.


#25

Thanks i will try that and give feedback.


#26

You were right now it works. I just filter it with a normal if like if string contains ā€˜Grbl 0.8ā€™ then go onā€¦


#27

Always good to hear :wink:


#28

Hello Charlieb,

is there a way to increase the speed during the init Sequence?

Cheers


#29

Iā€™m a bit reluctant to mess with that stuff because I donā€™t want any chance of damaging anything. Iā€™m sure thereā€™s some parameter that can be increased to make it move faster but Iā€™ve never gone looking for it. I guess it wouldnā€™t be too bad since itā€™s not supposed to be configured for 1/16 steps but the larger 1/8 steps.

Anyway my answer is to manually move the carriage close to zero before powering up so that it has less distance to move and so takes a bit less time,


#30