Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: BR549 on May 07, 2015, 04:28:51 PM

Title: Arduino Gurus ??
Post by: BR549 on May 07, 2015, 04:28:51 PM
Hi ALL , are there any Arduino gurus on here? I am looking to build a CNC hand pendant. It would use the following resources

Modbus slave com Rs485  ( mach3 being the master)
LCD 4 x 20 display
4x4 keypad matrix
2 rotary encoders( 10-24 count per rev) for SSO and FRO
6-8  LED indicator lights

Looking for an Arduino Guro to help sort it all out in the Arduino code side.

OR to find out IF it is even feasable to do .

(;-) TP

Title: Re: Arduino Gurus ??
Post by: mrprecise44 on May 07, 2015, 06:46:29 PM
I wouldn't classify myself as a bona-fide "Guru", but I have spent quite a bit of time with an Arduino Mega, in the modbus/Arduino/Mach3
playground.

John
Title: Re: Arduino Gurus ??
Post by: BR549 on May 07, 2015, 07:28:34 PM
Great (;-)  So what do you think ? possible or no ? I have seen different moduals that do each part of what I need but not a modual that did it all.

It "Looks Simple Enough" BUT looks can be deceiving(;-).

I chose Modbus because Mach3/4  already talks modbus and the RS485 is good for noise rejection qualities and long runs of cable.  

Also a Brain or macropump should be able to handle the interface between the 2.

SO what do you think ?

(;-) TP



Title: Re: Arduino Gurus ??
Post by: dude1 on May 07, 2015, 07:43:22 PM
Ray l on his post about his tool changer posted a code to do some of what you wont it in there somewear  http://www.cnczone.com/forums/novakon-systems/177997-tormach.html
Title: Re: Arduino Gurus ??
Post by: BR549 on May 07, 2015, 09:47:59 PM
OR could a PLC like a CUBLOC do the job ??

(;-) TP
Title: Re: Arduino Gurus ??
Post by: mrprecise44 on May 08, 2015, 02:21:38 AM
The Arduino can do nearly anything you want, and LED display is pretty easy. You can even make your own special fonts.

The Cubloc also is very capable, and it has a combination of Ladder Logic, and Basic, which can do lots. The Cubloc has a dedicated port for the keypad, which is basically "plug and play", and also a huge number of I/O. However, the keypad outputs an integer for each key, which requires a brain to do the action. It will also run on 24 volts, since it is really built for commercial applications.

I messed with the Arduino a couple of years back, and remember having difficulty getting a flat panel matrix keypad to work, but the Pokeys worked with the same matrix keypad without a problem. Probably something I did not understand going on regarding the Mega.

Pokeys also has a dedicated I/O for various keypads, and also can output to an LED display. Since the Pokeys has internal software to output Mach3 OEM codes, it is simpler to get things to work right without brains.

Using a Mega will require Modbus and brains to do the same things. They all have their strong points.

The Mega probably has the most digital I/O pins, and has 15 analog I/O. And, the Arduino forum has some really talented members; a lot of the discussion goes way over my head, although they will always chip in to help us "ordinary" guys.

Is it a basic Jog/rotary encoder Pendant you want to build, or something else? 

John
Title: Re: Arduino Gurus ??
Post by: TPS on May 08, 2015, 03:01:48 AM
i would also say, that the Arduino will do the job.
lot of software avaliable on the internet.
you should also think about modbus over TCP.
there is also software avaliable for the Arduino:

http://myarduinoprojects.com/modbus.html

Thomas
Title: Re: Arduino Gurus ??
Post by: BR549 on May 08, 2015, 09:46:57 AM
The pendant will use a thumbstick to jog.  The rotary encoders will be used to do the FRO and SSO.  RS485 or RS422 is selected for noise rejection. It will use a 25 foot cable to connect.  Mobus because Mach3 already understands Modbus.

I see a modual to do the Rs485 and to do Modbus and to do a keypad and to do the LCD. But I wonder IF there is enough CPU/Memory to do  them all at once ?.

(;-) TP

Title: Re: Arduino Gurus ??
Post by: patton on May 08, 2015, 10:51:51 AM
I was playing with an arduino for doing a spindle speed encoder over modbus. seems to me you could do about anything with the arduino's. I'm by no means an expert on any of it though. there might be some limitations to the cable length when using rs485. I've also read that arduino's don't work like a computer cpu so they don't handle multiple interupts very well... like if you were reading encoders for each axis.
Title: Re: Arduino Gurus ??
Post by: mrprecise44 on May 08, 2015, 12:22:08 PM
Where does the keypad fit into this?
Title: Re: Arduino Gurus ??
Post by: mrprecise44 on May 08, 2015, 12:49:23 PM
I can dig out my "Guru" hat. Got a bunch of Arduino's, LED screens, 1 USB Pokey, pots; and stuff. Pokey's has a built-in proportional jog/joystick pendant software that works pretty slick. They also make an Ethernet option, that would solve a cable length issue I believe. I don't think the Arduino would suffer from memory problem.


Title: Re: Arduino Gurus ??
Post by: BR549 on May 08, 2015, 12:51:26 PM
The 4x4 keypad matrix will be used to have 16 function buttons  9 human sized buttons for programable operational functions such as Cycle Start, Feedhold, rewind, Stop, GOTO Zero, etc

