Search found 9 matches

by hanming
Wed Jul 26, 2017 9:10 pm
Forum: General Discussion
Topic: [Complete script] Using matlab to control Makergear
Replies: 12
Views: 20650

Re: [Complete script] Using matlab to control Makergear

I don't think the .. means anything. I get that from my serial spy, when repetier send each command. But everything works without it. I have my code updated in my first post.
by hanming
Fri Jul 21, 2017 3:06 pm
Forum: General Discussion
Topic: [Complete script] Using matlab to control Makergear
Replies: 12
Views: 20650

Re: Using matlab to control Makergear

Ah, problem solved! Thanks to Josh's explanation of the gcode line number and checksum value, which can be omitted in all together. It seems that matlab has several ways of sending new line command, and this is the matlab code that worked. clear all clc arduino=serial('COM3','BaudRate',115200); % cr...
by hanming
Fri Jul 21, 2017 2:37 pm
Forum: General Discussion
Topic: [Complete script] Using matlab to control Makergear
Replies: 12
Views: 20650

Re: Using matlab to control Makergear

Yes, I looked at the serial bus and the home command is N457 G28*21.. I understand the line number and G28. But what is the *[number]? The number seem to change every time as well. Can anyone explain? Then the line in ended in .. and Line Feed.

Hanming
by hanming
Thu Jul 20, 2017 9:19 pm
Forum: General Discussion
Topic: [Complete script] Using matlab to control Makergear
Replies: 12
Views: 20650

Re: Using matlab to control Makergear

No, the flush doesn't solve the problem, but maybe this section from MarlinSerial.cpp can give insight int MarlinSerial::peek(void) { if (rx_buffer.head == rx_buffer.tail) { return -1; } else { return rx_buffer.buffer[rx_buffer.tail]; } } int MarlinSerial::read(void) { // if the head isn't ahead of ...
by hanming
Wed Jul 19, 2017 9:29 pm
Forum: General Discussion
Topic: [Complete script] Using matlab to control Makergear
Replies: 12
Views: 20650

Re: Using matlab to control Makergear

Oh, the echo terminator is just a line feed, and I can receive echo correctly. But it still does not do the home command...
by hanming
Wed Jul 19, 2017 9:13 pm
Forum: General Discussion
Topic: [Complete script] Using matlab to control Makergear
Replies: 12
Views: 20650

Re: Using matlab to control Makergear

Yes, I added a carriage return and line feed (CR/LF) command, but the fscanf function said "The input buffer was filled before the Terminator was reached.. " Although it is able to read the rest of the echo in another read, and supposedly send the G28 command, the printer did not do anything. I wond...
by hanming
Wed Jul 19, 2017 2:57 pm
Forum: General Discussion
Topic: [Complete script] Using matlab to control Makergear
Replies: 12
Views: 20650

Re: Using matlab to control Makergear

Yeah, it should be 115200, although that doesn't solve the problem. I use the following code and can receive all the setup echo from the makergear. However, it still does not home when G28 clear all clc arduino=serial('COM3','BaudRate',115200); % create serial communication object on port COM4 fopen...
by hanming
Tue Jul 18, 2017 8:57 pm
Forum: General Discussion
Topic: [Complete script] Using matlab to control Makergear
Replies: 12
Views: 20650

[Complete script] Using matlab to control Makergear

Here is the matlab code to operate makergear. Use at your own risk!!! https://github.com/hanmingz/matlabmakergear =====================================original questions============================================= Hi guys, I'm trying to control Makergear M2 using matlab for material science specifi...
by hanming
Fri Jun 16, 2017 5:33 pm
Forum: Modifications
Topic: Paste Extruder (a work in progress)
Replies: 18
Views: 30924

Re: Paste Extruder (a work in progress)

Hi, I'm developing a printer of viscous fluid for a lab and interested in your design. Can you upload the solidworks or modeling files? Thanks a lot