584,812 active members*
5,276 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2) > Need some general help understanding what EMC2 is capable of...
Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2007
    Posts
    32

    Need some general help understanding what EMC2 is capable of...

    Hello-

    as the title states, I'm in need of some help understanding the capabilities of emc2. I used emc2 to control a stepper based harbor freight mill that I put together which used the parallel port as the controller<-->driver interface. It worked great, and the stepper control through the parallel port was very simple.

    I now have a much bigger mill, a Lagun 2cnc with an anilam controller and wanted to look into how difficult a controller re-fit would be.

    My question is as follows- regarding the use of servos with emc2, what inputs and outputs does the emc2 software expect to be used?

    I see a lot of people mentioning systems like Mesa electronics or the fpga based pluto board for hardware interfaces between emc2 and the servo drivers, but what exactly are these systems doing? does it vary driver to driver?

    Regarding the motors and drivers already on the machine, I'm not even sure of what type of input they take- it seems to be 0-5v analog signals correlated with the rpms- What interfaces would be used to give emc2 the ability to output analog values (or what interface can I expect to carry digital info to a D/A device) ?

    what hardware is allowing for the "HAL oscope" on this page:
    http://wiki.linuxcnc.org/cgi-bin/emc...rvo_Amplifiers ??

    I'm seeing the hardware abstraction layer subject come up qhuite a lot but im falling short of understanding its role in the whole system's process... the wiki page doesnt seem to cover all that much of its capabilities...

    someone mind simplifying how HAL is applied for me?
    maybe hint at how it might help me get bytes out for analog conversion or something?

    thanks for any help!

    -pat

  2. #2
    Join Date
    Mar 2004
    Posts
    369
    Quote Originally Posted by p27182 View Post
    Hello-

    My question is as follows- regarding the use of servos with emc2, what inputs and outputs does the emc2 software expect to be used?
    Although you can control some servo drives from the parallel port, just like a stepper system, you can quickly run out of I/O pins, and the ability of the software encoder counter to keep up with encoders will limit your speed.

    So, you would normally have encoders feeding position information back to a hardware encoder counter, and an interface device sending the appropriate velocity command to a servo amplifiers of some type. Analog velocity servo amplifiers usually take a +/- 10 V analog velocity command,
    PWM-input servo amps take a digital signal where pulse width is proportional to desired velocity, and step/dir servo drives tale signals just like stepper drives.
    Regarding the motors and drivers already on the machine, I'm not even sure of what type of input they take- it seems to be 0-5v analog signals correlated with the rpms- What interfaces would be used to give emc2 the ability to output analog values (or what interface can I expect to carry digital info to a D/A device) ?
    Most likely is is a signed analog value from -10 V to +10 V, zero volts would command zero velocity. But, some drives do use other ranges and scale factors. Yes, you would need a digital to analog converter to drive the servo amp. My PPMC interface, for instance, has a 16-bit DAC on it for each channel.
    what hardware is allowing for the "HAL oscope" on this page:
    http://wiki.linuxcnc.org/cgi-bin/emc...rvo_Amplifiers ??
    That's my page, so it has some things specific to using my PWM-input servo amps with my Universal PWM Controller board (UPC). But, in general, there are several products from other vendors that do a very similar job. So, the servo amp drives the motor, and the UPC board counts encoder signals and genrates the PWM waveform for the amp. These are the things you need to control the servo motor. Halscope could be seeing essentially the same thing without any hardware at all other than the parallel port, although the encoder count rates would be limited by the software.

    HalScope is a SOFTWARE oscilloscope, so it does not require any hardware, by ITSELF, to function. It can grab any HAL signal in the entire EMC2 system and display it in graphical form.
    I'm seeing the hardware abstraction layer subject come up qhuite a lot but im falling short of understanding its role in the whole system's process... the wiki page doesnt seem to cover all that much of its capabilities...

    someone mind simplifying how HAL is applied for me?
    maybe hint at how it might help me get bytes out for analog conversion or something?
    HAL is the language that connects many of the parts of EMC2. It connects the motion controller to whatever it is that makes motors move, so that the "upper parts" of EMC can completely ignore the details of how movement is achieved. It also allows a great deal of flexibility in how a machine is structured (although EMC1 had this capability before) so robots, Stewart platforms and Cartesian machine can be set up to be commanded in XYZ positions. It is also used to connect all the auxilliary I/O such as tool changers and special fixture operations from G-codes to hardware. There is quite a bit of detail in the integrators manual, I think.

    HAL won't help you "get bytes out for analog conversion" directly. You need a DAC and a driver for EMC2 for that DAC. Easiest is to use one that is already made for the purpose, with a driver already written for EMC2.

    Jon

  3. #3
    Join Date
    Mar 2004
    Posts
    1661
    As Jon says, it's easy to run out of pins. If that's the case you can add another port though.

    I think your question is more in the range of "what can be done" instead of what EMC2 is capable of. EMC2 is extremely capable, I use it but I'm just scraping the surface. There are uge production machine retrofits with working tool changers, and robots and plotters, and...
    With two things - patience and the will to make it yourself - you can do remarkable things with EMC2. The wiki, the mailing list and the IRC is your guide to the galaxy.

    Regards,
    Sven

  4. #4
    Join Date
    Feb 2007
    Posts
    32
    First of, thanks for the replies, they are much appreciated!

    Quote Originally Posted by jmelson View Post
    Yes, you would need a digital to analog converter to drive the servo amp. My PPMC interface, for instance, has a 16-bit DAC on it for each channel.
    would you mind linking me to this particular interface card/device? This is the info I was looking for! I ultimatley need to know what hardware I have to buy/make and how I can get EMC2 to talk to that hardware. I suppose if it came down to it, I could program my FPGA board I've got to basicallly translate stepper-like-instructions from emc2 into the +/-10v values and also interpret the glass scale and encoders, which wouldnt be too bad a challenege if I can find a simple DAC accesory for the board I have... what do you think? is there an easier way to do it with parts that plug and play almost?

    That's my page, so it has some things specific to using my PWM-input servo amps with my Universal PWM Controller board (UPC). But, in general, there are several products from other vendors that do a very similar job. So, the servo amp drives the motor, and the UPC board counts encoder signals and genrates the PWM waveform for the amp. These are the things you need to control the servo motor. Halscope could be seeing essentially the same thing without any hardware at all other than the parallel port, although the encoder count rates would be limited by the software.

    HalScope is a SOFTWARE oscilloscope, so it does not require any hardware, by ITSELF, to function. It can grab any HAL signal in the entire EMC2 system and display it in graphical form.
    but what was HALscope getting those analog values from? your PPMC int?
    forgive my ignorance but what is a "HAL signal"? is it basically just a variable in the EMC2 environment? so it's not necessarily realized physically?

    HAL is the language that connects many of the parts of EMC2. It connects the motion controller to whatever it is that makes motors move, so that the "upper parts" of EMC can completely ignore the details of how movement is achieved. It also allows a great deal of flexibility in how a machine is structured (although EMC1 had this capability before) so robots, Stewart platforms and Cartesian machine can be set up to be commanded in XYZ positions. It is also used to connect all the auxilliary I/O such as tool changers and special fixture operations from G-codes to hardware. There is quite a bit of detail in the integrators manual, I think.
    I'll certainly be looking into this... THANKS!

    HAL won't help you "get bytes out for analog conversion" directly. You need a DAC and a driver for EMC2 for that DAC. Easiest is to use one that is already made for the purpose, with a driver already written for EMC2.

    Jon
    Ok, so you already kinda answered my other question, but do you know where I can get some information on what kinda options (hardware/driver) wise are available?

    Thanks again! your assistance is much appreciated!
    -Pat

  5. #5
    Join Date
    Mar 2004
    Posts
    369
    Quote Originally Posted by p27182 View Post
    First of, thanks for the replies, they are much appreciated!



    would you mind linking me to this particular interface card/device? This is the info I was looking for!
    http://pico-systems.com/oscrc4/catal...ex.php?cPath=8

    This is a flexible set of boards, but you basically need a motherboard with card cage, and one each DAC, Encoder and DIO to make the basic system. (I didn't include this info in my first message as I didn't want it to come off as a sales pitch.) Stuart Stevenson at MPM in Wichita has these on 3 of his machines there, and I use it on my Bridgeport mill.
    I ultimatley need to know what hardware I have to buy/make and how I can get EMC2 to talk to that hardware. I suppose if it came down to it, I could program my FPGA board I've got to basicallly translate stepper-like-instructions from emc2 into the +/-10v values and also interpret the glass scale and encoders, which wouldnt be too bad a challenege if I can find a simple DAC accesory for the board I have... what do you think? is there an easier way to do it with parts that plug and play almost?
    Well, the problem with doing all this in an FPGA is how do you tune the servo response? Also, translating the software-generated step pulses with their ragged timing to a finely tuned servo system will result in rough, gravelly motion. Not a good plan at all.

    but what was HALscope getting those analog values from? your PPMC int?
    Yes, ppmc.0.encoder.00.position is a sign-extended, scaled floating-point representation
    of the raw encoder counts from the PPMC interface. ppmc.0.encoder.00.delta is a raw velocity computed from the number of raw encoder counts per servo sample. pid.0.output is from EMC2's PID calculation, and is the command going into the PWM generator.
    forgive my ignorance but what is a "HAL signal"? is it basically just a variable in the EMC2 environment? so it's not necessarily realized physically?
    Not quite, but close. Not all variables in EMC2 are available to HAL. But, most any related to the external environment, axes, tools, spindles, limits, etc. are made available as HAL "pins". A pin is similar to an electrical terminal on some module. A HAL "signal" is similar to a wire that has one source of signal and can convey that signal to several places. So, HAL "components" perform various functions (hardware interfaces or device drivers, AND, OR, SUM, PID, etc.) and every component has a few input and output pins. Some components like AND just have HAL pins, and affect nothing on the outside. The PPMC device driver component makes the logical connection to the PPMC hardware through the parallel port, and obviously its purpose is to sense and affect something outside the computer.

    This is all in the HAL manual at http://www.linuxcnc.org/docs/HAL_User_Manual.pdf

    Ok, so you already kinda answered my other question, but do you know where I can get some information on what kinda options (hardware/driver) wise are available?
    I have servo amps for use with both brush and brushless motors, and a servo controller to go with those. That is different than the PPMC as it is all digital. But, if your servo amps are in good working order, and you have documentation on what terminal does what, it is best to keep them. A good analog velocity servo gives the smoothest motion. If you DON'T have working servo amps, then you have a wide variety of choices. Some really good (and CHEAP!!) brushless motors are now coming out of China, and I am quite impressed by them. I have been testing out
    a few of them with my brushless amp.

    Jon

  6. #6
    Join Date
    Feb 2007
    Posts
    32
    Quote Originally Posted by jmelson View Post
    http://pico-systems.com/oscrc4/catal...ex.php?cPath=8

    This is a flexible set of boards, but you basically need a motherboard with card cage, and one each DAC, Encoder and DIO to make the basic system. (I didn't include this info in my first message as I didn't want it to come off as a sales pitch.) Stuart Stevenson at MPM in Wichita has these on 3 of his machines there, and I use it on my Bridgeport mill.

    Well, the problem with doing all this in an FPGA is how do you tune the servo response? Also, translating the software-generated step pulses with their ragged timing to a finely tuned servo system will result in rough, gravelly motion. Not a good plan at all.

    Yes, ppmc.0.encoder.00.position is a sign-extended, scaled floating-point representation
    of the raw encoder counts from the PPMC interface. ppmc.0.encoder.00.delta is a raw velocity computed from the number of raw encoder counts per servo sample. pid.0.output is from EMC2's PID calculation, and is the command going into the PWM generator.

    Not quite, but close. Not all variables in EMC2 are available to HAL. But, most any related to the external environment, axes, tools, spindles, limits, etc. are made available as HAL "pins". A pin is similar to an electrical terminal on some module. A HAL "signal" is similar to a wire that has one source of signal and can convey that signal to several places. So, HAL "components" perform various functions (hardware interfaces or device drivers, AND, OR, SUM, PID, etc.) and every component has a few input and output pins. Some components like AND just have HAL pins, and affect nothing on the outside. The PPMC device driver component makes the logical connection to the PPMC hardware through the parallel port, and obviously its purpose is to sense and affect something outside the computer.

    This is all in the HAL manual at http://www.linuxcnc.org/docs/HAL_User_Manual.pdf


    I have servo amps for use with both brush and brushless motors, and a servo controller to go with those. That is different than the PPMC as it is all digital. But, if your servo amps are in good working order, and you have documentation on what terminal does what, it is best to keep them. A good analog velocity servo gives the smoothest motion. If you DON'T have working servo amps, then you have a wide variety of choices. Some really good (and CHEAP!!) brushless motors are now coming out of China, and I am quite impressed by them. I have been testing out
    a few of them with my brushless amp.

    Jon
    wow, that's impressive! :banana:

    so, I'm about to go diving into the HAL manual and figured I'd ask if you have manuals or datasheets for each product? maybe to read alongside the HAL business? I guess the HAL manual explains the driver subject and whatnot too huh... I'll follow up after lookin into it.

    thanks again man!

    -pat

  7. #7
    Join Date
    Oct 2008
    Posts
    78
    I used the Mesa PCI card it is a FPGA and there a driver package for EMC2. Look at the 5I20 with a 7i33 and 7i37 at www.mesanet.com With it you can run 4 axis with encoder feedback and 24 o/i points per 7i37.

    Donnie

  8. #8
    Join Date
    Mar 2004
    Posts
    369
    Quote Originally Posted by p27182 View Post
    wow, that's impressive! :banana:

    so, I'm about to go diving into the HAL manual and figured I'd ask if you have manuals or datasheets for each product? maybe to read alongside the HAL business? I guess the HAL manual explains the driver subject and whatnot too huh... I'll follow up after lookin into it.

    thanks again man!

    -pat
    Well, on this page http://jelinux.pico-systems.com/PPMC.html
    there are links to each board, and on those pages there are additional
    links to pinouts, sample wiring diagrams, etc.

    If you need further info, I can whip up a drawing with specific connection info for
    your configuration. If I haven't already worked out how to interface the PPMC to
    your specific servo amps, I could do that.

    Jon

  9. #9
    Join Date
    Feb 2007
    Posts
    32
    Quote Originally Posted by jmelson View Post
    Well, on this page http://jelinux.pico-systems.com/PPMC.html
    there are links to each board, and on those pages there are additional
    links to pinouts, sample wiring diagrams, etc.

    If you need further info, I can whip up a drawing with specific connection info for
    your configuration. If I haven't already worked out how to interface the PPMC to
    your specific servo amps, I could do that.

    Jon
    Jon- you're help is very much appreciated!

    I'm currently in the process of acquiring some national instruments daq hardware to figure out what kinda IO and protocols I'll be dealing with, so with this in mind I'll email you asking for general quote on how much your hardware will cost me.

    Thanks again
    -Pat

  10. #10
    Join Date
    Feb 2007
    Posts
    32

    Talking

    OK, I've finally managed to finger through the HAL manual, and there's certainly lots of good stuff in there, but I unfortunately didn't really find what I was initially looking for...

    let me propose (I'm not sure if my proposal is even feasible) and ask this, if I were to configure emc2/hal to function with external hardware to control 4 servos, monitor 4 encoders, 3 limit switches, control spindle speed etc etc etc,
    what would I see going on at the parallel port if i were to hit it with a logic analyzer or o-scope? and how would these parameters of the parallel port be configured? would I need more than one? Where can I find details of the IO config?

    Thanks again!
    -Pat

    edit:
    Quote Originally Posted by DonnieET View Post
    I used the Mesa PCI card it is a FPGA and there a driver package for EMC2. Look at the 5I20 with a 7i33 and 7i37 at www.mesanet.com With it you can run 4 axis with encoder feedback and 24 o/i points per 7i37.

    Donnie
    Donnie could you link me to the driver information for the mesa stuff? I'm having more trouble than expected googling for the info.
    Thanks!

    AHA!

    http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?HostMot2

    found it.

    thx tho.
    -pat

  11. #11
    Join Date
    Nov 2005
    Posts
    496
    It's not very feasible to run servos directly from the parport. What Jon's card and Mesa's parport cards do is use the parport to communicate to the fPGA chip on board.
    The FPGA chip does the actual counting of pulses and sending of pwm pulses etc.
    So to answer your question if you connected an o-scope to the parport, you would only see the data that is being sent to the FPGA.
    HAL is how you configure any I/O of EMC2.
    If you are using Jon's card then the PPMC driver is how you configure it.
    if using MESA products then most likely the HOSTMOT2 driver.
    if using the parport directly (usually for step machines or extra I/O points) then the parport driver is what is used.

    Exactly what I/O details do you want to see?
    The mesa 5i20 card has 72 points of I/O it is PCI
    the mesa 7133 card has 48 points of I/O it is parport
    The HOSTMOT driver for these cards can configure them into many different
    amounts of encoder counter, pwm generator and general purpose I/O (GPIO).
    This talks about HOSTMOT2:
    http://www.linuxcnc.org/docs/2.3/htm..._hostmot2.html

    John's Pico PWM card is a little different as it's I/O is more specific:
    4 encoder counters, 4 pwm generators, 16 GPIO
    his PPMC has 4 DAC generators 4 encoder counters and 17 GPIO
    Here is the info on the PPMC driver:
    http://www.linuxcnc.org/docs/2.3/htm...pico_ppmc.html

    All of those cards will control at least 4 servo axis.
    Mesa's cards are more flexible, the driver is newer (less proven for odd-ball bugs)
    John's cards are less flexible, the driver is older (so more proven)
    Each of them have been used by lots of people and are capable.

    Here is a link to more I/O hardware known to work:
    http://wiki.linuxcnc.org/cgi-bin/emc...orted_Hardware

  12. #12
    Join Date
    Mar 2004
    Posts
    369
    Quote Originally Posted by p27182 View Post
    OK, I've finally managed to finger through the HAL manual, and there's certainly lots of good stuff in there, but I unfortunately didn't really find what I was initially looking for...

    let me propose (I'm not sure if my proposal is even feasible) and ask this, if I were to configure emc2/hal to function with external hardware to control 4 servos, monitor 4 encoders, 3 limit switches, control spindle speed etc etc etc,
    what would I see going on at the parallel port if i were to hit it with a logic analyzer or o-scope? and how would these parameters of the parallel port be configured? would I need more than one? Where can I find details of the IO config?


    -pat
    OK, assuming you were using the PPMC board set, or the Universal PWM controller (very similar architecture), then every millisecond, the computer would send out an address command, then send a byte to command the encoder counters to latch the counts of all axes into holding registers. It would then send out another address command and then read back 12 bytes of position and 3 bytes of digital I/O status. It is 12 bytes because there are 3 bytes (24 bits) per axis. The computer would calculate a new velocity for each axis and then send out an address command and then write out 16 bytes of velocity info, and then another address and 2 or 3 bytes of digital I/O output info.

    As for how to set it up, sample config files are included with EMC2, see the sample-configs directory and look under the ppmc or univpwm
    directories.

    This would look entirely different with different external hardware, of course.

    Jon

Similar Threads

  1. Steel Capable Benchtop Mills
    By 2_many_hobbies in forum Benchtop Machines
    Replies: 59
    Last Post: 09-14-2009, 05:17 PM
  2. DIY 3 Axis capable of 4A?
    By Curtisbeef in forum Stepper Motors / Drives
    Replies: 2
    Last Post: 05-21-2008, 07:31 AM
  3. General understanding of more than 3 axis help please!
    By Dongle in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 9
    Last Post: 02-22-2006, 03:45 PM
  4. Assembly line capable milling machine
    By MrRage in forum Uncategorised MetalWorking Machines
    Replies: 6
    Last Post: 09-14-2005, 01:21 AM
  5. Which Cam Software Is The Most Capable?
    By wild01 in forum Uncategorised CAM Discussion
    Replies: 13
    Last Post: 07-18-2005, 10:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •