On Thursday 23 February 2017 14:32:24 Kurt Jacobson wrote: > Hello all, > > I just finished writing my first HAL component. I am setting up an MPG > on a 4 axis mill and I wanted to have the axis selector switch as well > as the jog scale switch multiplexed to use fewer inputs. > > I was able to demux the jog increment using mux4 just fine, but I > could not figure out how to demux the axis select switch and enable > only the selected axis. > > I tried to edit Jon's HAL file found here > <http://pico-systems.com/codes/jebport/pendant.hal> to fit my needs > but I never did get it to work. I guess I don't understand how he used > select8 and wsums. > > Since I could not get that to work and I wanted to learn more about > HAL I decided to write an MPG component to do exactly what I wanted. I > though it would be difficult since I don't know a thing about coding, > but boy was I mistaken. I got the component to compile and run > correctly after the first try. I fall deeper in love with LinuxCNC > everyday! > > My MPG component is very simple. Basically, it takes four mpg-scale > parameters and selects one based on two inputs from the multiplexed > mpg scale switch. It divides the selected mpg-scale by the specified > number of encoder pulses per detent and outputs this as mpg-scale. > This would be connected to axis.N.jog-scale in a custom.hal file. > > For the axis selection the components sets the bit on the output pins > named enable_x, enable_y, enable_z, and enable_a, to true for the > selected axis, otherwise false. > > In the HAL file the enable_x etc. pins are connected like this for > each axis. > net mpg-x axis.x.jog-enable <= mpg.0.enable-x > > I though someone else here might find it useful so I have attached the > mpg.comp and MPG.hal files and a picture of how I multiplexed the > switches with two small signal diodes. Hope the attachments are OK. > > Thanks, > Kurt
Thank you Kurt. And I'm sure a .jpg of the finished device would be eagerly viewed by several of us when its done. I have i/o to throw away, so I thought I'd see if I can find a flexible cable with enough wires in it that might fit in a 3rd SS pipe across the right side of the saddle to carry those 6 signals and power and a button closure (2 more wires) near each of the two dials that would steer the encoder to a gain setter for that channel. Push the button and let the encoder wheel change the gain, on a 1,2,5,10 etc progression if I can hack that up.. So I wind up with two dials on the apron, with a pushbutton near each dial so one hand could do it. Both at the same time even. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users