Using the serial port for a G-code function in EMC

More
05 Dec 2012 13:43 - 05 Dec 2012 14:46 #27229 by RayC
Hi everyone,

I'm looking to alter a Sherline mill to act as an automatic dispenser. I have an automatic dispensing controller with a four pin i/o. I wish to try to connect this to the CPU through the serial port (intermediary circuit?) and make it dispense on a G-code command from EMC2.

You must forgive my lack of expertise as I'm quite new to this.

I guess what I'm asking is where is the best place to start finding information regarding this or the best way to attack the problem. Would you use the serial port? The Sherline board I have has only X, Y, Z, A drivers and no extra i/o's, and uses the computer printer port.

Any help with this is muchly appreciated.

Ray

Edit: Primarily, I just need to get a signal from the serial port using EMC2 and a Gcode command. This could be for example M07 or M08 (usually coolant and flood), and M09 to turn off the dispenser.
Last edit: 05 Dec 2012 14:46 by RayC.

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

More
05 Dec 2012 16:47 - 05 Dec 2012 16:50 #27231 by cncbasher
take a look at this thread
linuxcnc.org/lucid/emc2/index.php/englis...wserial-port?start=6

the other way would be to use the arduino and USB theres a few threads on the forum

linuxcnc.org/index.php/english/forum/18-...uxcnc?start=36#26528
Last edit: 05 Dec 2012 16:50 by cncbasher.

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

More
05 Dec 2012 18:00 #27242 by cmorley
Do you wish just to use the serial port to 'bit-bang' the I/O
If I remember correctly you can output on 3 pins and input on 4 without using the serial protocol.
The only thing not so nice is the voltage level of on and off are positive and negative.
You would need a conversion circuit (not much) and probably build a HAL module (again not much)
or maybe a script file called by a custom gcode?

I'm sure I have an old article about doing this somewhere.....

I might try this some time I have some USB to serial converts laying around...

Chris M

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

More
05 Dec 2012 20:00 - 05 Dec 2012 20:01 #27245 by ArcEye

The Sherline board I have has only X, Y, Z, A drivers and no extra i/o's, and uses the computer printer port.


If all you want is some extra I/O to run auxiliary commands etc, easiest way would be to fit a PCI parport card, run another parport cable to another Breakout Board, then you can attach whatever you need via this without getting into any unusual set ups.
If you buy a BOB with built in relays that will simplify things even more.

You can keep it as a standard 'out' config or set it to 'in' and get pins 2-9 as input.

regards
Last edit: 05 Dec 2012 20:01 by ArcEye.

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

More
06 Dec 2012 07:49 #27270 by andypugh

If all you want is some extra I/O to run auxiliary commands etc, easiest way would be to fit a PCI parport card

Which is very cheap, but it is also worth bearing in mind the possibility of a Mesa 7i43 on the existing parport. ($70) . Or maybe even the Pluto board (though those are somewhat flaky)
The Pico PPMC also connects to the parport and multiplies the pins. It's very capable but not really comparable in price to a second parport (nor are it's capabilities comparable to a parport)

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

More
06 Dec 2012 08:36 #27272 by RayC
Hi again,

Thank you all for the useful suggestions.

These all sound like sound options. Which of these would be the most suitable for a novice?

Also, Is there any way I could just use the stepconfig wizard to allocate a different signal to the currently unused A-axis?

I could allocate the M08 and M09 commands to the A-axis cable perhaps to switch the signal to a breakout board? Would this be possible? Would this require some python scripting?

Thank you again for all your help, I will be sure to update on how this is going.

Ray

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

More
06 Dec 2012 08:49 #27275 by andypugh

Which of these would be the most suitable for a novice?

Well, the best solution is to move on from being a novice. I would certainly advocate spending the minimum of cash until you have enough experience to know what you want.
[quote[I could allocate the M08 and M09 commands to the A-axis cable perhaps to switch the signal to a breakout board? Would this be possible? Would this require some python scripting?[/quote]

All things are possible in HAL. HAL is not Python. Hal combines the user-friendliness of assembler with the programming power of Logo.
But, it's very useful and worth learning.

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

More
06 Dec 2012 16:30 - 06 Dec 2012 16:32 #27292 by ArcEye
HI

You need to be specific as to what you are trying to do.
Specifically what the 4 pins do and whether they are IN or OUT.
Do you just need to send signals or do you need to switch an actual feed to power something?

I have just looked at the sample sherline config hal files and you already have plenty of I/O if they are correct
They show no home or limit switches and without A axis, you have pins 8, 9, 11, 12, 13, 14, 15, 16 and 17 free.
I am not familiar with sherline save for seeing pictures, they are no used much over here.

Stepconf only gives a basic start, beyond that you need to edit the files by hand.
You will also need to open whatever controller sherline provide to change / add wiring.

A good start would be to attach your .hal and .ini files from your /config folder and address the first para.

regards
Last edit: 06 Dec 2012 16:32 by ArcEye.

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

Time to create page: 0.269 seconds
Powered by Kunena Forum