CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2)


LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 04-07-2008, 12:15 PM
cadmonkey's Avatar  
Join Date: Mar 2006
Location: USA
Posts: 304
cadmonkey is on a distinguished road
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?
__________________
Every day is a learning process, whether you remember yesterday or not is the hard part.
www.distinctperspectives.com
Reply With Quote

  #2   Ban this user!
Old 04-10-2008, 10:42 PM
 
Join Date: Apr 2004
Location: Martinez, CA
Posts: 40
Ryobiguy is on a distinguished road

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.
Reply With Quote

  #3   Ban this user!
Old 04-11-2008, 05:09 PM
 
Join Date: May 2007
Location: US
Posts: 779
Andre' B is on a distinguished road

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;
    }
}
Reply With Quote

  #4   Ban this user!
Old 04-11-2008, 09:14 PM
cadmonkey's Avatar  
Join Date: Mar 2006
Location: USA
Posts: 304
cadmonkey is on a distinguished road

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.
__________________
Every day is a learning process, whether you remember yesterday or not is the hard part.
www.distinctperspectives.com

Last edited by cadmonkey; 04-11-2008 at 09:40 PM.
Reply With Quote

  #5   Ban this user!
Old 04-11-2008, 10:22 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

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
__________________
http://www.alansmachineworks.com
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 04-11-2008, 10:31 PM
cadmonkey's Avatar  
Join Date: Mar 2006
Location: USA
Posts: 304
cadmonkey is on a distinguished road

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
Reply With Quote

  #7   Ban this user!
Old 04-11-2008, 11:32 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

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
__________________
http://www.alansmachineworks.com
Reply With Quote

  #8   Ban this user!
Old 04-14-2008, 01:18 PM
cadmonkey's Avatar  
Join Date: Mar 2006
Location: USA
Posts: 304
cadmonkey is on a distinguished road

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
Reply With Quote

  #9   Ban this user!
Old 04-06-2010, 01:19 AM
 
Join Date: Dec 2009
Location: Formerly Known as the USA
Posts: 7
heathric is on a distinguished road

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.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie- Charge pump setup zeta LinuxCNC (formerly EMC2) 6 02-23-2008 03:05 PM
Charge pump for Hilbilly BOB dougputt Mach Software (ArtSoft software) 2 10-11-2007 12:31 PM
Charge Pump ??? jack55 General Electronics Discussion 6 04-21-2007 02:59 PM
Diy Charge Pump Circuit? zigmart General Electronics Discussion 6 03-18-2007 07:28 PM
Charge pump mlaws1172 Screen Layouts, Post Processors & Misc 0 01-03-2006 10:46 PM




All times are GMT -5. The time now is 03:02 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361