Arduino I/O with Linuxcnc

More
14 years 1 day ago #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
14 years 1 day ago #26150 by andypugh

Miselph wrote: 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.

  • r00t4rd3d
  • New Member
  • New Member
More
14 years 15 hours ago - 14 years 15 hours ago #26170 by r00t4rd3d
Replied by r00t4rd3d on topic Re:Arduino I/O with Linuxcnc

andypugh wrote: 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: 14 years 15 hours ago by r00t4rd3d.

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

More
14 years 3 hours ago #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
13 years 9 months ago - 13 years 9 months ago #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: 13 years 9 months ago by mariusl.

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

More
13 years 9 months ago #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.225 seconds
Powered by Kunena Forum