Delaying motion enable after machine-on
- InMyDarkestHour
-
- Offline
- User is blocked
-
Less
More
- Posts: 701
- Thank you received: 111
10 Jun 2018 06:00 - 10 Jun 2018 08:58 #112118
by InMyDarkestHour
Replied by InMyDarkestHour on topic Delaying motion enable after machine-on
What install did you start with ?
Have you done a dist-upgrade ?
What version of 2.7 are you on ?
Are you setup to build a "run in place (RIP) from git ?
In the words of Baldrick "I have a cunning plan"
Ok I managed a build with the home motion.homing-inhibit code mods, managed to change one of the messages you wanted, would this be something you would be interested in ?
I have a script that will download the packages required to build a RIP version (git cloning and checkout is left to you), tested with the stretch-uspace iso. And another to download the packages need to build glade3-3.8.6.
Quick test of motion.homing-inhibit in 2.7.13 with changes to these files
src/emc/motion/command.c
src/emc/motion/mot_priv.h
src/emc/motion/motion.c
with code additions as per github.com/LinuxCNC/linuxcnc/commit/845bb7528 appears to work.
Have you done a dist-upgrade ?
What version of 2.7 are you on ?
Are you setup to build a "run in place (RIP) from git ?
In the words of Baldrick "I have a cunning plan"
Ok I managed a build with the home motion.homing-inhibit code mods, managed to change one of the messages you wanted, would this be something you would be interested in ?
I have a script that will download the packages required to build a RIP version (git cloning and checkout is left to you), tested with the stretch-uspace iso. And another to download the packages need to build glade3-3.8.6.
Quick test of motion.homing-inhibit in 2.7.13 with changes to these files
src/emc/motion/command.c
src/emc/motion/mot_priv.h
src/emc/motion/motion.c
with code additions as per github.com/LinuxCNC/linuxcnc/commit/845bb7528 appears to work.
Last edit: 10 Jun 2018 08:58 by InMyDarkestHour.
Please Log in or Create an account to join the conversation.
10 Jun 2018 13:07 #112134
by Sparky961
Replied by Sparky961 on topic Delaying motion enable after machine-on
I appreciate your offer, but I think I'm better off learning to do this myself if that's what turns out to be the best solution. It also opens up possibilities for future changes on my own without having to whine about what doesn't suit my needs.
Have you tried running either of the configs I posted with your changed version? Does it solve the problems I've mentioned?
I'm working from the Debian Wheezy LinuxCNC ISO, which has been modified with uspace and rt-preempt. In the process I've done a dist-upgrade. I have cloned the repository (I think for the same version) but not yet tried to build it. I don't know where it builds to, and whether that replaces the active version on the system.
It occurred to me that since I'm using VirtualBox I can probably create a duplicate virtual system for testing out things like this without going through all the effort to start from scratch. I should probably do that anyway to create a "backup virtual computer". I haven't tried it yet so not sure if it's as easy as I hope.
Of course, I'd rather find an acceptable solution without making any source changes but it's proving more difficult than I imagined. After last night's session I was thinking that it might work more to my liking without using AXIS at all. I need to determine what functionality I'll be using and see how difficult it is to make a stand-alone custom GUI. Since this machine is intended to have a dedicated purpose it doesn't need to have many of the features that AXIS provides. I was using it because it's what I'm familiar with and because it's the default.
Have you tried running either of the configs I posted with your changed version? Does it solve the problems I've mentioned?
I'm working from the Debian Wheezy LinuxCNC ISO, which has been modified with uspace and rt-preempt. In the process I've done a dist-upgrade. I have cloned the repository (I think for the same version) but not yet tried to build it. I don't know where it builds to, and whether that replaces the active version on the system.
It occurred to me that since I'm using VirtualBox I can probably create a duplicate virtual system for testing out things like this without going through all the effort to start from scratch. I should probably do that anyway to create a "backup virtual computer". I haven't tried it yet so not sure if it's as easy as I hope.
Of course, I'd rather find an acceptable solution without making any source changes but it's proving more difficult than I imagined. After last night's session I was thinking that it might work more to my liking without using AXIS at all. I need to determine what functionality I'll be using and see how difficult it is to make a stand-alone custom GUI. Since this machine is intended to have a dedicated purpose it doesn't need to have many of the features that AXIS provides. I was using it because it's what I'm familiar with and because it's the default.
Please Log in or Create an account to join the conversation.
10 Jun 2018 13:30 #112135
by andypugh
It might be easier to change Axis...
Because Axis is written in Python you can make changes and they just happen (well, you need to close and re-open Axis).
The Power (F2) button is handled here: github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L2118
(line 2125)
If you decide that the answer is new HAL pins out of, and/or in to Axis, they can be added here:
github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L3734
How long does it actually take to home the motors? I had a quick look yesterday at asserting amp-fault until the amps are ready. I think that might work if you can accept keeping the F2 button pressed.
Replied by andypugh on topic Delaying motion enable after machine-on
Of course, I'd rather find an acceptable solution without making any source changes but it's proving more difficult than I imagined. After last night's session I was thinking that it might work more to my liking without using AXIS at all.
It might be easier to change Axis...
Because Axis is written in Python you can make changes and they just happen (well, you need to close and re-open Axis).
The Power (F2) button is handled here: github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L2118
(line 2125)
If you decide that the answer is new HAL pins out of, and/or in to Axis, they can be added here:
github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L3734
How long does it actually take to home the motors? I had a quick look yesterday at asserting amp-fault until the amps are ready. I think that might work if you can accept keeping the F2 button pressed.
Please Log in or Create an account to join the conversation.
10 Jun 2018 17:39 - 10 Jun 2018 17:44 #112140
by Sparky961
Replied by Sparky961 on topic Delaying motion enable after machine-on
I wasn't aware that Axis was written in Python. I'll have a look and see if making some changes there helps me. Thanks for pointing that out.
The duration of the motor commutation routine isn't deterministic. It seems to vary, generally taking longer with a cold start than a system reset. I've gotten over trying to figure that one out. Maybe I'll even be lucky enough to use some drives and motors that don't have this limitation in the final version. I'm presently working with a 2 second delay after giving power to the drives before enabling them. After that there's about 6 seconds within which I need to keep the Z-brake engaged because the motor isn't holding it in place. Following this, the actual commutation time is somewhat variable but I have a "commutation complete" signal from each of the drives that I can combine together and check before enabling motion. After all that, the system is ready to work.
In it's final implementation the system will have no keyboard, only a small control panel with some buttons. The user will be an operator, loading and unloading the same thing as it is completed. If things progress that far there will also be a light curtain surrounding anything that can cause serious damage during the cycle. Changes to the running setup will be infrequent and performed by an "expert" such as myself.
The duration of the motor commutation routine isn't deterministic. It seems to vary, generally taking longer with a cold start than a system reset. I've gotten over trying to figure that one out. Maybe I'll even be lucky enough to use some drives and motors that don't have this limitation in the final version. I'm presently working with a 2 second delay after giving power to the drives before enabling them. After that there's about 6 seconds within which I need to keep the Z-brake engaged because the motor isn't holding it in place. Following this, the actual commutation time is somewhat variable but I have a "commutation complete" signal from each of the drives that I can combine together and check before enabling motion. After all that, the system is ready to work.
In it's final implementation the system will have no keyboard, only a small control panel with some buttons. The user will be an operator, loading and unloading the same thing as it is completed. If things progress that far there will also be a light curtain surrounding anything that can cause serious damage during the cycle. Changes to the running setup will be infrequent and performed by an "expert" such as myself.
![;) ;)](/media/kunena/emoticons/wink.png)
Last edit: 10 Jun 2018 17:44 by Sparky961. Reason: Added commutation details
Please Log in or Create an account to join the conversation.
10 Jun 2018 18:12 - 10 Jun 2018 18:19 #112142
by Sparky961
Replied by Sparky961 on topic Delaying motion enable after machine-on
Is there a GUI python IDE that I can easily install, or better yet one that's already there but I don't know about? I'm fine with a command line if I'm using it all the time, but my attention is too widely dispersed to remember commands for all the different software I use. Without a half-decent development environment, it would be foolish for me to start twiddling with the code.
A quick search showed that IDLE seems to be available as a package for Wheezy. There are a number of versions though, and I know from recent experience that this choice is important.
I see the following 5 options from which to choose:
idle
idle-python2.6
idle-python2.7
idle-python3.2
idle3
A quick search showed that IDLE seems to be available as a package for Wheezy. There are a number of versions though, and I know from recent experience that this choice is important.
I see the following 5 options from which to choose:
idle
idle-python2.6
idle-python2.7
idle-python3.2
idle3
Last edit: 10 Jun 2018 18:19 by Sparky961. Reason: Added info re: IDLE
Please Log in or Create an account to join the conversation.
10 Jun 2018 19:05 - 10 Jun 2018 20:38 #112144
by Sparky961
Replied by Sparky961 on topic Delaying motion enable after machine-on
If I'm seeing that the installed python version is 2.7.3-4+deb7u1, then is it safe to assume I should install 'idle-python2.7'? Could it really be that simple?
Edit: Actually, no. It can't be that simple. Paying more attention and expanding the window to see the description I see that the one labeled 'idle' actually matches the python version number exactly. It's a no-brainer, but wasn't an obvious choice when I first looked.
Edit 2: sigh... so selecting 'idle' results in it wanting to install 'idle-python2.7' anyway. How are people supposed to know this stuff? I just want a friggin' IDE to use. Actually, I want the software to work the way that suits me _without_ resorting to changing anything, but I already _know_ that's too much to ask.
Edit: Actually, no. It can't be that simple. Paying more attention and expanding the window to see the description I see that the one labeled 'idle' actually matches the python version number exactly. It's a no-brainer, but wasn't an obvious choice when I first looked.
Edit 2: sigh... so selecting 'idle' results in it wanting to install 'idle-python2.7' anyway. How are people supposed to know this stuff? I just want a friggin' IDE to use. Actually, I want the software to work the way that suits me _without_ resorting to changing anything, but I already _know_ that's too much to ask.
Last edit: 10 Jun 2018 20:38 by Sparky961.
Please Log in or Create an account to join the conversation.
10 Jun 2018 20:35 #112149
by andypugh
Replied by andypugh on topic Delaying motion enable after machine-on
I tend to edit Python with Geany. But gedit would work too.
(I use Geany for all my LinuxCNC work, it's just about code-aware enough)
I am not sure you need an IDE. You don't need to compile and you can't run from the IDE directly.
(I use Geany for all my LinuxCNC work, it's just about code-aware enough)
I am not sure you need an IDE. You don't need to compile and you can't run from the IDE directly.
Please Log in or Create an account to join the conversation.
10 Jun 2018 20:42 #112151
by Sparky961
So are you expected to code and run blind? There's no way to debug, see variables, set breakpoints, and step through code?
Replied by Sparky961 on topic Delaying motion enable after machine-on
I am not sure you need an IDE. You don't need to compile and you can't run from the IDE directly.
So are you expected to code and run blind? There's no way to debug, see variables, set breakpoints, and step through code?
Please Log in or Create an account to join the conversation.
10 Jun 2018 20:57 #112152
by andypugh
I think that there are ways. But I have never figured them out (most of my LinuxCNC is kernel-module driver work, you can't typically breakpoint them anyway).
The problem I have found with any debugger built in to an IDE in the context of LinuxCNC is that you can't really tell the IDE how to start LinuxCNC and run the program you are editing.
Replied by andypugh on topic Delaying motion enable after machine-on
So are you expected to code and run blind? There's no way to debug, see variables, set breakpoints, and step through code?
I think that there are ways. But I have never figured them out (most of my LinuxCNC is kernel-module driver work, you can't typically breakpoint them anyway).
The problem I have found with any debugger built in to an IDE in the context of LinuxCNC is that you can't really tell the IDE how to start LinuxCNC and run the program you are editing.
Please Log in or Create an account to join the conversation.
- InMyDarkestHour
-
- Offline
- User is blocked
-
Less
More
- Posts: 701
- Thank you received: 111
10 Jun 2018 21:06 - 10 Jun 2018 21:23 #112153
by InMyDarkestHour
Replied by InMyDarkestHour on topic Delaying motion enable after machine-on
+1 for geany, there's about a million plugins for it as well, but the basic geany is great and very powerful, it's worth it just for the multiple tabs so you can have more than 1 file open at a time.
The script is nothing fancy, just a list of packages that are required to build linuxcnc, does nothing fancy, all it does is saves you having to type all the packages at the command line. One caveat if you do decide to do it on your own, apt will want to install quite a few extra packages, close to 900MB worth, with a lot of stuff that isn't required, things like apache webserver. When in actual fact all that is needed is about 190MB of extra packages. It took me a couple of goes to work exactly what to add, even when you do a "dpkg-checkbuilddeps" some of the dependencies that configure checks for are missed.
Generall your build cycle will go like this, for a Run In Place (RIP) build. This makes no changes to your existing install as everything is contained within the linuxcnc-dev directory.
first time around in the your linuxcnc-dev directory directory:
cd src
./autogen.sh
./configure --with-realtime=uspace
make
sudo make setuid (after a successfull build the make file has a message to do this)
cd ../
. scripts/rip-environment (the period, full stop or dot at the beginning is required and is actually a command known as the source command). Everything the rip-environment sets up stays valid in the current terminal window, if you close it the window,the setup (paths and such) are lost. So if you close the terminal you you will have to use the command again to setup the new terminal to run the version you just built. If you don't typing linuxcnc will run the version you install via synaptic or apt-get.
This is how it changes the PATH, the first echo $PATH is before and the second is after.
This is some info on the . (dot or source command), as you said before you like to know why, and why I was so long winded, trying to explaining it best I could.
en.wikipedia.org/wiki/Source_(command)
As previously stated I did run a test with your config and the changes to code with the new hal pin, I can't really say it does exactly what you want......but I did change one of the messages to how you wanted and setting the motion.inhibit-homing to true does in fact inhibit the homing process. It might be worth looking at the code, even if all you want to do is change the messages to something more meaningful to the user.
I have been working on a way to migrate a Virtualbox disk image (well a partition of to to a real HDD) and what I'm using now is a migrated version, was once a virtual box linuxcnc system partition and is now running on real hardware from a real disk. The beauty is that if you mess it up, it is very easily re-established to how it was.
The script is nothing fancy, just a list of packages that are required to build linuxcnc, does nothing fancy, all it does is saves you having to type all the packages at the command line. One caveat if you do decide to do it on your own, apt will want to install quite a few extra packages, close to 900MB worth, with a lot of stuff that isn't required, things like apache webserver. When in actual fact all that is needed is about 190MB of extra packages. It took me a couple of goes to work exactly what to add, even when you do a "dpkg-checkbuilddeps" some of the dependencies that configure checks for are missed.
Generall your build cycle will go like this, for a Run In Place (RIP) build. This makes no changes to your existing install as everything is contained within the linuxcnc-dev directory.
first time around in the your linuxcnc-dev directory directory:
cd src
./autogen.sh
./configure --with-realtime=uspace
make
sudo make setuid (after a successfull build the make file has a message to do this)
cd ../
. scripts/rip-environment (the period, full stop or dot at the beginning is required and is actually a command known as the source command). Everything the rip-environment sets up stays valid in the current terminal window, if you close it the window,the setup (paths and such) are lost. So if you close the terminal you you will have to use the command again to setup the new terminal to run the version you just built. If you don't typing linuxcnc will run the version you install via synaptic or apt-get.
rmurphy@stretch-cnc:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
rmurphy@stretch-cnc:~$ . linuxcnc-dev/scripts/rip-environment
rmurphy@stretch-cnc:~$ echo $PATH
/home/rmurphy/linuxcnc-dev/bin:/home/rmurphy/linuxcnc-dev/scripts:/home/rmurphy/linuxcnc-dev/tcl:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
This is how it changes the PATH, the first echo $PATH is before and the second is after.
This is some info on the . (dot or source command), as you said before you like to know why, and why I was so long winded, trying to explaining it best I could.
en.wikipedia.org/wiki/Source_(command)
As previously stated I did run a test with your config and the changes to code with the new hal pin, I can't really say it does exactly what you want......but I did change one of the messages to how you wanted and setting the motion.inhibit-homing to true does in fact inhibit the homing process. It might be worth looking at the code, even if all you want to do is change the messages to something more meaningful to the user.
I have been working on a way to migrate a Virtualbox disk image (well a partition of to to a real HDD) and what I'm using now is a migrated version, was once a virtual box linuxcnc system partition and is now running on real hardware from a real disk. The beauty is that if you mess it up, it is very easily re-established to how it was.
Last edit: 10 Jun 2018 21:23 by InMyDarkestHour.
Please Log in or Create an account to join the conversation.
Time to create page: 0.113 seconds