engraving depth setting in realtime

More
10 years 7 months ago #71692 by andypugh

wicki wrote: The number of pins, signals and functions is really overwhelming.....


It's a feature, we call it "Flexibility". There really is very little that you can't do in HAL.

This HAL file here uses it: electronicsam.com/images/emco/linuxcnc_c...Morph/emco-lathe.hal

Please Log in to join the conversation.

More
10 years 7 months ago #71718 by wicki

andypugh wrote:

wicki wrote: The number of pins, signals and functions is really overwhelming.....


It's a feature, we call it "Flexibility". There really is very little that you can't do in HAL.



Oh, yes - there is also a human feature called language - it is also very flexible.
But it took several years to use it ;-)

Thanks for all the hints.

With the collected information I now wrote this:
(and it seems to do what I want)
addf Z.update-output servo-thread
addf Z.update-feedback servo-thread
net zpos-cmd => Z.in
net zpos-fb => Z.fb-in
net zpos-cmd-corr Z.out
net zpos-fb-corr Z.fb-out
net zpos-offset Z.offset
unlinkp stepgen.2.position-cmd
unlinkp axis.2.motor-pos-fb
net zpos-cmd-corr => stepgen.2.position-cmd
net zpos-fb-corr => axis.2.motor-pos-fb

In the next step I will try to use this in a shell-script:

halcmd sets zpos-offset $offset

Please Log in to join the conversation.

More
10 years 7 months ago #71723 by andypugh

wicki wrote:

andypugh wrote: In the next step I will try to use this in a shell-script:

halcmd sets zpos-offset $offset


It would also be quite easy to connect it to a physical knob. I din't know if that would help.

Please Log in to join the conversation.

More
10 years 7 months ago #71795 by wicki
The china-caliper-solution is off the table now: to big and to sensitive.

Now I read a forked light barrier with a microcontroller. It delivers several 100 steps
on distance of 1/10mm.
The values are read via ttyUSB as ASCII numbers.
In a first test with an awk-script, it holds the Z-axis in place with a difference
from about two 1/100 mm.

Instead of an own script, which uses hacmd to move the Z-axis - is there an (easy)
way to read ttyUSB via HAL ?

Please Log in to join the conversation.

More
10 years 7 months ago #71797 by andypugh

Please Log in to join the conversation.

More
10 years 7 months ago #71801 by wicki
hmm.... sounds nice ;-)

but the PL2303 is not listed in
cat /proc/bus/input/devices

in lsusb its listed and I can read from it.

Bus 001 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Please Log in to join the conversation.

More
10 years 7 months ago #71803 by andypugh
You might be able to create a userspace Python HAL component that can read the data.

Does it show up in cat /proc/ioports ? If so then a realtime hal module might be able to get the data with rtapi_inb()
www.linuxcnc.org/docs/html/man/man3/rtapi_inb.3rtapi.html

Please Log in to join the conversation.

More
10 years 7 months ago #71814 by wicki

andypugh wrote: Does it show up in cat /proc/ioports ? If so then a realtime hal module might be able to get the data with rtapi_inb()


no, this is not a real serial interface. Its a usb-serial-converter.

Is it possible to let HAL read from a file, device or from shared-mem directly?
or is it necessary to create a component for this?

Please Log in to join the conversation.

More
10 years 7 months ago #71815 by andypugh
You need a simple component to put the data in shared-memory.

www.linuxcnc.org/docs/html/hal/halmodule.html

Please Log in to join the conversation.

More
10 years 7 months ago #71826 by andypugh
I just remembered that there are already HAL comps that do serial transfers to USB-serial devices.

Parts of this code might be useful to you:
github.com/LinuxCNC/linuxcnc/blob/master...anyang-vfd/hy_comm.c

Most of that file if huanyang-vfd specific.

Please Log in to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum