VisiCut icon indicating copy to clipboard operation
VisiCut copied to clipboard

Roland iModela driver fails to send to machine

Open nerochiaro opened this issue 11 years ago • 29 comments

I am trying to control a Roland iModela IM-1 with visicut but I can't seem to send the right sequence of NC-code commands to it.

I am using the following version:

  • VisiCut Version: 1.7-61-gdb30c9a
  • LibLaserCut Version: visicut1.7

Here's the steps to reproduce my problem:

Before doing anything with visicut:

  • connect the machine to a Windows computer
  • run iModela Controller software
  • change the machine's input type to be NC-code as explained at https://github.com/t-oster/VisiCut/wiki/Roland-iModela

(Note: on the page it says "N-Code", but I assume that's an error and it means NC-code since there's no N-Code option in the Controller software).

Then:

  • connect the machine to an Ubuntu (13.10) computer
  • start visicut
  • load one of the example files (rectangle-20mm-green.svg)
  • select "ROLAND iModela" as the laser cutter in the right hand panel
  • select "Mark everything" as mapping.
  • hit the button "Execute" in the bottom right corner of the window.

The progress bar in visicut goes from "Generating" to "Sending" and the light on top of the iModela machine next to the power button starts blinking. But then it stays forever blinking and the progress bar in visicut stays stuck in the same position forever as well.

If I reconnect the machine to the Windows computer then the iModela Controller will pop up this dialog box:

faildialog

If I choose "Continue" the machine seems to go out of whack and does strange movements, so I have to abort everything to prevent damage.

I also notice that in the iModela Controller options panel there are a plethora of options regarding NC-code, as shown in this screenshot

ncoptions

I am not sure if any of them are relevant and need to be changed to allow the machine to understand the commands that visicut sends to it. I tried different combinations but I'm shooting blind and nothing actually worked so far.

Is there something I am missing to be able to use this machine with visicut ? Is there any way to output any debug message to the console that may help solve this issue ?

nerochiaro avatar Sep 17 '13 21:09 nerochiaro

Hi, please make sure, you are using the right port on linux. Did you follow the https://github.com/t-oster/VisiCut/wiki/Roland-iModela#using-the-driver-on-linuxunix part? Is there a device "/dev/lp0" and do you have the right access rights? (you could try to run visicut with "sudo visicut" to check.

Beware, the iModela driver is not fully tested yet. Since I do not have such a device myself, the driver is highly experimental and use it at your own risk. Always be prepared to pull the plug ;)

t-oster avatar Sep 18 '13 06:09 t-oster

The device is there as /dev/usb/lp0, and visicut is set to use file:///dev/usb/lp0 and yes I have access rights to the lp group. As I explained in the bug the commands are being sent to the machine, it is not a problem of permissions. The problem is that the machine thinks the commands are wrong and I have to pull the plug :)

I am trying to use file:///tmp/visicut.gcode as the output, then try to use echo to send the gcode instructions one by one to /dev/usb/lp0 to see what part is confusing the machine. I will update this bug when I have some results.

nerochiaro avatar Sep 18 '13 08:09 nerochiaro

I created a new cutter profile in visicut to use the iModela driver but write to file:///tmp/data.gcode Then I feed the data.gcode like instruction by instruction to the machine and see where it gives me an error. The problem seems to be with the following line:

G00 X3.200400 Y50.732800 S100.000000

I think the problem is that iModela allows setting the spindle speed ("S") only when associated with powering up the spindle ("M03"). So basically to prevent the machine from throwing an error that line needs to be:

G00 X3.200400 Y50.732800 M03 S100.000000

Is it possible to fix visicut somehow to address this problem ?

nerochiaro avatar Sep 18 '13 23:09 nerochiaro

Hi, this would be an easy task, since just the line 169 in the driver https://github.com/t-oster/LibLaserCut/blob/develop/src/com/t_oster/liblasercut/drivers/IModelaMill.java#L169 has to be changed. Since I do not have access to an iModela to improve the driver right now, I would be very happy, If you could do and test that.

Please set up a development-environment like described in: https://github.com/t-oster/VisiCut/wiki/Development:-Getting-started and then fix the bugs you find and submit a pull-request like described in https://github.com/t-oster/VisiCut/wiki/submit-a-fix-or-feature.

If you have questions, please ask.

t-oster avatar Sep 19 '13 07:09 t-oster

Hi, I have same issue on debian wheezy stable amd64 . How to fix, in plain english? Tank you

mrehqe avatar Dec 21 '13 20:12 mrehqe

Hi, as already stated, I do not have an imodela to test, so would be great if some of you can try. In plain english:

  1. Install git and ant "sudo apt-get install netbeans git" (you also need to have openjdk6 or 7)
  2. Get the source: "git clone --recursive https://github.com/t-oster/VisiCut.git"
  3. Edit the file "lib/LibLaserCut/src/com/t_oster/liblasercut/drivers/IModelaMill.java in Line 196: change " S%f\n" to " M03 S%f\n"
  4. "cd" back to the VisiCut folder
  5. run "ant jar"
  6. run "java -jar dist/VisiCut.jar" and test if it works
  7. report back here.

