Mesa 7i96 with SPINX1 to control spindle speed

More
24 Feb 2022 15:12 #235707 by kbec
This is when the spindle should be running, you can see the changes:
 

File Attachment:

File Name: 7i96spin.txt
File Size:63 KB
Attachments:

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

More
24 Feb 2022 15:37 - 24 Feb 2022 15:54 #235709 by PCW
The ini file PID values are incorrect for a spindle
They need to be what I posted before:

Oops never mind, I was looking at the wrong PID channel

but:

23 float IN 1 pid.1.command <== spindle-vel-cmd-rpm

The commanded RPM is 1!

You should probably set this to all least 1/2 speed (1400) for initial tests.

Also:

23 s32 RW 0 pid.1.do-pid-calcs.tmax

The 0 time means that there is a missing addf for pid1

The missing addf means the PID 1 output will be stuck at 0

 
Last edit: 24 Feb 2022 15:54 by PCW.

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

More
24 Feb 2022 15:57 - 24 Feb 2022 15:58 #235712 by kbec
Here is another file with the speed increased a bit

    23  float IN            301  pid.1.command <== spindle-vel-cmd-rpm
    19  float OUT           301  spindle.0.speed-out ==> spindle-vel-cmd-rpm
    19  float OUT           301  spindle.0.speed-out-abs ==> spindle-vel-cmd-rpm-abs
float           301  spindle-vel-cmd-rpm
float           301  spindle-vel-cmd-rpm-abs
    19  float RO            301  motion.debug-float-0

File Attachment:

File Name: 7i96spin_speedup.txt
File Size:63 KB


That was just turning on before. It does increase when I press the + in LinuxCNC, but still no change in the value

29 float IN 0 hm2_7i96.0.pwmgen.00.value <== spindle-output
Attachments:
Last edit: 24 Feb 2022 15:58 by kbec.

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

More
24 Feb 2022 15:59 - 24 Feb 2022 16:01 #235714 by PCW
Yeah, that will stay at 0 until the missing addf is fixed:

addf pid.1.do-pid-calcs servo-thread
Last edit: 24 Feb 2022 16:01 by PCW.

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

More
24 Feb 2022 16:03 #235716 by kbec
Any idea what the addf should look like? I can add manually and test it. Almost all the documentation is geared towards parallel port or drastically different cards and setups.

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

More
24 Feb 2022 16:08 - 24 Feb 2022 16:08 #235717 by PCW
addf pid.1.do-pid-calcs servo-thread
Last edit: 24 Feb 2022 16:08 by PCW.

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

More
24 Feb 2022 16:21 - 24 Feb 2022 16:22 #235719 by kbec
Makes sense, but didn't seem to fix anything. value is still at 0.

29 float IN 0 hm2_7i96.0.pwmgen.00.value <== spindle-output

 

File Attachment:

File Name: 7i96spin_s...ADDF.txt
File Size:63 KB

 

File Attachment:

File Name: spintest3.hal
File Size:4 KB
Attachments:
Last edit: 24 Feb 2022 16:22 by kbec.

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

More
24 Feb 2022 16:26 - 24 Feb 2022 16:29 #235721 by PCW
looks like you have the spindle turned off:

23 bit IN FALSE pid.1.enable <== spindle-enable

or

net spindle-enable pid.1.enable

should be

net spindle-on pid.1.enable
Last edit: 24 Feb 2022 16:29 by PCW.

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

More
24 Feb 2022 17:03 #235727 by kbec
Made this change

#net spindle-enable pid.1.enable
net spindle-on pid.1.enable

Now the value seems to be working. I will need to check my SPINX out, but at least the signals going in look like they are working now.


kirk@LinuxCNC1:~/linuxcnc/configs/spintest3$ halcmd getp  hm2_7i96.0.pwmgen.00.value
0
kirk@LinuxCNC1:~/linuxcnc/configs/spintest3$ Issuing EMC_SPINDLE_ON --   ( +1304,+64,   +62,1.000000,0.000000,0.000000,    +1,)
halcmd getp  hm2_7i96.0.pwmgen.00.value
1
kirk@LinuxCNC1:~/linuxcnc/configs/spintest3$ Issuing EMC_SPINDLE_INCREASE --     ( +1309,+40,   +63,0.000000,)
Issuing EMC_SPINDLE_CONSTANT --          ( +1311,+40,   +64,0.000000,)
halcmd getp  hm2_7i96.0.pwmgen.00.value
101

Also attaching the latest hal file for  BigJohnT to look at. 
 

File Attachment:

File Name: spintest3_...2-24.hal
File Size:4 KB


I think what fixed it to work was adding
addf pid.1.do-pid-calcs servo-thread

and the change for the enable
#net spindle-enable pid.1.enable
net spindle-on pid.1.enable

I do notice my direction LED comes on and doesn't turn off, whether enabled or not, is that kind of expected?

Thanks a bunch to both of you. John, once you have something else for me to test, just let mw know, I understand if it may take a little while.

 
Attachments:

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

More
24 Feb 2022 18:15 #235734 by BigJohnT
My internet has been down all day. Anyway pid-1-do-calcs never got in the hal file. As soon as I get internet back up I'll push the fix. Using my phone for internet is painful lol.

JT

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

Moderators: PCWjmelson
Time to create page: 0.901 seconds
Powered by Kunena Forum