mooser wrote: I'm pretty much at the point where this switch over needs to go back to mach. Trying to wrap my poor old head around the Bitfile/hal and ini files is proving beyond my abilities.
Maybe we have just made a bad job of explaining things?
With a parallel port some pins are inputs and some pins are outputs. But other than those restrictions you can send step signals and direction signals from any pin. In HAL you see individual HAL pins corresponding to physical pins on the connector.
With the Mesa card any pin can be an input or an output, but the function of each physical pin is hard-coded in the bitfile. In the HAL layer you do not see HAL pins corresponding to the step and direction pins, you see the stepgen position or velocity inputs instead.
If you disable some step-generators in the firmware then the associated pins become available as GPIO pins (and can be individually configured as input or output) But you can only disable functions from the highest-numbered downwards.
The firmware you have has been configured with stepgens both for the spindle and the charge-pump.
I think that some of your trouble is that you are trying to make changes in Pncconf to achieve specific results in HAL, and in this regard Pncconf is something of an impenetrable black box.
Perhaps you need to become more familiar with HAL. Once you get used to it it is a very flexible and useful tool. Try this:
(Note that you can use the TAB key to autocomplete commands, for example loadr<tab> hostm<tab>)
Open a terminal window and type the following:
Code:
loadrt hostmot2
loadrt hm2_pci
loadrt threads
addf hm2_5i25.0.read thread1
addf hm2_5i25.0.write thread1
start
You should now have a live and working realtime system and powered-up Mesa card.
For reference you can make a list of all the Mesa card HAL pins:
And all the setting (parameters)
It is probably a good idea to copy these pin and parameter lists into a text file for later reference.
All the entries you see in the HAL file part of your config are commands that you can use in the HAL environment that you are now in.
One very simple example:
Code:
setp hm2_5i25.0.CR01 1
should turn on an LED on the 5i25
Code:
setp hm2_5i25.0.CR01 0
will turn it off again.
It should be possible to control the spindle using the HAL interface too. Something a bit like this (but I am guessing HAL pin names and config details). Control-type 1 sets the stepgen to speed control mode. The correct scale setting will depend on your peak spindle speed and the expectations of the G11G. Consider it an adjustment
Code:
setp hm2_5i25.0.stepgen.04.control-type 1
setp hm2_5i25.0.stepgen.04.scale 4000
setp hm2_5i25.0.stepgen.04.enable 1
setp hm2_5i25.0.velocity-cmd 1000
You probably need to "setp" an IO pin to turn the spindle on, too. Changing velocity-cmd should change the spindle speed.
The point of this is twofold: To show that HAL is not complicated if you take it in small chunks, and to demonstrate that HAL is actually a fairly convenient place to try things out and debug without the complications if the rest of LinuxCNC.
The only other things you need to know to understand a HAL file that is part of a config is that [SECTION]ENTRY gets a value from the INI file (you can freely add your own sections, and ad your own entries to existing sections) and that the "net" command can be used to connect the output of one HAL function to the inputs of one or more other ones.
so:
Code:
net mysignal motion.spindle-speed-out
creates a HAL "signal" (which can have any name) to a LinuxCNC pin that sends spindle speed commands. (You won't have any motion pins in your command-line session, we haven't loaded the motion module)
Code:
net mysignal hm2_5i25.0.stepgen.04.velocity-cmd
connect the same signal to the spindle stepgen. You can combine them both on one line, if you want, or you can make the connections in separate files. Every "signal" can be connected to one "writer" (output pin) such as spindle-speed-out and as many "readers" (input pins) as required.