t-oster avatar Dec 22 '13 01:12 t-oster

Hi, first, i want to say "tank you" for our support: I'm from "fablab palermo" in italy, your work is a great piece of software for the community. I tryed to compile following your instruction, it works fine, but the code is not good enought: in this way, drill motor just start and stop after one second, and still freeze on the middle of work. here i put the compiled file: http://www.autistici.org/mrehqe/files/tmp/Visicut.jar , if nerochiaro (italian too? ;) ) want, it's would to be nice get a try

mrehqe avatar Dec 22 '13 09:12 mrehqe

Well.... what if you do not specify the spindle speed at all... meaning replace

parameters += String.format(Locale.ENGLISH, " S%f\n", spindleSpeed);

with

//parameters += String.format(Locale.ENGLISH, " S%f\n", spindleSpeed);

t-oster avatar Dec 22 '13 10:12 t-oster

Hi guys,

I tried commenting the line mentioned above, and I can move the spindle by "right click" and "move to position" (before I was not even able to that). And I have a couple of comments and improvements.

1.- I sent a gcode file generated with Eagle (pcb design), and - Take too long to start working. - If the work is 30min and you want to cancel, you have no possibility 2.- Z zeroing is very important, as well as being able to start and stop the spindle by desire, (but not when some job is working)

Other than that, it is very cool that you have integrated a driver for the iModela, it is the only possibility in linux apart from using: cat "file" > /dev/usb/lp0 or echo "gcode instruction" > /dev/usb/lp0.

For my pcb I am actually starting Windows as Virtual Machine and sending the jobs from the iModela Controller, but running a whole Windows just for that, perhaps is not the best solution. By the way, I think it is not able to send correctly the file, since it stops very fast and does not execute all the instructions.

axonbf avatar Dec 22 '13 22:12 axonbf

Hi. I know the iModela driver is highly experimental and definitely not ready for production use. I just included it because i do not have access to an iModela anymore and so I need the help of others to test and develop the driver.

Of cause if you're willing to fund me an iModela, i will create the best driver I can in return ;)

If anyone is interested in helping with the driver, just ask if you need assistance with VisiCut's internals.

t-oster avatar Dec 22 '13 22:12 t-oster

At the moment it's a bit hard for me to find time to go back and do stuff on the iModela. I might be able to do more in February. But I noticed that removing the spindle speed instructions really helped. The machine seems to ignore them anyway and they confuse it. I think the last time I tried it I had some success by adding the M03 instruction as Thomas suggested and then removing all the spindle speed instructions. This allowed the job to start and go along for a while.

But then I decided to leave the iModela aside because I was having issues with the bed size being incorrectly calculated and my programs were driving the tool past the limit of the Y edge, which caused the machine to simply stop running. And as far as I could see my programs were trying to mill stuff well within the limits of the bed. But then again I had the same problem sometimes when I send commands from a windows machine with the Roland software, so it might be something wrong with the firmware in the unit I have.

On Sun, Dec 22, 2013 at 10:01 AM, mrehqe [email protected] wrote:

Hi, first, i want to say "tank you" for our support: I'm from "fablab palermo" in italy, your work is a great piece of software for the community. I tryed to compile following your instruction, it works fine, but the code is not good enought: in this way, drill motor just start and stop after one second, and still freeze on the middle of work. here i put the compiled file: http://www.autistici.org/mrehqe/files/tmp/Visicut.jar , if nerochiaro (italian too? ;) ) want, it's would to be nice get a try

— Reply to this email directly or view it on GitHubhttps://github.com/t-oster/VisiCut/issues/175#issuecomment-31081311 .

nerochiaro avatar Dec 22 '13 22:12 nerochiaro

Just a guess: does it work if you change the codeset to 'roland nc code'?I think I implemented their spec, not the original g-code spec.

nerochiaro [email protected] schrieb:

At the moment it's a bit hard for me to find time to go back and do stuff on the iModela. I might be able to do more in February. But I noticed that removing the spindle speed instructions really helped. The machine seems to ignore them anyway and they confuse it. I think the last time I tried it I had some success by adding the M03 instruction as Thomas suggested and then removing all the spindle speed instructions. This allowed the job to start and go along for a while.

But then I decided to leave the iModela aside because I was having issues with the bed size being incorrectly calculated and my programs were driving the tool past the limit of the Y edge, which caused the machine to simply stop running. And as far as I could see my programs were trying to mill stuff well within the limits of the bed. But then again I had the same problem sometimes when I send commands from a windows machine with the Roland software, so it might be something wrong with the firmware in the unit I have.

On Sun, Dec 22, 2013 at 10:01 AM, mrehqe [email protected] wrote:

Hi, first, i want to say "tank you" for our support: I'm from "fablab palermo" in italy, your work is a great piece of software for the community. I tryed to compile following your instruction, it works fine, but the code is not good enought: in this way, drill motor just start and stop after one second, and still freeze on the middle of work. here i put the compiled file: http://www.autistici.org/mrehqe/files/tmp/Visicut.jar , if nerochiaro (italian too? ;) ) want, it's would to be nice get a try

— Reply to this email directly or view it on GitHubhttps://github.com/t-oster/VisiCut/issues/175#issuecomment-31081311 .


Reply to this email directly or view it on GitHub: https://github.com/t-oster/VisiCut/issues/175#issuecomment-31098146

t-oster avatar Dec 23 '13 06:12 t-oster

Hi Toster,

unfortunately, I don't have enough to found you one ;), but I will try to have a look to the driver thought, I just have to catch up with my java skills since they are a bit rusty. I'll let you know if I make some improve..

I can send you the gcode guide from iModela if you are interested

axonbf avatar Dec 23 '13 07:12 axonbf

well.. funding is just a matter of getting enough people ;)

I have the g-code guide and I tried to implement it along the specs... but I am not sure wether to select "g-code" or "nc-code" and if the iModela follows it's own specs in all aspects.

What would be interesting is the command to switch to g-code mode. It may be possible to sniff it on windows so we can add it to the driver and people do not have to manually switch anymore (so no need to install the windows driver at all).

t-oster avatar Dec 23 '13 08:12 t-oster

when I write "g-code" or "nc-code", I mean "NC-Code" or "RML-1/NC-Code". Not sure if it makes a difference in the g-code interpretation.

t-oster avatar Dec 23 '13 08:12 t-oster

mmm... actually I meant nc-code. I checked again and the name of the pdf that I've got with the CD is NC_CODE_EN.pdf. I will check it for some kind of command for switching between g- and nc-code

axonbf avatar Dec 23 '13 08:12 axonbf

I have the same document, that's what I used to create the driver. But I think a command for switching is not included, since it is intended to send the files with the iModela software.

t-oster avatar Dec 23 '13 09:12 t-oster

Roland often gives these machines to FabLabs at no cost, at least many labs in Germany (München, Erlangen and others) were contacted by Roland and got one as a permanent loan.

mgmax avatar Dec 23 '13 10:12 mgmax

I know... FabLab Aachen got one. But unfortunately I do not work in Aachen anymore and thus have no access. I have kind of a Mini-Fablab at home, but not big enough to be public. But I will ask Roland if they're interested in a VisiCut driver...

Do you have a contact address?

t-oster avatar Dec 23 '13 10:12 t-oster

Definitely not just FabLabs, we are an independent makerspace in Barcelona and Roland gave us an iModela on loan too. Thomas, I think if you approach them saying you're writing Linux drivers for them they might just loan you one too, and maybe some extra documentation (unless you already tried)

On Mon, Dec 23, 2013 at 11:10 AM, Max Gaukler [email protected]:

Roland often gives these machines to FabLabs at no cost, at least many labs in Germany (München, Erlangen and others) were contacted by Roland and got one as a permanent loan.

— Reply to this email directly or view it on GitHubhttps://github.com/t-oster/VisiCut/issues/175#issuecomment-31111776 .

nerochiaro avatar Dec 23 '13 10:12 nerochiaro

That sounds pretty good. I was looking for Stuttgart, but I think there is no fablab, do you guys know something similar in Stuttgart? I also have some kind of homelab, but only with an iModela and a 3D printer Ultimaker :)

axonbf avatar Dec 23 '13 10:12 axonbf

how about shackspace? They have almost everything you can imagine and plenty of space

mgmax avatar Dec 23 '13 10:12 mgmax

So... anyone has a contact of the Roland people in charge?

t-oster avatar Dec 23 '13 10:12 t-oster

I will forward you the mail we got from Roland a year ago.

mgmax avatar Dec 23 '13 10:12 mgmax

thanks for the shackspace tip, I didn't know it. I checked the Website and looks good, I'll drop by...

axonbf avatar Dec 23 '13 10:12 axonbf

I send this discussion to Roland's technician friend in Japan.

giovannire avatar Jan 08 '14 11:01 giovannire

I've started an attempt with the native iModela protocol. No need to switch the protocol first with 3rdparty software. I am not yet happy, but whoever wants to look into it, welcome!

https://github.com/fablabnbg/LibLaserCut/tree/iModelaJW

jnweiger avatar Jul 12 '15 19:07 jnweiger

Hi, maybe we can use libusb with JNA directly from Java, so no need for a python script? I do not have experience with JNA (not to confuse with JNS), but I guess it must be doable. Looks like there is already some project https://launchpad.net/libusb4j...

t-oster avatar Jul 13 '15 05:07 t-oster

Tried this driver today from Ubuntu 18.08, java-8-openjdk the bed moved, the spindle started, but then it hangs.

dmesg has this

[1170348.016445] usblp0: nonzero write bulk status received: -71
[1170381.931574] usblp0: nonzero read bulk status received: -71
[1170381.968262] usblp0: nonzero write bulk status received: -71
[1170413.098178] usblp0: nonzero read bulk status received: -71

jnweiger avatar Aug 20 '18 19:08 jnweiger