Mesa 7i96 spindle encoder on Lathe
- pmconsulting
- Offline
- Senior Member
Less
More
- Posts: 71
- Thank you received: 4
24 Jul 2019 03:59 #140390
by pmconsulting
Mesa 7i96 spindle encoder on Lathe was created by pmconsulting
I have a functioning Sherline 4410 lathe configuration with a 1000 ppr differential abz spindle encoder, which I've wired to a Mesa 7i96.
I have a signal from the encoder input, but it's really, really large. I've manually set the scale for the spindle to 1000, but I don't know if I'm setting scale for the encoder or the spindle output. I do not have speed control connected. I just want to use the lathe for threading, which I understand I can do by simply adding an encoder and manually keeping the spindle speed within a sane range.
The 2 configuration utilities that I am aware of, Pcnconf and JT's 7i96 tool, do not seem to provide a means of verifying the signal or calibrating it for display in a Pyvcp panel. If I enable the spindle in John's utility, there is a spot to enter the ppr value for the encoder. I made a separate configuration and copies the relevant code from that config to my working config,
I added this line to my .hal file: net velocity-rpm => hm2_[HOSTMOT2](BOARD).0.encoder.00.velocity-rpm
I added net velocity-rpm => pyvcp.spindle-speed to pyvcp_options.hal.
I have a gauge in the .xml file to display spindle-speed and it works, however it pegs as soon as the spindle is rotating. The values range from about 12,000 at 10-20 rpm up to several million at 3500 rpm. It appears that this is the raw pulses per second. If I set the max value in my .xml file to about 8,000,000, the range seems to match the motor speed, but the display values are exponential, so I probably need to mathematically adjust the pin value for display.
If I want to do lathe threading, I'm assuming that I need to connect this signal to the z axis movement to lock them together according to the pitch needed. It doesn't appear that this happens in either of the configuration utilities. I seem to have, in spite of how many lines of code I've tweaked, still not completed the necessary configuration.
While I have read a good deal of the 800+ page linuxcnc manual, it would save me a great deal of time if anyone could help me complete the following:
1) obtain and connect a calibrated RPM value on my current spindle RPM gauge in pyvcp
2) be able to thread on this lathe.
I've attached my config. I am using the Lathe Macros stuff and also have a VistaCNC P4S configured and functioning for this lathe. Sorry for the extraneous files, but the interesting bits are in the usual locations.
I do promise to provide a video of this process so that anyone reaching this point in the future can coast past it a bit more easily. I do recognize the importance of fully understanding the facets of this, but just like a graphics designer doesn't actually know PostScript when they print a file, I believe a good number of us would be on to bigger and better machining once our systems are simply configured correctly. The art lies in the potential machining and less so the art of building machining systems. Let's conquer & divide.
I have a signal from the encoder input, but it's really, really large. I've manually set the scale for the spindle to 1000, but I don't know if I'm setting scale for the encoder or the spindle output. I do not have speed control connected. I just want to use the lathe for threading, which I understand I can do by simply adding an encoder and manually keeping the spindle speed within a sane range.
The 2 configuration utilities that I am aware of, Pcnconf and JT's 7i96 tool, do not seem to provide a means of verifying the signal or calibrating it for display in a Pyvcp panel. If I enable the spindle in John's utility, there is a spot to enter the ppr value for the encoder. I made a separate configuration and copies the relevant code from that config to my working config,
I added this line to my .hal file: net velocity-rpm => hm2_[HOSTMOT2](BOARD).0.encoder.00.velocity-rpm
I added net velocity-rpm => pyvcp.spindle-speed to pyvcp_options.hal.
I have a gauge in the .xml file to display spindle-speed and it works, however it pegs as soon as the spindle is rotating. The values range from about 12,000 at 10-20 rpm up to several million at 3500 rpm. It appears that this is the raw pulses per second. If I set the max value in my .xml file to about 8,000,000, the range seems to match the motor speed, but the display values are exponential, so I probably need to mathematically adjust the pin value for display.
If I want to do lathe threading, I'm assuming that I need to connect this signal to the z axis movement to lock them together according to the pitch needed. It doesn't appear that this happens in either of the configuration utilities. I seem to have, in spite of how many lines of code I've tweaked, still not completed the necessary configuration.
While I have read a good deal of the 800+ page linuxcnc manual, it would save me a great deal of time if anyone could help me complete the following:
1) obtain and connect a calibrated RPM value on my current spindle RPM gauge in pyvcp
2) be able to thread on this lathe.
I've attached my config. I am using the Lathe Macros stuff and also have a VistaCNC P4S configured and functioning for this lathe. Sorry for the extraneous files, but the interesting bits are in the usual locations.
I do promise to provide a video of this process so that anyone reaching this point in the future can coast past it a bit more easily. I do recognize the importance of fully understanding the facets of this, but just like a graphics designer doesn't actually know PostScript when they print a file, I believe a good number of us would be on to bigger and better machining once our systems are simply configured correctly. The art lies in the potential machining and less so the art of building machining systems. Let's conquer & divide.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17904
- Thank you received: 4774
24 Jul 2019 04:16 - 24 Jul 2019 04:23 #140391
by PCW
Replied by PCW on topic Mesa 7i96 spindle encoder on Lathe
The encoder scale should be 4000
( Spindle scales are in counts per turn )
Also looks like there is no spindle encoder setup at all in the hal file
(so the ini file spindle scale value is not used )
( Spindle scales are in counts per turn )
Also looks like there is no spindle encoder setup at all in the hal file
(so the ini file spindle scale value is not used )
Last edit: 24 Jul 2019 04:23 by PCW.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
Less
More
- Posts: 489
- Thank you received: 155
24 Jul 2019 07:39 #140400
by Hakan
Replied by Hakan on topic Mesa 7i96 spindle encoder on Lathe
I hope the setup is the same for 7i96 and 7i76E. If so I saw that the config line was very tigth and can use some spaces.
I have inserted two "*SPACE*" to show where there probably should be just a space.
To setup the encoder, add something like this. I am vague because I am not 100% sure it is exactly the same on the 7i96, but these are my exact lines for the 7i76EYou should have 4000 on the last line.
These four lines connects the encoder to the right things in motion so that threading, rigid tapping etc can be done.
substitute 7i76e with 7i96.
I have inserted two "*SPACE*" to show where there probably should be just a space.
loadrt [HOSTMOT2](DRIVER) board_ip=[HOSTMOT2](IPADDRESS) config="num_encoders=[HOSTMOT2](ENCODERS) *SPACE* num_stepgens=[HOSTMOT2](STEPGENS)" *SPACE* sserial_port_0=[HOSTMOT2](SSERIAL_PORT)
To setup the encoder, add something like this. I am vague because I am not 100% sure it is exactly the same on the 7i96, but these are my exact lines for the 7i76E
# ---Encoder feedback signals/setup---
setp hm2_7i76e.0.encoder.00.counter-mode 0
setp hm2_7i76e.0.encoder.00.filter 1
setp hm2_7i76e.0.encoder.00.index-invert 1
setp hm2_7i76e.0.encoder.00.index-mask 0
setp hm2_7i76e.0.encoder.00.index-mask-invert 0
setp hm2_7i76e.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
These four lines connects the encoder to the right things in motion so that threading, rigid tapping etc can be done.
net spindle-revs hm2_7i76e.0.encoder.00.position
net spindle-revs motion.spindle-revs
net spindle-index-enable hm2_7i76e.0.encoder.00.index-enable
net spindle-index-enable motion.spindle-index-enable
substitute 7i76e with 7i96.
Please Log in or Create an account to join the conversation.
- pmconsulting
- Offline
- Senior Member
Less
More
- Posts: 71
- Thank you received: 4
24 Jul 2019 19:29 #140462
by pmconsulting
Replied by pmconsulting on topic Mesa 7i96 spindle encoder on Lathe
Thanks Haken & PCW. I've added the lines where they should (I think) go and I'm getting the error: function 'motion.spindle-revs' not found
Not sure what to do next.
Not sure what to do next.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17904
- Thank you received: 4774
24 Jul 2019 19:36 - 24 Jul 2019 20:00 #140463
by PCW
Replied by PCW on topic Mesa 7i96 spindle encoder on Lathe
Most of motions spindle pins changed names recently to support multiple
spindles (a spindle number has been added to the name)
When in doubt about pin/parameter names you should look at the manual
pages:
The spindle pins are generated by the motion component so
man motion
for example
or to list pins / parameters of a running LinuxCNC system type:
halcmd show all > allnames.txt
(which will create a text file of all pins, parameters, functions and signals in the current running LinuxCNC hal environment )
or more limited:
halcmd show pin *spindle*
spindles (a spindle number has been added to the name)
When in doubt about pin/parameter names you should look at the manual
pages:
The spindle pins are generated by the motion component so
man motion
for example
or to list pins / parameters of a running LinuxCNC system type:
halcmd show all > allnames.txt
(which will create a text file of all pins, parameters, functions and signals in the current running LinuxCNC hal environment )
or more limited:
halcmd show pin *spindle*
Last edit: 24 Jul 2019 20:00 by PCW.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
Less
More
- Posts: 489
- Thank you received: 155
24 Jul 2019 20:18 - 24 Jul 2019 20:19 #140467
by Hakan
Replied by Hakan on topic Mesa 7i96 spindle encoder on Lathe
Ooh, am I running such an ancient version?
From the right version of "man motion"
substitute motion.spindle-revs with spindle.0.revs, same for the other one spindle.0.index-enable
From the right version of "man motion"
spindle.M.revs IN FLOAT
For correct operation of spindle synchronized moves, this signal
must be hooked to the position pin of the spindle encoder.
substitute motion.spindle-revs with spindle.0.revs, same for the other one spindle.0.index-enable
Last edit: 24 Jul 2019 20:19 by Hakan.
Please Log in or Create an account to join the conversation.
- pmconsulting
- Offline
- Senior Member
Less
More
- Posts: 71
- Thank you received: 4
25 Jul 2019 00:29 #140485
by pmconsulting
Replied by pmconsulting on topic Mesa 7i96 spindle encoder on Lathe
Have I mentioned that you guys are the best? Really appreciate the help. I have an i7 HP and ethernet directly to a Mesa 7i96. So far its performance has been flawless. I am anxious to get this setup tuned to perfection!
I'll try these adjustments and let you know what I find.
I'll try these adjustments and let you know what I find.
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
Less
More
- Posts: 7330
- Thank you received: 1177
25 Jul 2019 11:50 #140524
by BigJohnT
Replied by BigJohnT on topic Mesa 7i96 spindle encoder on Lathe
Unfortunately I've not tested the spindle part of the 7i96 configuration tool yet. I need to setup a test spindle and test that the code is correct.
JT
JT
Please Log in or Create an account to join the conversation.
- pl7i92
- Offline
- Platinum Member
Less
More
- Posts: 1890
- Thank you received: 356
25 Jul 2019 15:05 #140530
by pl7i92
Replied by pl7i92 on topic Mesa 7i96 spindle encoder on Lathe
woudt be realy good to have a spindle setup for the popular 7i96
in the DOCUMENTATION section
in the DOCUMENTATION section
Please Log in or Create an account to join the conversation.
- pmconsulting
- Offline
- Senior Member
Less
More
- Posts: 71
- Thank you received: 4
25 Jul 2019 16:51 #140545
by pmconsulting
Replied by pmconsulting on topic Mesa 7i96 spindle encoder on Lathe
Yes, JT & pl7i92, I'll keep working on it & post when & if I get it working.
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.315 seconds