And 7 other smaller buttons for AUX functions.  Reset FRO to 100%( uses the switch on the encoder, Reset SSO to 100%(switch on encoder), Switch axis on the jog stick from XY to ZA(switch on thumstick), etc

The LEDs are for function indicators.

NO problem with long lengths of cable for Rs485 or Rs422 for that matter. I will use shielded Cat5 0r 6 cable.  The cable will also provide POWER to the pendant.  I can also use a Rs485 to USB convertor to be able to use a USB port to connect to the PC  for COM and power.

I am not really fond of PoKeys , would be best if Arduino or equivilate.



(;-) TP
Title: Re: Arduino Gurus ??
Post by: mc on May 08, 2015, 12:52:20 PM
I've kind of strayed away from Arduino's, however I have used them quite a bit.

It's probably doable with one of the newer ARM based arduinos, as I'd think you'd be pushing an Uno to manage all the above, and Mega's are not the cheapest of things to use (I built a fairly complex system using a Mega, but the cost of the AVR chip means it'll remain as a proto, and someday I'll probably port it over to something ARM based).

RS485 just needs a serial port along with a suitable driver chip.
If you opt for a serial based LCD display, it'll cost a couple bucks more, but greatly simplify code/chip resources.
4x4 matrix is easy, but you'll need 8 pins to use the Arduino library.
Rotary encoders should be realtively easy, as the ARM chips should handle the interrupts reasonably well (Uno only has 2, and Mega 3or4 Interrupt pins IIRC and some are shared, hence my suggestion for ARM as it's got far better interrupt configuration although I've never checked to see what Arduino has implemented). Off course you could go fro polling the pins instead of interrupts, it all depends on if you're happy to miss the odd pulse.
LEDS are pretty easy. Can either go for direct connected if you have enough pins left, or go for a hex output chip (they have a proper name, but my mind has gone blank!)

Ardiuno libraries are available for all of the above, but you'd need to check that they're compatible with the ARM based boards.

Title: Re: Arduino Gurus ??
Post by: BR549 on May 08, 2015, 01:01:47 PM
I have seen a plugin board for RS485 so that is not an issue.

Next item is WILL it all fit inside a CASE. I had one of the original T cases in mind. It already has the cutout for the display and ROOM for a good button jogstick  layout for both left and right handed users.

This could also end up with a Main board being produced to where you just plug in the aux boards ???

(;-) TP
Title: Re: Arduino Gurus ??
Post by: mc on May 08, 2015, 01:30:28 PM
I'd think you'd be looking at a custom PCB to keep within size constraints. Standard Arduino's are pretty large, although some of the smaller mini boards could probably be squeezed in, although you do lose some of the pins depending on the exact model.

Provided you're not in a rush, custom PCBs from China aren't that expensive, although assembling them can be a bit time consuming, as I very much doubt you'd be able to justify full production run costs/quantities.
Title: Re: Arduino Gurus ??
Post by: BR549 on May 08, 2015, 01:40:59 PM
IF any of yall already belong to one of the Arduino groups please run this by them. They may have ideas as well ?

IF it remained open source that would be great  or if someone wanted to offer kits ? or complete units ?

(;-) TP


Title: Re: Arduino Gurus ??
Post by: mc on May 08, 2015, 01:52:29 PM
It has given me an idea, but my free time for the next couple months is pretty limited, and I'm trying to avoid new projects until I get some existing ones finished!

As for posting elsewhere, I suspect the main groups that it would interest, would be Mach and LinuxCNC users. Arduino  have their own motion controller libraries but it won't have the ability to handle a hand controller due to lack of resources, and I'm not sure what other PC based machine controllers have the ability to handle customised serial interfaced inputs.
Title: Re: Arduino Gurus ??
Post by: mrprecise44 on May 08, 2015, 03:13:21 PM
Is the goal to produce a pendant "kit" concept for hobbyist builders, or to make an open source DIY schematic, or make a marketable, finished device for sale?

John
Title: Re: Arduino Gurus ??
Post by: BR549 on May 08, 2015, 03:45:32 PM
What do you think would be the best approach. I am just adding in info as to WHAT is needed to create a good working multi use Hand pendant for plasma work ( Noise rejection) with human sized buttons . I have found the Jog stick works extremely well for the application and the Encoder FRO/SSO work extremely well for the application. Both can be used with thin gloves on. ( the reason for large buttons(;-)).

The concept would work great for all other applications as well, router,etc.  Each button would be programable as to function so it is customizable to your useage.

It really does not matter to me how it is done as long as the general users get the benifits of the pendant.  

Some may want DIY, others full kit, others may want a finished product  .

Yall tell me what is best ?????

  
Title: Re: Arduino Gurus ??
Post by: dude1 on May 08, 2015, 08:11:22 PM
you have a big selections of board`s you could use the Leonardo, Yún, what are good for mouse, keyboard sort of stuff plus everything else the analog pins on these can be used for your screen the digital pins can be used for all the other bits you wont the Micro is the small version of the 32u4 boards.

the Arduino Due will do all you wont but its a lower voltage.

if you don't mind waiting and saving money you can get the board and bits from here, http://imall.iteadstudio.com/ I get all my electronic stuff from here never had a bad component.

your options are endless  
Title: Re: Arduino Gurus ??
Post by: mrprecise44 on May 09, 2015, 12:00:29 AM
If you would post a link to the case you have in mind, and a sketch of the button,keypad,screen placement, I would like to try making one using a Mega. 

Title: Re: Arduino Gurus ??
Post by: BR549 on May 26, 2015, 11:35:05 AM
Has anyone come up with a solution or More ideas to create a solution ?

(;-) TP