Tytuł: oprogramowanie enkodera w EMC2 Wiadomość wysłana przez: markcomp Sierpnia 17, 2011, 12:18:45 oprogramowanie enkodera w EMC2
Quadrature Encoder - enkoder kwadraturowy sygnały A i B pozwalają określić przemieszczenie i kierunek przemieszczenia... różnica faz A i B określa kierunek przesunięcia (obrotu) (http://www.markcomp77.p9.pl/img/enkoder.png) z http://forum-cnc.pl/index.php/topic,600.0.html CNC Lathe Spindle Encoder http://members.shaw.ca/swstuff/spindle-encoder.html Cytuj (http://members.shaw.ca/swstuff/encoder-003.jpg) This project was dreamed up late one evening when I decided I wanted to be able to use the CNC capabilities of my lathe to cut threads. I use EMC2 software running under a realtime patched Ubuntu kernel. In order for the lathe threading to function under computer control, the computer must know where the chuck spindle is located so that the position of the cutting tool may be phase locked to the rotation of the chuck. This project implements a homemade quadrature encoder with 360 counts/revolution and an index pulse. One of the easiest places to monitor the position of the headstock spindle is at the main drive pulley. The headstock on this lathe has a large diameter cast iron pulley that makes it quite easy to mount an encoder wheel. The first job was to cut an encoder wheel. To do this I used a 0.047" endmill to cut the encoder out of kitchen cabinet laminate (tradename Arborite). The encoder disk was bolted to the cast iron spindle pulley by drilling and taping for 6 6-32 bolts.... (http://wiki.linuxcnc.org/uploads/emcmot03.svg) EMC Components http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?EMC_Components wątek z CNCzone EMC2 and a rotary encoder http://www.cnczone.com/forums/emc_linux_enhanced_machine_control/68838-emc2_rotary_encoder.html Kod: ############################################################# Lathe with servo drive STEP/DIR and encoder http://www.linuxcnc.org/index.php?option=com_kunena&Itemid=20&func=view&catid=30&id=5487&lang=english http://youtu.be/78KhQUvVncA Tytuł: Spindle Feedback Wiadomość wysłana przez: markcomp Sierpnia 17, 2011, 10:42:21 Spindle Feedback
from: http://www.linuxcnc.org/docview/html/examples_spindle.html Spindle Synchronized Motion Spindle feedback is needed by EMC to perform any spindle coordinated motions like threading and constant surface speed. The StepConf Wizard can perform the connections for you if you select Encoder Phase A and Encoder Index as inputs. Hardware assumptions:
Basic Steps to add the components and configure them: Kod: loadrt encoder num_chan=1 Tytuł: Encoder Wiadomość wysłana przez: markcomp Sierpnia 17, 2011, 10:53:26 Encoder
http://linuxcnc.org/docs/html/hal_rtcomps.html#sec:Encoder This component provides software based counting of signals from quadrature encoders. It is a realtime component only, and depending on CPU speed, etc, is capable of maximum count rates of 10kHz to perhaps 50kHz. Figure [.] is a block diagram of one channel of encoder counter. (http://unpy.net/emc2-docs-new/encoder-block-diag.png) Installing Kod: emc2$ halcmd loadrt encoder [num_chan=<counters>] <counters> is the number of encoder counters that you want to install. If numchan is not specified, three counters will be installed. The maximum number of counters is 8 (as defined by MAX_CHAN in encoder.c). Each counter is independent, but all are updated by the same function(s) at the same time. In the following descriptions, <chan> is the number of a specific counter. The first counter is number 0. Removing Kod: emc2$ halcmd unloadrt encoder Pins Kod: (bit) encoder.<chan>.phase-A -- Phase A of the quadrature encoder signal. Parameters Kod: (s32) encoder.<chan>.raw-count -- The raw count value, updated by update-counters(). Functions The component exports two functions. Each function acts on all of the encoder counters - running different counters in different threads is not supported. Kod: (funct) encoder.update-counters -- High speed function to count pulses (no floating point). |