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 05-21-2009, 11:04 AM
 
Join Date: May 2007
Location: England
Posts: 44
welderfabrod is on a distinguished road
Threading on emco compact 5 lathe

Can anyone help with this.
I retrofitted an Emco compact 5 lathe a couple of years ago but did'nt set it up for thread cutting, 1) because I had another emco 5 which I could thread cut on but this has now bit the dust and will be retrofitted in the future and 2) I was'nt sure how to do it. So what do I need to do to achieve this.

The lathe has been fitted with modern 1.8deg stepper motors and Camtronics 3 axis board, because I had it and it works fine on this small lathe. I retained the Emco motor speed controller so the encoder disc on the spindle is still in use but the index slot is not used at the moment. I do,nt find switching the motor on and off manualy a problem so I am not worried about controling this with emc2. But what do I need to do to syncronize the steppers with the spindle speed, and what do I need to add to the Hal file. The encoder disc has one index slot and I think one hundred slots for speed contol.
Any help here would greatly appreciated

Rod
Reply With Quote

  #2   Ban this user!
Old 05-21-2009, 11:46 AM
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 1,081
samco is on a distinguished road

This guy did a 5 conversion
http://lerneaenhydra.net/compact5/

You are going to need the index pulse hooked to emc for threading to work. If you also hook the encoder line up (I am pretty sure lerneaen did the same thing) (100 holes?) you will get more acurite threads. Look at his hal files.

sam
Reply With Quote

  #3   Ban this user!
Old 05-21-2009, 12:23 PM
 
Join Date: May 2007
Location: England
Posts: 44
welderfabrod is on a distinguished road

Thanks for that Sam have downloaded files but my linux box is in the workshop and not connected to the internet so need to transfer files out there to open them. But will have to wait till tomorrow now as I'm on night shift.

Rod
Reply With Quote

  #4   Ban this user!
Old 05-28-2009, 02:15 PM
 
Join Date: May 2007
Location: England
Posts: 44
welderfabrod is on a distinguished road

Sam I've been messing around with these files (mainly the controlbox hal file because this contains the threading info I need) but can't get it working. There are some differences in my set up i.e he is using the Emco drivers still, he has also fitted a relay to turn the spindle on and off (I think connected to pin 4 of the parallel port) and a jog wheel box (which I think uses a second port) whereas all I have left is the Emco speed controller and switching the spindle manually. But the problem at the moment is I can't get the hal file to load. All I have done really is to copy his threading part of the file as I do'nt need the rest at this time but EMC stops loading and presents its failure window. In the debug section it has two errors
1) "Blocks is deprecated, use subcomponents generated by comp instead". this obviously refers to the line loadrt blocks not=1 at the beginning of the threading section.
2) HAL: ERROR: Pin motion.spindle.sync not found.
3) Custom hal:42 Link failed (I think the 42 refers to line 42 in my file) in his file I think it refers the line linkps motion.spindle-sync => spindle-sync in the #encoder reset control section.

The other bit I dont understand is the #set pullup pin high section, pin 1 on the parrallel port which seems to be configured as output but what is it connected to and what is its purpose.

I have'nt used hal to this extent before so I would be really grateful if yourself or someone else on the forum could help me here.

Thanks in advance.

Rod
Reply With Quote

  #5   Ban this user!
Old 05-30-2009, 05:06 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

This might help. from the online manual for EMC 2.3:
http://www.linuxcnc.org/docs/devel/h...s_spindle.html
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 05-31-2009, 03:40 AM
 
Join Date: May 2007
Location: England
Posts: 44
welderfabrod is on a distinguished road
Screwcutting

Thanks chester. It has also been pointed out to me on the EMC forum that the file is also quite old and if I have a later version of EMC2 it probably won't work. So I'm going to have another go this morning.

Thanks again Rod.
Reply With Quote

  #7   Ban this user!
Old 06-07-2009, 09:42 AM
 
Join Date: May 2007
Location: England
Posts: 44
welderfabrod is on a distinguished road

Hi again all I'm still not having much luck with this. I have had a go with HalScope and I am getting both index and the count pulses (spindle-index) and (spindle-phase-a) on the scope and when I vary the revs the pulses vary in frequency on the scope, but when I try to do a G33 in MDI mode I get the "Spindle not turning in G33" error. The encoder is connected to Pin 10 (spindle-phase-a) and pin 11 (spindle-index) on the port. This was configured using the Stepconf Wizard so I would have thought this should be OK.

I really do need some help with this.

Thanks Rod.
Reply With Quote

  #8   Ban this user!
Old 06-07-2009, 09:58 AM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

Can you please post your HAL files.
You said you tried threading in MDI have you tried a thread in auto mode?
Reply With Quote

  #9   Ban this user!
Old 06-07-2009, 10:57 AM
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 1,081
samco is on a distinguished road

posting your hal file would help as chester said. You need to hook up a bunch of things - here is from the nist lathe setup

