LinuxCNC is Poorly Documented

More
21 Nov 2019 14:54 #150831 by BigJohnT

andypugh wrote:

BigJohnT wrote: I would really like this thread to go away and maybe one with constructive help to replace it.

JT


I agree, largely. Compared to most open source projects LinuxCNC I spectacularly _ well_ documented. Just look at www. Machinekit.io which is a LinuxCNC fork and try to find theirs.

I, also, get vicariously offended in your behalf by this thread. But that isn’t to say that the docs are incapable of improvement.

For an example, I know how to get to the list of named parameters, but I can’t say that’s an intuitive journey. Or at least my route isn’t.


I agree 100% that the documents can always be improved. At least you can Alt F and search the PDF now that everything is in one document.

JT

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

More
21 Nov 2019 14:55 #150832 by jools
Replied by jools on topic LinuxCNC is Poorly Documented

BigJohnT wrote:

jools wrote:

BigJohnT wrote:

jools wrote: MY hal file has no 'loadrt pwmgen, it has neither of the addf parts and none of the net commands either even though this configuration was built using the 7i96 tool.


Unfortunately I've not gotten around to adding the code for PWM spindle in the 7i96 configuration tool mainly because I don't understand it completely. If I had a good example I could update the tool.

JT


Did you ever get the spindle controlled using the 7i96 by any other means? If so could you post your hal and ini for that please. I've tried doing a 7i76e pnc conf and porting the settings but am getting errors.

I don't have a 7i96 in any machine just on my workbench. I'm still using 5i25 based and one 5i20!

Thanks

Jools


I'm working on adding the PWM to the 7i96 configuration tool but ran into an issue with Python 3.7 that I must iron out first :( I hope to have that sorted out tomorrow if I don't loose internet again...

I don't have a 7i96 in any machine just on my workbench. I'm still using 5i25 based and one 5i20!

JT


:laugh: Similar to me then. I have until monday to figure out the HAL to run my servo in velocity mode via the 7i96 :ohmy: :huh: :sick:

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

More
21 Nov 2019 16:07 #150842 by jools
Replied by jools on topic LinuxCNC is Poorly Documented

BigJohnT wrote:

jools wrote:

BigJohnT wrote:

jools wrote: MY hal file has no 'loadrt pwmgen, it has neither of the addf parts and none of the net commands either even though this configuration was built using the 7i96 tool.


Unfortunately I've not gotten around to adding the code for PWM spindle in the 7i96 configuration tool mainly because I don't understand it completely. If I had a good example I could update the tool.

JT


Did you ever get the spindle controlled using the 7i96 by any other means? If so could you post your hal and ini for that please. I've tried doing a 7i76e pnc conf and porting the settings but am getting errors.

I don't have a 7i96 in any machine just on my workbench. I'm still using 5i25 based and one 5i20!

Thanks

Jools


I'm working on adding the PWM to the 7i96 configuration tool but ran into an issue with Python 3.7 that I must iron out first :( I hope to have that sorted out tomorrow if I don't loose internet again...

I don't have a 7i96 in any machine just on my workbench. I'm still using 5i25 based and one 5i20!

JT


PCW got my PWM working. Thread here forum.linuxcnc.org/38-general-linuxcnc-q...lved?start=20#150841

Hope this helps.

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

More
21 Nov 2019 23:37 #150869 by BigJohnT
Yes that will help a lot, can you post every change you had to make to get PWM to work?

I did sort out my Python 3.7 issue I think so I can move on.

JT

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

More
22 Nov 2019 00:04 - 22 Nov 2019 00:09 #150870 by PCW
Replied by PCW on topic LinuxCNC is Poorly Documented
In my test is was just adding two net commands
1 To link spindle on to PWM enable
2. To link spindle speed to PWM value
(plus fix the PWM mode to 1, 0 is not legal)

Ultimately it would be better to add a PID component
for closed loop, (the PID comp is just a passthrough for open loop)
Note that this is easier now with master since the encoder now
has a velocity in RPM pin
Last edit: 22 Nov 2019 00:09 by PCW.

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

More
22 Nov 2019 11:29 #150899 by jools
Replied by jools on topic LinuxCNC is Poorly Documented

BigJohnT wrote: Yes that will help a lot, can you post every change you had to make to get PWM to work?

I did sort out my Python 3.7 issue I think so I can move on.

JT


Hi John

So I
- Flashed with PWM firmware and went through and set up as normal in the configuration tool.
- On the spindle tab I selected the PWM option to enable then closed loop
- Following the instructions on the spindle tab I used the outputs tab and set spindle on, cw and ccw

