![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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 |
|
#2
| |||
| |||
| 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 |
|
#3
| |||
| |||
| 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 |
|
#4
| |||
| |||
| 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 |
|
#5
| |||
| |||
| This might help. from the online manual for EMC 2.3: http://www.linuxcnc.org/docs/devel/h...s_spindle.html |
| Sponsored Links |
|
#6
| |||
| |||
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. |
|
#7
| |||
| |||
| 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. |
|
#9
| |||
| |||
| 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).
|
|
#10
| |||
| |||
| 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 |
| Sponsored Links |
|
#11
| ||||
| ||||
| 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
__________________ http://www.alansmachineworks.com |
|
#12
| |||
| |||
| 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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |