Charge Pump


Results 1 to 9 of 9

Thread: Charge Pump

  1. #1
    Registered cadmonkey's Avatar
    Join Date
    Mar 2006
    Location
    USA
    Posts
    304
    Downloads
    0
    Uploads
    0

    Question Charge Pump

    The manual(s) seem to be lacking on charge pump operation and this being my first foray into the world of CNC I have a couple questions:

    1. Does the charge pump run non stop from the time you open EMC till you close it (or it crashes) or does it stop on E-Stop condition?

    2. To add it to my setup do I need to add anything other than the following 4 lines to my machines .hal file:
    loadrt charge_pump
    net charge-pump <= charge.pump-out
    addf charge-pump base-thread
    net charge-pump => parport.0.pin-xx-out

    My intention is to have the charge pump wait for EMC to be running then close a contactor supplying the stepper controller powersupply and the mill control circuitry. That limits me to one power button as opposed to 3. I may even add a relay to drop the panel power switch out once the charge pump engages so that I can't accidentally bump it and upset the OS at all. But I don't want the mill and power supply to be shutdown completely with the activation of E-Stop, just stop motion and spindle rotation.

    Am I correct or am I a resident of left field?

    Similar Threads:
    Every day is a learning process, whether you remember yesterday or not is the hard part.
    www.distinctperspectives.com


  2. #2
    Registered
    Join Date
    Apr 2004
    Location
    Martinez, CA
    Posts
    40
    Downloads
    0
    Uploads
    0

    Default

    This caught my eye so I looked at the charge_pump component: http://cvs.linuxcnc.org/cvs/emc2/src...arge_pump.comp

    It appears that it outputs a square wave (at half the frequency of the thread you run it in) as long as the enable bit is on:

    FUNCTION(_) {
    if ( enable ) {
    out = !out;
    } else {
    out = 0;
    }
    }
    (this looks funny because the forum chops the indenting spaces)

    The input pin is "enable", and the output pin is "out", so you could connect the e-stop signal to the enable pin (probably after inverting it) to get what you want.
    I'm not sure if there's already an inverted e-stop signal indicating the absence of e-stop, that might save a little bit of trouble.



  3. #3
    Registered
    Join Date
    May 2007
    Location
    US
    Posts
    781
    Downloads
    0
    Uploads
    0

    Default

    That is what the code tags are for.
    Push the button at the top right of the edit window and put your code between them.

    Code:
    FUNCTION(_) {
        if ( enable ) {
            out = !out;
        } else {
            out = 0;
        }
    }




  4. #4
    Registered cadmonkey's Avatar
    Join Date
    Mar 2006
    Location
    USA
    Posts
    304
    Downloads
    0
    Uploads
    0

    Default

    Ok, after a quick glance at my old Essential Guide to ANSI C - I understand what the function is doing, inverting the output each time it is ran IF it's enabled.

    How do I set it to always be enabled via the .hal file though? If I connect it to E-Stop it's still going to toggle at some point. I want it to run if EMC2 is running - never toggle. E-Stop only shut down the amplifier enable bit and the spindle enable bit. I also posted to the mailing list (I think...hope I did it right...)

    EDIT - Ok after reading more of the CVS info :
    Code:
    pin out bit out "Square wave if 'enable' is TRUE or unconnected, low if 'enable' is FALSE";
    Would indicate that if it isn't connected to an input bit - it's enabled - am I interpreting that correct? Also, how would I get another thread started that would run the charge pump at 12.5KHz?

    Am I going about this an overly complex way? As there a simpler way, maybe to set a high bit high when EMC is active and forgive the possible startup jitters that rarely might power up the controllers? (ie a $5 relay instead of a $22.50 charge pump board or programming my own PIC)

    Just spitballing...

    Thanks for any help.

    Last edited by cadmonkey; 04-11-2008 at 11:40 PM.
    Every day is a learning process, whether you remember yesterday or not is the hard part.
    www.distinctperspectives.com


  5. #5
    Gold Member acondit's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    1778
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by cadmonkey View Post
    Ok, after a quick glance at my old Essential Guide to ANSI C - I understand what the function is doing, inverting the output each time it is ran IF it's enabled.

    How do I set it to always be enabled via the .hal file though? If I connect it to E-Stop it's still going to toggle at some point. I want it to run if EMC2 is running - never toggle. E-Stop only shut down the amplifier enable bit and the spindle enable bit. I also posted to the mailing list (I think...hope I did it right...)

    EDIT - Ok after reading more of the CVS info :
    Code:
    pin out bit out "Square wave if 'enable' is TRUE or unconnected, low if 'enable' is FALSE";
    Would indicate that if it isn't connected to an input bit - it's enabled - am I interpreting that correct? Also, how would I get another thread started that would run the charge pump at 12.5KHz?

    Am I going about this an overly complex way? As there a simpler way, maybe to set a high bit high when EMC is active and forgive the possible startup jitters that rarely might power up the controllers? (ie a $5 relay instead of a $22.50 charge pump board or programming my own PIC)

    Just spitballing...

    Thanks for any help.
    Cadmonkey,

    I used pin 17 for the enable because on my BOB that was where the charge pump would have been. All three drive enables are physically tied to parport.0.pin-17-out.

    # create a signal for the machine enable
    net xenable => parport.0.pin-17-out
    net xenable axis.0.amp-enable-out => stepgen.0.enable

    I also have these two lines but I don't really know what purpose they serve.

    net yenable axis.1.amp-enable-out => stepgen.1.enable
    net zenable axis.2.amp-enable-out => stepgen.2.enable

    My estop is on pin 10 and it is set up like this.

    net estop-ext <= parport.0.pin-10-in-not
    net estop-out <= iocontrol.0.user-enable-out
    net estop-ext => iocontrol.0.emc-enable-in


    Alan



  6. #6
    Registered cadmonkey's Avatar
    Join Date
    Mar 2006
    Location
    USA
    Posts
    304
    Downloads
    0
    Uploads
    0

    Default

    I remember there being a difference in my mockup between machine enable and amplifier enable and I chose amplifier enable - I think you might be onto what I'm looking for.

    As to the 2 other lines - essentially those are enabling the step generators for the other axis (Y & Z) just like X was, just the xenable was also tied to a physical output pin (parport.0.pin-17-out) to be driven high when the axis are enabled. You could in theory have each tied to a pin to enable each drive individually, but pin limitations and the need to individually shut down drives aren't common on our DIY setups.

    I've got the estop setup like I want, all my optical limits on a second LPT card and I'm just looking to streamline the startup and eliminate switches to forget to turn off...

    Maybe tomorrow I'll setup the motherboard, plug in everything, hook it up to the scope and just see what happens when I make a few changes. Thanks.

    Every day is a learning process, whether you remember yesterday or not is the hard part.
    www.distinctperspectives.com


  7. #7
    Gold Member acondit's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    1778
    Downloads
    0
    Uploads
    0

    Default

    You're right, I remember now. I just couldn't figure out how to net the three of them together off of pin 17 in hal.

    The way I have my estop setup, I have to have the physical switch active as well as the "Axis" estop button. So hitting either one will put it into estop.

    Alan



  8. #8
    Registered cadmonkey's Avatar
    Join Date
    Mar 2006
    Location
    USA
    Posts
    304
    Downloads
    0
    Uploads
    0

    Default

    Well I got the answer I needed off the EMC2 users mailing list - in addition to the 4 lines I need to add:
    Code:
    setp charge-pump.enable 1
    and the charge pump will do what I want. Then it's just a matter of setting a thread to run it in that is the right interval to produce the correct period square wave. Then everything will follow my flow chart.

    Every day is a learning process, whether you remember yesterday or not is the hard part.
    www.distinctperspectives.com


  9. #9
    Registered
    Join Date
    Dec 2009
    Location
    Formerly Known as the USA
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default

    If you want the charge pump to turn on only when you click the Machine Power button or hit F2, use the following...


    Use stepconfig to set up your estop pin (pin10 in my case) and the configure the charge pump on whatever pin you're using. Then edit the Hal file.

    in your Hal config file, Delete the line;
    net estop-out charge-pump.enable iocontrol.0.user-enable-out

    and replace it with the following;
    net motion-enabled charge-pump.enable motion.motion-enabled

    This will make the Machine Power (F2) button control the charge pump on the G540. The external estop button will work correctly, and the EMC Estop (F1) button will act correctly as well.



Tags for this Thread

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Charge Pump

Charge Pump