Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
On Mon, Jun 25, 2018 at 10:18:50AM -0400, Curtis Dutton wrote: > The place where ports are allocated is halcmd_commands.c line 687. That was > the easiest place I could find to do it. That code should probably be in > hal_lib.c and just be called by hal command. Should this line be dropped then? +printf(" portsizeGet/Set the buffer size of a port signal\n"); Jeff -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
On 26 June 2018 at 19:16, Curtis Dutton wrote: > Ok makes sense. I found the datapainter.vhd in the hostmot2 source code > downloaded from mesanet. Doesn't look like it is in the linuxcnc git yet. The hostmot2 in the LinuxCNC git is a bit behind. -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1916 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
On Tue, 26 Jun 2018, Curtis Dutton wrote: Date: Tue, 26 Jun 2018 14:16:16 -0400 From: Curtis Dutton Reply-To: EMC developers To: EMC developers Subject: Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT" Ok makes sense. I found the datapainter.vhd in the hostmot2 source code downloaded from mesanet. Doesn't look like it is in the linuxcnc git yet. The regmap file in the hostmot2 source shows the DataPainter register map (a little easier than trying to decipher the VHDL) On Tue, Jun 26, 2018 at 11:31 AM, andy pugh wrote: On 26 June 2018 at 02:30, Curtis Dutton wrote: > Peter that sounds great. Can I get some links into the relevant pieces? I'm > willing to work on this, and add to the hm2 driver, do some testing and get > something going after I finish my man pages. I have a 6i25 and a smart > serial IO card in my laser so I can test as I develop. I think this is unrelated to the smart-serial stream datatype. (So your smart-serial board is not relevant) The files that would need to be altered would be the same ones as were altered to add led support (I choose that one as being a very simple patch for a very simple feature). https://github.com/LinuxCNC/linuxcnc/commit/920b18a1e3c278c30ab5b99ad0e441 fbbc2010b9 Basically a new driver file, adding that to the makefile and a few changes in hostmot2.c / .h to recognise the tags and to know what to do with them. -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." ?? George Fitch, Atlanta Constitution Newspaper, 1916 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers Peter Wallace Mesa Electronics (\__/) (='.'=) This is Bunny. Copy and paste bunny into your (")_(") signature to help him gain world domination. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
Ok makes sense. I found the datapainter.vhd in the hostmot2 source code downloaded from mesanet. Doesn't look like it is in the linuxcnc git yet. On Tue, Jun 26, 2018 at 11:31 AM, andy pugh wrote: > On 26 June 2018 at 02:30, Curtis Dutton wrote: > > Peter that sounds great. Can I get some links into the relevant pieces? > I'm > > willing to work on this, and add to the hm2 driver, do some testing and > get > > something going after I finish my man pages. I have a 6i25 and a smart > > serial IO card in my laser so I can test as I develop. > > I think this is unrelated to the smart-serial stream datatype. (So > your smart-serial board is not relevant) > > The files that would need to be altered would be the same ones as were > altered to add led support (I choose that one as being a very simple > patch for a very simple feature). > > https://github.com/LinuxCNC/linuxcnc/commit/920b18a1e3c278c30ab5b99ad0e441 > fbbc2010b9 > > Basically a new driver file, adding that to the makefile and a few > changes in hostmot2.c / .h to recognise the tags and to know what to > do with them. > > -- > atp > "A motorcycle is a bicycle with a pandemonium attachment and is > designed for the especial use of mechanical geniuses, daredevils and > lunatics." > — George Fitch, Atlanta Constitution Newspaper, 1916 > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
On 26 June 2018 at 02:30, Curtis Dutton wrote: > Peter that sounds great. Can I get some links into the relevant pieces? I'm > willing to work on this, and add to the hm2 driver, do some testing and get > something going after I finish my man pages. I have a 6i25 and a smart > serial IO card in my laser so I can test as I develop. I think this is unrelated to the smart-serial stream datatype. (So your smart-serial board is not relevant) The files that would need to be altered would be the same ones as were altered to add led support (I choose that one as being a very simple patch for a very simple feature). https://github.com/LinuxCNC/linuxcnc/commit/920b18a1e3c278c30ab5b99ad0e441fbbc2010b9 Basically a new driver file, adding that to the makefile and a few changes in hostmot2.c / .h to recognise the tags and to know what to do with them. -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1916 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
Peter that sounds great. Can I get some links into the relevant pieces? I'm willing to work on this, and add to the hm2 driver, do some testing and get something going after I finish my man pages. I have a 6i25 and a smart serial IO card in my laser so I can test as I develop. On Mon, Jun 25, 2018 at 6:23 PM Peter C. Wallace wrote: > On Mon, 25 Jun 2018, Curtis Dutton wrote: > > > Date: Mon, 25 Jun 2018 10:24:26 -0400 > > From: Curtis Dutton > > Reply-To: EMC developers > > To: EMC developers > > Subject: Re: [Emc-developers] Pre-Pull Request Review: Better laser > engraver > > support + new HAL pin type "PORT" > > > > Andy, > >I will look into this. I believe I had a conversation with Peter a while > >back about getting a raster into Mesa cards. I plan on pursuing that. > Right > >now I have my servo thread rate jacked up higher on my laser to get a > >little more detail. A hardware version is a must for an industrial grade > >high speed engraver. > > > >This stream type would be our way into programming a hardware raster. > > > > I do have firmware for this now = DataPainter module > > This is a device similar to our stepgen hardware but instead of outputing > steps, it outputs bits or 8 bit PWM at the requested rate. The data comes > from > a small FIFO (32 deep by 32 wide) so can contain 1024 bits or 128 PWM > bytes. > If the host keeps the FIFO full and you allow 1/2 depletion, this gives > you a > 512 KHz maximum bit data rate at 1 KHz servo thread or a 64 Khz analog > data > rate using PWM. The stepgen arrangement allows "position locking" the data > stream to an axis, encoder, clock, calculated length, etc via PID to a > small > fraction of a bit time. A larger FIFO could be added if higher data rates > were > required (up to 10 MHz or so) > > There are start and stop compare registers for start of line and line end > raster data gating (so no fill data is needed) > > The bad news is that it is untested other tha basic data tests and that > there > is no hm2 driver for it yet (but there is a register map on the latest hm2 > source) > > > Peter Wallace > Mesa Electronics > > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
On Mon, 25 Jun 2018, Curtis Dutton wrote: Date: Mon, 25 Jun 2018 10:24:26 -0400 From: Curtis Dutton Reply-To: EMC developers To: EMC developers Subject: Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT" Andy, I will look into this. I believe I had a conversation with Peter a while back about getting a raster into Mesa cards. I plan on pursuing that. Right now I have my servo thread rate jacked up higher on my laser to get a little more detail. A hardware version is a must for an industrial grade high speed engraver. This stream type would be our way into programming a hardware raster. I do have firmware for this now = DataPainter module This is a device similar to our stepgen hardware but instead of outputing steps, it outputs bits or 8 bit PWM at the requested rate. The data comes from a small FIFO (32 deep by 32 wide) so can contain 1024 bits or 128 PWM bytes. If the host keeps the FIFO full and you allow 1/2 depletion, this gives you a 512 KHz maximum bit data rate at 1 KHz servo thread or a 64 Khz analog data rate using PWM. The stepgen arrangement allows "position locking" the data stream to an axis, encoder, clock, calculated length, etc via PID to a small fraction of a bit time. A larger FIFO could be added if higher data rates were required (up to 10 MHz or so) There are start and stop compare registers for start of line and line end raster data gating (so no fill data is needed) The bad news is that it is untested other tha basic data tests and that there is no hm2 driver for it yet (but there is a register map on the latest hm2 source) Peter Wallace Mesa Electronics -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
Andy, I will look into this. I believe I had a conversation with Peter a while back about getting a raster into Mesa cards. I plan on pursuing that. Right now I have my servo thread rate jacked up higher on my laser to get a little more detail. A hardware version is a must for an industrial grade high speed engraver. This stream type would be our way into programming a hardware raster. On Mon, Jun 25, 2018 at 7:33 AM, andy pugh wrote: > On 25 June 2018 at 01:41, Curtis Dutton wrote: > > > A HAL_PORT pin allows for a writer component to send many bytes in one > > operation to a reader component in real time. > > The Mesa Smart-Serial protocol defines a "stream" data type: > https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/ > drivers/mesa-hostmot2/sserial.h#L79 > > But the HAL driver currently does nothing with it: > https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/ > drivers/mesa-hostmot2/sserial.c#L420 > > It is probably worth trying to keep these compatible, as I think that > they have the same intent. > > -- > atp > "A motorcycle is a bicycle with a pandemonium attachment and is > designed for the especial use of mechanical geniuses, daredevils and > lunatics." > — George Fitch, Atlanta Constitution Newspaper, 1916 > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
Jeff, You are correct. The hal port operates at a lower level than hal_stream calls. It is a byte stream, untyped and asynchronous in that a write or read from the port can consume up to the buffer size of the port in a single period. So you could build a sampler, or hal stream on top of a hal port. I will write up some manpages next. I've never done that before so I'll have to bone up on them. The place where ports are allocated is halcmd_commands.c line 687. That was the easiest place I could find to do it. That code should probably be in hal_lib.c and just be called by hal command. On Sun, Jun 24, 2018 at 9:38 PM, Jeff Epler wrote: > This is exciting, thank you. > > Can you please mention how this compares/contrasts with > streamer/sampler, which have been factored into hal_stream_XXX API calls > in our master branch? > > From what I can see, > - hal "streams" are typed > - hal "streams" are agreed on by allocating small integers, not names > - hal "streams" storage are outside of the primary HAL shared memory area > > .. it looks like > - hal "ports" are untyped (byte oriented) > - hal "ports" are named > - hal "ports" storage are inside the primary HAL shared memory area > > I didn't actually spot the implementation of 'halcmd portsize', just the > addition of it to halcmd's help message > +printf(" portsizeGet/Set the buffer size of a port > signal\n"); > > I would love it if there were manpages for these new functions. You can > write manpages in good old fashioned roff style in docs/man/man3/*.3hal or > in more modern asciidoc style in docs/src/man/man3/*.txt. Ask if you > need help with markup or Makefiles, some (Sub)makefile might be needed > for asciidoc pages. > > Jeff > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
On 25 June 2018 at 01:41, Curtis Dutton wrote: > A HAL_PORT pin allows for a writer component to send many bytes in one > operation to a reader component in real time. The Mesa Smart-Serial protocol defines a "stream" data type: https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/drivers/mesa-hostmot2/sserial.h#L79 But the HAL driver currently does nothing with it: https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/drivers/mesa-hostmot2/sserial.c#L420 It is probably worth trying to keep these compatible, as I think that they have the same intent. -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1916 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
This is exciting, thank you. Can you please mention how this compares/contrasts with streamer/sampler, which have been factored into hal_stream_XXX API calls in our master branch? >From what I can see, - hal "streams" are typed - hal "streams" are agreed on by allocating small integers, not names - hal "streams" storage are outside of the primary HAL shared memory area .. it looks like - hal "ports" are untyped (byte oriented) - hal "ports" are named - hal "ports" storage are inside the primary HAL shared memory area I didn't actually spot the implementation of 'halcmd portsize', just the addition of it to halcmd's help message +printf(" portsizeGet/Set the buffer size of a port signal\n"); I would love it if there were manpages for these new functions. You can write manpages in good old fashioned roff style in docs/man/man3/*.3hal or in more modern asciidoc style in docs/src/man/man3/*.txt. Ask if you need help with markup or Makefiles, some (Sub)makefile might be needed for asciidoc pages. Jeff -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
I have been plying with your sim, this is absolutely awesome! Fantastic work. Cheers, Kurt On Sun, Jun 24, 2018 at 8:41 PM, Curtis Dutton wrote: > Last year I retrofitted my laser engraver with linuxcnc. I do both > rastering and vector cutting on my laser, and it is a 4 axis laser as I do > complicated raster and vector cutting on 3D objects. > > I found existing solutions out on the web but they weren't quite adequate > for my needs. Because I have a 4 axis laser (XYZA), controlling vector > power using the Z axis was out. Also my raster files are sometimes 200Mb > and streaming raster data at the servo period rate via gstreamer takes > quite a long time. I also did not want to have a separate raster data file > alongside the gcode file. > > To solve these and some other problems I needed a way to pipe data through > the HAL at a rate much greater than what could be achieved with 1 data > point per servo cycle. Thus the HAL_PORT pin type was born. The idea was > taken from machine kit ring buffers. > > A HAL_PORT pin allows for a writer component to send many bytes in one > operation to a reader component in real time. The PORT pins behave just > like any other pin in HAL and can be linked, unlinked etc... > > In addition to the modifications to make hal ports some other modifications > and new parts were required. > > halcompile.g - added port type. Also added (pin,param,variable)_ptr macros > to allow access to the actual pointer to those values. > > pyhal.py - similar to the other python component pyhal.py uses the ctypes > python library to interface with hal, which is significantly less code than > the halmodule.cc python wrapper that currently exists. > > laserpower.comp - allows vector control of a laser, scaling power during a > move and has no limitations of number of joints a machine can have. > > raster.comp along with a python raster.py programming module to control the > raster, this allows control of the raster component from user space. > > remapping of M codes to control the raster.py raster programming component. > > > Included is also some tests > /tests/pyhal - also tests hal_port implementation > /tests/raster - tests the rastering component and raster.py programming > interface > > Included is also a sim config detailing how to implement a laser engraver > with vector and raster support. In /configs/sim/axes/laser > > > I have been using this in production for a few months now. I am open to any > and all suggesstions on how to structure, features, functions, etc. > > I also think that the HAL_PORT can be used as a primitive to build or > replace a lot of code. Maybe even NML and other forms of shared memory > magic. > > Eventually I would like to get this merged into master. I'm open to doing > this in an incremental type fashion so as not to disturb too much at one > time. This is my first "PULL request" with linuxcnc so forgive my ignorance > with regards to this process. > > Link to commit, merged with latest master > > https://github.com/OKComputers/linuxcnc/commit/ > 0afff760caa3f96d47d9934dc4d07765d40f2591 > > Thanks, > Curtis > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
[Emc-developers] Pre-Pull Request Review: Better laser engraver support + new HAL pin type "PORT"
Last year I retrofitted my laser engraver with linuxcnc. I do both rastering and vector cutting on my laser, and it is a 4 axis laser as I do complicated raster and vector cutting on 3D objects. I found existing solutions out on the web but they weren't quite adequate for my needs. Because I have a 4 axis laser (XYZA), controlling vector power using the Z axis was out. Also my raster files are sometimes 200Mb and streaming raster data at the servo period rate via gstreamer takes quite a long time. I also did not want to have a separate raster data file alongside the gcode file. To solve these and some other problems I needed a way to pipe data through the HAL at a rate much greater than what could be achieved with 1 data point per servo cycle. Thus the HAL_PORT pin type was born. The idea was taken from machine kit ring buffers. A HAL_PORT pin allows for a writer component to send many bytes in one operation to a reader component in real time. The PORT pins behave just like any other pin in HAL and can be linked, unlinked etc... In addition to the modifications to make hal ports some other modifications and new parts were required. halcompile.g - added port type. Also added (pin,param,variable)_ptr macros to allow access to the actual pointer to those values. pyhal.py - similar to the other python component pyhal.py uses the ctypes python library to interface with hal, which is significantly less code than the halmodule.cc python wrapper that currently exists. laserpower.comp - allows vector control of a laser, scaling power during a move and has no limitations of number of joints a machine can have. raster.comp along with a python raster.py programming module to control the raster, this allows control of the raster component from user space. remapping of M codes to control the raster.py raster programming component. Included is also some tests /tests/pyhal - also tests hal_port implementation /tests/raster - tests the rastering component and raster.py programming interface Included is also a sim config detailing how to implement a laser engraver with vector and raster support. In /configs/sim/axes/laser I have been using this in production for a few months now. I am open to any and all suggesstions on how to structure, features, functions, etc. I also think that the HAL_PORT can be used as a primitive to build or replace a lot of code. Maybe even NML and other forms of shared memory magic. Eventually I would like to get this merged into master. I'm open to doing this in an incremental type fashion so as not to disturb too much at one time. This is my first "PULL request" with linuxcnc so forgive my ignorance with regards to this process. Link to commit, merged with latest master https://github.com/OKComputers/linuxcnc/commit/0afff760caa3f96d47d9934dc4d07765d40f2591 Thanks, Curtis -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers