Arduino I/O with Linuxcnc

More
31 Oct 2012 22:09 #26135 by ArcEye
Replied by ArcEye on topic Re:Arduino I/O with Linuxcnc
Andy Pugh wrote:

... We even have an LCD HAL component now:

I wondered if you had finished that.

If you have a mesa board, you have all the I/O you need, and it wouldn't make sense to try to pass a MPG output through the Arduino via a serial link, they work very well natively just connected directly.

Now that Andy has made the Mesa LCD display easier to use, that seems an obvious way to go.

Please Log in or Create an account to join the conversation.

More
31 Oct 2012 22:12 #26136 by Miselph
oooooo That's a bit good.
How simple is it to integrate into Linuxcnc? I understand that pcnconf has the details for it but I don't want to re-run pncconf as I have a gantry machine and pncconf will overwrite my nice ini and hal file and break everything :(

It is definitely something to think about. One of the main draws to the arduino / usb method tho is that I was planning on using a Bluetooth wireless link as the operator can walk right round the machine and I don't want cables getting tangled up.

Ideas / opinions?

Please Log in or Create an account to join the conversation.

More
31 Oct 2012 22:27 #26138 by andypugh

How simple is it to integrate into Linuxcnc?

Pretty easy, you plug it in with a CAT5 cable and all the pins appear in HAL. (Lots of IO, 4 encoder counters, some analogue inputs)
You can link them all up as you feel fit in a custom.hal file.
7i73 Manual:
www.mesanet.com/pdf/parallel/7i73man.pdf
LCD HAL module docs:
www.linuxcnc.org/docs/html/man/man9/lcd.9.html

Please Log in or Create an account to join the conversation.

More
31 Oct 2012 22:34 - 31 Oct 2012 22:34 #26140 by andypugh

LCD HAL module docs:
www.linuxcnc.org/docs/html/man/man9/lcd.9.html

And what a lot of formatting errors there are in that document. I will try to fix it tonight.
Last edit: 31 Oct 2012 22:34 by andypugh.

Please Log in or Create an account to join the conversation.

More
31 Oct 2012 23:08 #26146 by Miselph
Well it looks like the very best option is the 7i73.
However, I am going to continue experimenting with the arduino pendent for the time being as I have all the bits bar the enclosure knocking about and I enjoy tinkering.
Worth noting that with regards to the jogging of the machine I am thinking of using a thumb-stick joystick (like you get on a playstation joypad) as I am not looking for precision with the jogging, at the moment at least. The jogging is just used to roughly locate the cutting head prior to probing and to move the head out of the way and such like. No cutting is done in jog mode.

The advantage of the thumbstick is that you can move multiple axis simultaneously and it only requires the arduino to send a value representing stick displacement from centre. I can see that trying to transmit pulses from an MPG using the arduino and serial wouldn't really be practical.

In the long run I will look to build a 'proper' pendant using the 7i73 in the long run tho.

Thank you very much for all your help and advice.

Please Log in or Create an account to join the conversation.

More
31 Oct 2012 23:37 #26150 by andypugh

Worth noting that with regards to the jogging of the machine I am thinking of using a thumb-stick joystick (like you get on a playstation joypad).

I use an actual Playstation joypad on my machine, and I am entirely happy with it. (Techncally a cheap USB copy of the actual Playstation controller).
wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Remote_Pendant
The wireless ones work fine too, by all accounts.

Please Log in or Create an account to join the conversation.

More
01 Nov 2012 10:19 - 01 Nov 2012 10:20 #26170 by r00t4rd3d

I use an actual Playstation joypad on my machine


I use a USB Nintendo controller and the Linux app QJoyPad, it converts the joystick inputs into keystrokes. Easier for people who dont mess with hal.

qjoypad.sourceforge.net/
Last edit: 01 Nov 2012 10:20 by r00t4rd3d.

Please Log in or Create an account to join the conversation.

More
01 Nov 2012 22:36 #26186 by VNR
Replied by VNR on topic Re:Arduino I/O with Linuxcnc

Hi

Would it be possible to add analogue data as well as just bits?

Yes of course, but how you go about it probably depends upon the value ranges you will be dealing with.
There are 4 hal_type_t data types, bit, signed long int (s32), unsigned long int (u32) and float, and pins can be any of these types.
Bits are just used a lot because they easily represent switches etc.
They also can be very tightly packed in data packets of just a few bytes as per the example on page 1.
If you give me an idea of what you are trying to do, the data size etc I will have a think on it
regards


Just to mention, i am currently testing an integration of HAL and Arduino Mega using Modbus protocol over USB. All data types are posible to trasmit and receive. Results and more news in the next week.
VNR

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 04:07 - 11 Jan 2013 05:07 #28558 by mariusl
Replied by mariusl on topic Arduino I/O with Linuxcnc
@VNR
Did you manage to test the Modbus code. I am looking at the code Jeff did but there are issues with non synchronized comms. Things get messed up so I would like to use Modbus protocols as well.

Regards
Marius


www.bluearccnc.com

Last edit: 11 Jan 2013 05:07 by mariusl.

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 20:27 #28585 by VNR
Replied by VNR on topic Arduino I/O with Linuxcnc

@VNR
Did you manage to test the Modbus code. I am looking at the code Jeff did but there are issues with non synchronized comms. Things get messed up so I would like to use Modbus protocols as well.

Yes, it is working for me, I have an Arduino Mega.
May be you are the 1st tester i would know, give me feedback later.

Here is a Wiki
wiki.linuxcnc.org/cgi-bin/wiki.pl?ModbusToHal
Here is the source code
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...6bfa9acc2283;hb=HEAD
And here is the Arduino example
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...983cf0cfee9a;hb=HEAD

The only bug i know is that the first packet delays to respond to high, i dont know if there is a problem in the arduino hardware, or in the implemented modbus library, but also i have tested it with others libraries and the behaviour is the same.
The solution is: MB_RESPONSE_TIMEOUT_MS= in the range 1000 to 2000

Copy pasted form the Arduino INI example file:
34 #MB_RESPONSE_TIMEOUT_MS is a high number, because Arduino fails to respond fast
35 #to the 1st request. If the first request is TIMED OUT, all next requests will
36 #be TIMED OUT again. I don't know if it is a Arduino or Modbusino problem.
37 #If the 1st request is succesful, tipical next responses are in the 10 to 30 ms order.
38 MB_RESPONSE_TIMEOUT_MS=1200

Regards.

Please Log in or Create an account to join the conversation.

Time to create page: 0.116 seconds
Powered by Kunena Forum