From: ben l. <fe...@sd...> - 2007-12-22 22:36:14
|
David, when you start emc, it looks through the .ini file for a hal file to run, and then passes the commands in the hal file to halcmd. "loadrt hal_stg" loads the hal_stg module into the realtime system. This gives you hal pins and functions necessary for using a servo-to-go card. The hal pins from the stg card can be hooked up any way you want, you dont even need EMC in the picture at all. in the stg example config, in core_servo.hal, the trivkins module is loaded and that provides the link to emc and the joint[N] data structure as "axis.N" pins. (the pins actually get exported in motion.c) The pins are then hooked up to PID control loops which provide the necessary "kick in the seat of the pants" to get the axis moving. finally, in stg_motion.hal the output of the PID loop is hooked up to the servo-to-go interface card: # connect PID output signals to DACs linksp Xoutput => stg.0.dac-value a similar process happens in reverse to provide feedback from the encoders. this all makes much more sense if you have a running system and look at the connection with 'halcmd show sig' if you are interested in the overall structure of EMC, i find the (large) drawings at the end of this page to be useful, although they are outdated: http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?EMC_Components HTH -fenn On Sat, 22 Dec 2007, David wrote: > > Dear helpers, > I have a question on connection between motion control card and EMC2. > Take the Servo-To-Go for example, does this line: > > loadrt hal_stg [base=<address>] [num_chan=<nr>] [dio="<dio_string>"] > [model=<model>] > > connect the card in the <address> to the file > configs/stg/stg_motion.hal? what is the route of data flow from the card to > the pointers *joints and *pos in src/emc/kinematics/trivkins.c? > > David > |