This is using counter - which is depreciated. (also linksp/linkps) net should be used. It should work as is but you really should use encoder and net instead. (you can put the encoder into 'count' mode to read a single channel encoder like you have. (single channel + index).

# counting the spindle counter in software
loadrt counter num_chan=1


#######################################################
# Beginning of threading-related stuff
#######################################################

# spindle counter
# connect encoder signals to counter counter
# B is not used because it is the counter module, not encoder
newsig spindle-phase-A bit
newsig spindle-phase-B bit
newsig spindle-phase-Z bit
linksp spindle-phase-A => counter.0.phase-A
linksp spindle-phase-Z => counter.0.phase-Z

linkps parport.0.pin-11-in => spindle-phase-A
linkps parport.0.pin-12-in => spindle-phase-B
linkps parport.0.pin-13-in => spindle-phase-Z

# (that way thread pitches can be straightforward,
# a 20 tpi thread would multiply the counter output
# by 1/20, etc)
setp counter.0.position-scale 1024

# hook up motion controller's spindle indexing pin
newsig spindle-index-enable bit
linkps motion.spindle-index-enable <=> spindle-index-enable
linksp spindle-index-enable <=> counter.0.index-enable

# report our revolution count to the motion controller
newsig spindle-pos float
linkps counter.0.position => spindle-pos
linksp spindle-pos => motion.spindle-revs
Reply With Quote

  #10   Ban this user!
Old 06-08-2009, 08:58 AM
 
Join Date: May 2007
Location: England
Posts: 44
welderfabrod is on a distinguished road

Thanks for the response guy's I have'nt as yet tried it in auto mode but I will have a go and see if it works. I thought a G33 would be easiest in MDI as it is a simple sycronized motion.

I am starting the spindle manually also speed control is manual.
My hal file is below I did this again on Sunday.




# Generated by stepconf at Sun Jun 7 11:35:48 2009
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]SERVO_PERIOD key=[EMCMOT]SHMEM_KEY num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg=0x378
setp parport.0.reset-time 500
loadrt stepgen step_type=0,0
loadrt encoder num_chan=1

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf encoder.update-counters base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf encoder.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread

setp encoder.0.position-scale 100
setp encoder.0.counter-mode 1
net spindle-position encoder.0.position => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-phase-a encoder.0.phase-A
net spindle-phase-b encoder.0.phase-B
net spindle-phase-index encoder.0.phase-Z

net xstep => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
net xdir => parport.0.pin-03-out
net zstep => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
net zdir => parport.0.pin-07-out
net xenable => parport.0.pin-17-out

net spindle-phase-a <= parport.0.pin-10-in
net spindle-index <= parport.0.pin-11-in

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 19000
setp stepgen.0.dirsetup 16000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable

setp stepgen.1.position-scale [AXIS_2]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 19000
setp stepgen.1.dirsetup 16000
setp stepgen.1.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.1.position-cmd
net zpos-fb stepgen.1.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.1.step
net zdir <= stepgen.1.dir
net zenable axis.2.amp-enable-out => stepgen.1.enable

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 06-08-2009, 05:07 PM
acondit's Avatar  
Join Date: Apr 2005
Location: USA
Posts: 1,774
acondit is on a distinguished road

Rod,

Here is my spindle encoder setup. I have a 100 count encoder with Channel A and Index (channel Z) hooked up. I am using pin 15 for the index and pin 13 for channel A.

Code:
#############################################################
#Spindle Sensor
#############################################################
# load encoder stuff
loadrt encoder num_chan=1
loadrt scale count=1
loadrt lowpass count=1
# counter mode
setp encoder.0.counter-mode 1
# 100 counts per encoder rev
setp encoder.0.position-scale 100

# encoder reset control
# hook up motion controller's sync output
net spindle-index-enable motion.spindle-index-enable <=> encoder.0.index-enable

# hook up spindle encoder
net spindle-index parport.0.pin-15-in encoder.0.phase-Z
net SpindleEncoderA parport.0.pin-13-in encoder.0.phase-A
#net SpindleEncoderB parport.0.pin-12-in encoder.0.phase-B

# spindle speed
net spindle-pos encoder.0.position => motion.spindle-revs
net spindle-spd-rps encoder.0.velocity scale.0.in motion.spindle-speed-in
net spindle-spd-rpm scale.0.out lowpass.0.in
setp scale.0.gain 60
net spindle-spd-rpm-filt lowpass.0.out
setp lowpass.0.gain 0.01

# count spindle encoder pulses
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
addf lowpass.0 servo-thread
addf scale.0 servo-thread
Alan
__________________
http://www.alansmachineworks.com
Reply With Quote

  #12   Ban this user!
Old 06-08-2009, 08:29 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

Hey Rod :
you say you start the spindle manually but do you start the spindle in emc with a m code or in manual mode. EMC may require that it has been told to turn on the spindle even if you are really doing it your self. ( easy to try even if I am wrong)

Chris
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
Trying to find change gears for Emco Compact 10 lathe DZW General Metal Working Machines 2 02-16-2010 06:04 AM
Emco compact 5 cnc lathe question keny Mini Lathe 2 08-01-2008 04:20 PM
Need Help!- Emco Compact 5 CNC Lathe problem with the cable pin-out CoreyD87-123 Mini Lathe 6 07-31-2008 01:50 PM
Emco Compact 10 2 Case Lathe pzzamakr1980 Mini Lathe 3 05-03-2008 01:13 PM
EMCO compact 5 PC to win XP? SBruceSmith General CNC (Mill and Lathe) Control Software (NC) 1 06-29-2006 02:30 PM




All times are GMT -5. The time now is 05:36 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