Arduino I/O with Linuxcnc
I wondered if you had finished that.... We even have an LCD HAL component now:
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.
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.
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)How simple is it to integrate into Linuxcnc?
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.
And what a lot of formatting errors there are in that document. I will try to fix it tonight.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.
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.
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).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).
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.
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/
Please Log in or Create an account to join the conversation.
Hi
Yes of course, but how you go about it probably depends upon the value ranges you will be dealing with.Would it be possible to add analogue data as well as just bits?
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.
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
Please Log in or Create an account to join the conversation.
Yes, it is working for me, I have an Arduino Mega.@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.
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.