How to setup the plotter for g-code use


#1

Hi,

I’ve written up my procedure for going from the end of the build instructions to being able to make single g-code moves.

Please check it out and let me know where I went wrong, what didn’t work for you and any other comments.

I’ll be adding more sections to cover, drawing the fish and calibrating the units so a 1 unit g-code move is a mm on the paper.

Thanks,
charlieb

Edit: Added calibration to make 1 unit in g-code = 1mm


XY Plotter GRemote not Working
#2

Hi Charlieb,

so im using your Parser now and i have 2 problems. One of the Limit switches isnt working.
If i enter G01 X300 i pressed every limit switch but the motors arent stopping when entering X01 X-300 the limit switch which is supposed to stop it works perfectly fine i already changed the layout to try if the switch which isnt working is damaged but it works so i dont know where to analyze the problem. Its really strange since all the other limit switch work when using your Parser.

To add in a picture its Limit switch 4 which isnt working

2nd is the one that i cant control my servo is there a way to test that?

Thanks for your documentation.


#3

Okay i fixed the Servo by Using 15 instead of A1 in

int Z_STEP_PIN = 15;

now the Servo works in GRemote


#4

I’m glad you got the servo working although that’s a little weird because A1 is the same pin as 15.

So to be clear on the switch issue: switch 4 doesn’t work for positive X moves but the negative X limit switch works ok. If you switch two the non-working switch (switch 4) now works. Does the switch 3 work ok when they are switched? If so then maybe the connectors on the board are no good.

If everything works when the switches are connected backwards then maybe it was just the act of jiggling the connectors that fixed it. If you want to switch them back to the original configuration, give it a try or if not then switch the pin numbers in the software.


#5

Yes with your Parser Switch 4 doesnt work for positve X moves Switch 3 works for the negative ones. I switched it and Switch 4 now works for negetive moves but Switch 3 not for positive ones.

Maybe im not thinking straight…


#6

That suggests that there is a problem with the port on the board. Can you take a look at the connector itself and see if it looks ok then check the solder connections on the bottom. If you have a continuity tester (multimeter that beeps or lights up or something when there is an electrical connection) perhaps you can investigate the connector and maybe there are some test points on the board you can use.

I’m a software guy so I can’t give you too much informed advice on this aspect.


#7

Do you know if the wiring of the colors is any important? i would try and swap them


#8

Good question. I don’t know if it’s important so that’s a solid maybe. When you swapped the switches I guess you swapped them at the peripheral board connector. It’s interesting because the picture shows them wired differently but the diagram shows them wired the same.

I think I made mine match the picture.


#9

so what i tried now was to change the servo connector with the limit switch connector. That didnt help me.
Since i had one more of the white/black cables in decided to change the cable also didnt help me. Then i tried to change the white black wiring also no diffrence. I also tried wiring on of them to the buttom pin also no positive outcome thats really strange maybe i should switch the limit switches 1 and 2 to port 6 and try them


#10

okay that didnt change anything now limit switch 2 wasnt working for positive x im now gonna try changing the rj cable
Edit: Changing the RJ cable didnt make a difference either.

Just to be sure posting PIN Layout and GRemote settings maybe @tec_support can help:

int Y_STEP_PIN = 10;
int Y_DIR_PIN = 11;
int Y_ENABLE_PIN = -1;
int Y_MIN_PIN = 12;
int Y_MAX_PIN = 13;

int X_STEP_PIN = 9;
int X_DIR_PIN = 3;
int X_ENABLE_PIN = -1;
int X_MIN_PIN = A3;
int X_MAX_PIN = A2;

int Z_STEP_PIN = 15;
int Z_DIR_PIN = -1;
int Z_ENABLE_PIN = -1;
int Z_MIN_PIN = -1;
int Z_MAX_PIN = -1;
int Z_ENABLE_SERVO = 1;

what i could do is instead of using A3 A2 maybe use the numbers (like Servo) do you know the numbers for A3 and A2?


#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?