How to setup the plotter for g-code use


#11

That’s a lot of changes. The question you have to ask is what possibility each change eliminates and what is common to all the non-working configurations.

  1. Switch 4 has a problem
  • Eliminated by switching with switch 3 and seeing it work there
  1. Connector to switch 4 has problem
  • Eliminated by switching with switch 3 and by swapping the connection wires.
  1. Connector to peripheral board has a problem
  • Eliminated by switching with switch 3
  1. Peripheral board has a problem
  • Can be eliminated be swapping the peripheral board - done, no change
  1. Cable between peripheral and main boards
  • Can be eliminated by swapping with another cable
  1. Main board port problem
  • Swap to a different (unused port) - update firmware to reflect this.

Seems like you’re most of the way through this already.


#12

Okay i got it to work like the Servo i had to change the pins numbers

from

int X_MIN_PIN = A2;
int X_MAX_PIN = A3;

to

int X_MIN_PIN = 17;
int X_MAX_PIN = 16;

and changing the numbers in GRemote gave me the correct result.
Now all my Limit Switches are working correctly thanks! :slight_smile:


#13

Great!

So it was a problem, not with the hardware but with the Arduino software disliking the AX pins but accepting the equivalent pin numbers.

Can I ask which version of the Arduino software you’re using?


#14

Also can you make a push request or an issue on github so I can fix this in case anyone else tries to use it.


#15

Sure! Arduino Version 1.6.12 maybe thats the problem. I saw Makeblock in their download folder including an older Version.
But thats just my guess.


#16

I’ll have to check which version I’m using. I suspect it’s an older version because I just used what was on my pc from the last time I played with arduinos.


#17

So what i also wanted to check if i can draw the fish.
And there is a problem with the Servo because like you said in that other thread the Z34 should be pen down. and z18 is supposed to get the pen up. So i went ahead and set z34 and like you said made the servo arm horizontal but when its set to z18 the pen is still down and on the paper.


#18

Z34 should make the servo arm point down at little bit so that it’s not in contact with the pen arm. At least that’s what I’ve observed. Z18 is really close to the paper. I use Z15 in my gcode just to be sure.

You probably need to adjust the angle of the servo arm (by removing that tiny screw, taking the armature off the servo and putting it back on at the right angle. The instructions are not very clear about this.)
or
just adjust the position of the pen so that it’s like 1-1.5mm above the paper for Z18.


#19

Hi tMonation,

Duo to there are several versions for XY plotter, there are two different wire connection ways either which lead to different PIN Layout and GRemote settings.
The old connection way shows as below which Charlieb showed in his Github page (Use Port 7,8 on Orion board):


For this kind connection, the PIN Layout and GRemote settings almost the same as you pasted.

Now, we always suggest that customer connect the wires in updated way (use Port 6,7)


Then the PIN Layout and GRemote settings should be the one shows as below:

The Gremote code provide on our Github page should be the oldest version, we will add the document for using g-code on XY plotter and explanation of the two different wire connections on our Learn website:http://learn.makeblock.com/en/xy-plotter-robot-kit/


Has anyone got GCode parser to work with Orion board?
#20

Hi tec_support,

I’m wondering why you chose to make that change. It seems to me that as long as the hardware connections match the software then everyone’s happy. So I’m wondering if there were changes that drove this change in the suggested connection layout?


#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