For anyone who was curious, I figured this out last night and it turned out
to be a lot easier than I thought. Basically, all I needed to do was use the
MPG howto from the wiki (
http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Hooking_Up_A_MPG_Pendant), and
instead of mapping the encoder inputs to the parallel port pins, I created a
phaseA and phaseB pin in my Python HAL component, and mapped to those. For
once, everything actually worked on the first try.

I did notice one small error on the wiki page, which was the omission of
'setp' in the calls to set axis.N.jog-vel-mode. I edited the page to add
this.

On Tue, Sep 28, 2010 at 1:14 PM, Colin Kingsbury <ckingsb...@gmail.com>wrote:

> So, thanks to an assist from Jeff Epler and Chris Radek, I've gotten my
> Arduino->HAL interface more or less fully functional with both inputs and
> outputs. My purpose for this is to build a human-machine interface (read:
> control panel for my mill). So far I've gotten it to turn input pins in
> HALUI on and off, and turn external LEDs on and off based on the status of
> output pins.
>
> What I'm wondering about is how best to work an encoder into this.
> Currently, the way I'm doing it is to have the arduino read the encoder
> outputs and convert them to a signal which represents one pulse in the CW or
> CCW direction. The Python script receives the signal, and then jogs the
> appropriate axis in the + or - direction for 1/10th of a second. So far, the
> motion seems smooth (on screen, I haven't tried it on one of my machines
> yet), but I'm wondering if there's a better way. The catch is that I'd like
> to keep this on the serial connection, both to save the parallel port pins,
> and also for the elegance of being able to do everything over the Arduino's
> USB cable.
>
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to