The above caused LCNC not to load.
On the info screen about why it didn't load it referenced the outputs for the spindle (created in the IO.hal file as having no pin existing). The error on loading only commented on the first line it comes to in the IO.hal file I.E motion.spindle-forward. If you delete that line it will error with the next out put you have created in relation to the spindle until you have deleted all of them.
The IO.HAL I had is below.
# This file was created with the 7i96 Wizard on Nov 20 2019 09:23:10
# If you make changes to this file your screwed

net home-joint-0 joint.0.home-sw-in <= hm2_7i96.0.gpio.000.in
net home-joint-1 joint.1.home-sw-in <= hm2_7i96.0.gpio.001.in
net home-joint-2 joint.2.home-sw-in <= hm2_7i96.0.gpio.002.in
net spindle-cw motion.spindle-forward => hm2_7i96.0.ssr.00.out-00
net spindle-on motion.spindle-on => hm2_7i96.0.ssr.00.out-01
net spindle-ccw motion.spindle-reverse => hm2_7i96.0.ssr.00.out-02

Upon deletion of the three lines in the IO.hal file LCNC will run but there were no manual spindle buttons showing on the Axis manual tab.
PCW kindly came up with the below two lines that are inserted below the spindle commands in the .hal file.
net spindle_on spindle.0.on hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-05
net spindle_speed spindle.0.speed-out hm2_7i96.0.pwmgen.00.value

This gets the spindle commands to show and PWM to work when it's 'type=1' in HAL. (The configuration tool sets it to '=0' which shows little error boxes on startup of LCNC in the bottom right. LCNC does however 'auto-sort' this problem at startup and changes to type=1 automatically, though this happens every startup).

Doing the above gives me a PWM output on pins 2 and 3 of the 1st block of TB2 on the 7i96. The PWM is default -5v and goes all the way to +5v in .4v increments upon clicking the speed increase button.
It gives a direction change on pins 4 and 5, the voltage change for this is -5v clockwise, +5v CCW.

Questions and observations
- Should the default and resting PWM voltage not be 0V?
- For me I am using it to drive a spindle servo - Should I offset my spindles 'stop' voltage so that it thinks -5v is 0V?
- Or should linuxcnc use it's 'offset' function to adjust this internally
- PWM type=2 (up and down) does not seem to work on this. Maybe because of the -5v at stop issue above it can't go lower for reverse.

Hope this helps John. Many thanks to you and PCW for your help to me and others on this.

P.S. John - I had a couple of issues with installing Mesa flash and the 7i96 tool as per the instructions on your github page. With Mesaflash installation the issue was with this:

From the top level directory, switch to the source directory:
cd mesaflash
In the source directory to build MesaFlash:
make

This threw an error saying no target file (or something like that. Searching around I found the answer and I think it's that you have to go into
cd mesaflash mesaflash
So you are within the directory called mesaflash, then it ran perfectly.

I also got an error when trying to update as I had a previously installed version of Mesaflash, files already existing that caused error. It may be useful for others if they delete any instances first, I think I used
apt-get remove mesaflash
then it went singingly.

On the 7i96 installation instructions it was my lack of Linux knowledge that was the issue but others may have this.
3. Create a file in your home directory called .xsessionrc and add the following if your using Debian 9 then log out and back in or reboot the PC.

if [ -d $HOME/.local/bin ]; then
  export PATH="$HOME/.local/bin:$PATH"
fi

- I created the file using Nautilus as I had no idea of the commands to do it in terminal. May you add a code line to show others like me the quick way please.
- Then the real hard part for me was adding the code to the file. The answer was to sudo nano but if those could be updated I think it would certainly help Linux noobs like me.

Once again thanks for all the time and effort you guys invest in this project.

Jools

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

More
22 Nov 2019 12:36 #150903 by PCW
Replied by PCW on topic LinuxCNC is Poorly Documented
- Should the default and resting PWM voltage not be 0V?

It is, if you measure STEP4+ relative to ground
Note that STEP4+ will be at +5V before LinuxCNC starts so you need to have a
separate spindle enable (you can avoid this issue by using STEP- and inverting the
PWM pin in HAL)

- For me I am using it to drive a spindle servo - Should I offset my spindles 'stop' voltage so that it thinks -5v is 0V?

No need, this is a wiring issue

- Or should linuxcnc use it's 'offset' function to adjust this internally

No need

- PWM type=2 (up and down) does not seem to work on this. Maybe because of the -5v at stop issue above it can't go lower for reverse.

PWM type 2 does work (but probably not in the way you think)

For normal PWM (type 1) the PWM value is the same for positive and negative but the DIR pin changes (this is called sign-magnitude PWM)

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

Time to create page: 0.110 seconds
Powered by Kunena Forum