Emcoturn 120 lathe retrofit

More
07 Jul 2016 00:16 - 07 Jul 2016 00:23 #77112 by LutzTD
Replied by LutzTD on topic Emcoturn 120 lathe retrofit
I wanted to retrace my steps and found that I could not run halcompile. so I reloaded linuxcnc-dev and now all of the rtai kernal is back. so does it hurt to have that but boot in the rt kernal?

nevermind linuxcnc is hosed again and is giving an error saying I need to restart with the rtai kernal to run....... circles and circles
Last edit: 07 Jul 2016 00:23 by LutzTD.

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 00:20 #77113 by andypugh
Having the kernel there but unused does no harm. You probably want to run halcompile under the kernel that you intend to use the components with, however. (I know you didn't ask that, but it wasn't clear if halcompile is working for you under uspace)

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 00:22 - 07 Jul 2016 00:22 #77114 by LutzTD
Replied by LutzTD on topic Emcoturn 120 lathe retrofit
it said command did not exist. I fixed it last time by loading linuxcnc-dev. but that reloaded the rtai kernal too
Last edit: 07 Jul 2016 00:22 by LutzTD.

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 00:33 #77115 by LutzTD
Replied by LutzTD on topic Emcoturn 120 lathe retrofit
redid steps 2-5 on -uspace install and of course it uninstalled halcompile. can i get this another way?

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 00:42 #77116 by andypugh
The uspace-dev package is in the same place as the linuxcnc base deb. same process:
buildbot.linuxcnc.org/dists/wheezy/2.7-rtpreempt/binary-i386/

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 00:48 - 07 Jul 2016 00:49 #77117 by andypugh
or apt-get install linuxcnc-uspace-dev
Last edit: 07 Jul 2016 00:49 by andypugh.

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 02:31 #77124 by LutzTD
Replied by LutzTD on topic Emcoturn 120 lathe retrofit
ah there we go, thanx

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 03:12 #77125 by LutzTD
Replied by LutzTD on topic Emcoturn 120 lathe retrofit
still trying to understand the whole linuxcnc load. as I understand it my next step is to run the linuxcnc configuration program and input all of the axis, step i/o using a 7176 pci as the setup, then go in and edit the ini and hal to change the entries "hm2_pci" to "hm2_eth", change the card name and add the 10.10.10.1 ethernet address? Is this correct? Once I do that I can no longer edit the file using the config tool? what if I need to change the config because I did some thing wrong? At this point am I added changes to the code manually? Just trying to get a grasp on this.

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 10:34 - 07 Jul 2016 10:35 #77133 by andypugh

still trying to understand the whole linuxcnc load. as I understand it my next step is to run the linuxcnc configuration program and input all of the axis, step i/o using a 7176 pci as the setup, then go in and edit the ini and hal to change the entries "hm2_pci" to "hm2_eth", change the card name and add the 10.10.10.1 ethernet address? Is this correct?


That is one way. An alternative is to take an example config then manually change that to suit your hardware. However there doesn't seem to be a pre-built sample config for 7i76E in the supplied configs.

In the early days of LinuxCNC there were no config generator wizards. The underlying idea has always been that the HAL and INI files are human-readable and human-editable and are the basis of the configuration. Stepconf and PnCConf are intended to get the skeleton of a config put together (and for a simple machine with a common hardware setup, often this is entirely adequate).

Once I do that I can no longer edit the file using the config tool? what if I need to change the config because I did some thing wrong? At this point am I added changes to the code manually? Just trying to get a grasp on this.


In your case, once you have started to hand-edit the files, that is what you will carry on doing.

The HAL file format is a simple scripting language. You can use it separately from LinuxCNC and this is often a very useful way to debug a system. For example you can try out HAL commands outside the HAL file to see if they work. In fact, in your current position, I would suggest doing exactly that. Open a terminal and try the following.
halrun
loadrt hostmot2
loadrt hm2_eth board_ip=10.10.10.10
show pin

If all is well, then loadrt hm2_eth won't return any error codes, and "show pin" will list a bunch of HAL pins on the 7i76.

If that doesn't work, then you can try again immediately:
loadrt hm2_eth board_ip=192.168.1.121


One you have loaded the hm2_eth driver successfully you can manually operate the board of you want to, but to do that you need to start the realtime threads and add the read/write functions to them.
show funct
That will list the realtime functions related to the board. probably "hm2_7i76e.0.read" hm2_7i76e.0.write and but maybe not. You may have a read_gpio and write_gpio, we won't be using those.
loadrt threads
addf hm2_7i76e.0.read thread1
addf hm2_7i76e.0.write thread1
start
I would expect a slow blinking green light on the 7i76 at this point.
You may be able to change the state of some user-leds on the board at this point. but see the manpage for reasons that they might not work. I have guessed the pin names, you should have them in the scroll-back of the terminal from the "show pin" command
setp hm2_7i76e.0.led.CR04 1
setp hm2_7i76e.0.led.CR04 0

when finished
exit

These commands, and others like them, are what is in the HAL file. It's all about loading the drivers, configuring the hardware and linking signals and IO where they belong. Don't think of it as a program though, its a configuration script that runs once at startup.

linuxcnc.org/docs/2.7/html/man/man9/hm2_eth.9.html
Last edit: 07 Jul 2016 10:35 by andypugh.

Please Log in or Create an account to join the conversation.

More
07 Jul 2016 12:56 #77140 by LutzTD
Replied by LutzTD on topic Emcoturn 120 lathe retrofit
Hi Andy,

this is a great explanation. Being so new to this I was expecting to just go through the config tool and viola' cnc. But I see now that it really is a programmers tool. Its OK, just not going to be as fast as I thought to get to a solution. Its a great suggestion to do the partial commands, I had no idea I could do that. its what I am trying to do with the system,. One thing at a time and put it all together later. One want is that I would like to read the encoder so I would like to get that section of commends and run those once I get connected to the 7i76e card. . Then I can take care of a few unknowns systematically. Then I want to go through window by window on the set up tool and ask what each thing is doing and what it means. Once I get through all the windows I should have a fairly complete start for the final manual edits and additions. I really appreciate all the help on this board, I dont know how I would be able to get even half way through without you guys or without 10 years of linux experience and a lot fumbling still....

Please Log in or Create an account to join the conversation.

Moderators: cncbasher
Time to create page: 0.109 seconds
Powered by Kunena Forum