- Posts: 1630
- Thank you received: 595
Forum Header
Configuring Spindle Feedback with Proximity Sensor
15 years 7 months ago - 15 years 7 months ago #8215
by RotarySMP
Replied by RotarySMP on topic Re:Configuring Spindle Feedback with Proximity Sensor
I am a new convert to EMC2 ( from TurboCNC) , so my lathe also has a one/rev spindle indexer installed.
I have the lathe running under EMC2.4.3 with Ubuntu 10.04, and the input pin 15 is correctly receiving the spindle index signal (I checked it with the HAL Meter and HAL Scope - cool features)
I understand what is to be done conceptully here, but don't understand the syntax that I need to write in my .HAL file to get this happening.
"You need to connect the incoming pulse to both the encoder index and pulse channels (A and Z), connect encoder.0.position-interpolated to motion.spindle-revs and set the encoder.0.scale to 1. "
How do I do that?
"I've gotten closer I think, and now have the motion.spindle-revs == encoder.0.position-interpolated, and motion.spindle-speed-in reading correct RPS. However motion.spindle-speed-out is zero, and motion.spindle-at-speed is False as is motion.spindle-forward. motion.spindle-on is also False."
What is the syntax to do this please?
I would really appreciate if you could post the spindle portion of your .HAL file please Rus.
I have the lathe running under EMC2.4.3 with Ubuntu 10.04, and the input pin 15 is correctly receiving the spindle index signal (I checked it with the HAL Meter and HAL Scope - cool features)
I understand what is to be done conceptully here, but don't understand the syntax that I need to write in my .HAL file to get this happening.
"You need to connect the incoming pulse to both the encoder index and pulse channels (A and Z), connect encoder.0.position-interpolated to motion.spindle-revs and set the encoder.0.scale to 1. "
How do I do that?
"I've gotten closer I think, and now have the motion.spindle-revs == encoder.0.position-interpolated, and motion.spindle-speed-in reading correct RPS. However motion.spindle-speed-out is zero, and motion.spindle-at-speed is False as is motion.spindle-forward. motion.spindle-on is also False."
What is the syntax to do this please?
I would really appreciate if you could post the spindle portion of your .HAL file please Rus.
Last edit: 15 years 7 months ago by RotarySMP.
Please Log in or Create an account to join the conversation.
15 years 7 months ago #8218
by rkappius
Replied by rkappius on topic Re:Configuring Spindle Feedback with Proximity Sensor
Will do. I'll post the section tonight. Rus
Please Log in or Create an account to join the conversation.
15 years 7 months ago #8238
by rkappius
Replied by rkappius on topic Re:Configuring Spindle Feedback with Proximity Sensor
Attached is my complete hal file. FWIW I never used turboCNC so I'm not sure what the connection with 1 signal per rev is. Anyway my sensor is working dandy. Let me know if you have any other questions. I'm using a slightly older rev of EMC2 but don't think it matters. Rus
Here's the section:
addf stepgen.capture-position servo-thread
addf encoder.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf abs.0 servo-thread
addf scale.0 servo-thread
net spindle-cmd <= motion.spindle-speed-out
setp encoder.0.position-scale 1.000000
setp encoder.0.counter-mode 1
net spindle-position encoder.0.position-interpolated => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-phase-a encoder.0.phase-A
net spindle-phase-a encoder.0.phase-Z
...
net spindle-phase-a <= parport.0.pin-15-in
Here's the section:
addf stepgen.capture-position servo-thread
addf encoder.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf abs.0 servo-thread
addf scale.0 servo-thread
net spindle-cmd <= motion.spindle-speed-out
setp encoder.0.position-scale 1.000000
setp encoder.0.counter-mode 1
net spindle-position encoder.0.position-interpolated => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-phase-a encoder.0.phase-A
net spindle-phase-a encoder.0.phase-Z
...
net spindle-phase-a <= parport.0.pin-15-in
Attachment rkappius_lathe.hal not found
Please Log in or Create an account to join the conversation.
15 years 7 months ago #8265
by RotarySMP
Replied by RotarySMP on topic Re:Configuring Spindle Feedback with Proximity Sensor
Thanks Rus. I have inserted that in my HAL. Didn't get a chance to test it tonight, as the computor is inside hanging on the lan cable.
Please Log in or Create an account to join the conversation.
15 years 6 months ago #9458
by Rick4004
Replied by Rick4004 on topic Re:Configuring Spindle Feedback with Proximity Sensor
I have been trying to get this same setup to work. I contacted Russ offline and he sent me a copy of his HAL file that I have tried to incorporate into my own.
The only thing that gives me a problem is the line "net spindle-position encoder.0.position-interpolated => motion.spindle-revs". If I leave out the word "interpolated", then EMC will start and run. If I include the word,
then I get an error message when I try to start EMC "spinle-test.hal:31:pin encoder.0.position-interpolated does not exist"
When I run EMC without the "interpolated" statement, I think EMC is finding the index position, but I don;t think it is registering the speed. I cannot get the speed to register in the Spindle Speed dialoge box in Axis.
(Although this may be because I am not using the right output statement in the spindle_to_pyvcp.hal file)
This is what I currently have "linksp spindle-speed pyvcp.spindle-speed"
If I open up the Show Hal Configuration dialogue box and watch what is happening, this is what I get:
> Spindle-CMD - toggles between 0 and 1 when I toggle F9
> Spindle-index-enable - The icon stays brown all the time
> Spindle-Phase-a - The icon is yellow
> Spindle-Position - The number starts at 1 and then changes as the spindle turns
> Spindle-Velocity - Stays at 0
My spindle motor is not connected to the computer, I manually start it. If I first I issue a spindle speed command (M3 S100), then I issue a command (G33 Z-1 k.0625) the machine will move from Z0 to Z-1 in a series of jerks, (I am guessing a series of .0625" jerks).
So, it would seem to me that maybe EMC is registering the spindle
position, but not the spindle speed.
Thanks for any help you can provide, I think I am close, but close only counts in horseshoes and hand-grenades,,,
I have attached my Hal file,
Rick
The only thing that gives me a problem is the line "net spindle-position encoder.0.position-interpolated => motion.spindle-revs". If I leave out the word "interpolated", then EMC will start and run. If I include the word,
then I get an error message when I try to start EMC "spinle-test.hal:31:pin encoder.0.position-interpolated does not exist"
When I run EMC without the "interpolated" statement, I think EMC is finding the index position, but I don;t think it is registering the speed. I cannot get the speed to register in the Spindle Speed dialoge box in Axis.
(Although this may be because I am not using the right output statement in the spindle_to_pyvcp.hal file)
This is what I currently have "linksp spindle-speed pyvcp.spindle-speed"
If I open up the Show Hal Configuration dialogue box and watch what is happening, this is what I get:
> Spindle-CMD - toggles between 0 and 1 when I toggle F9
> Spindle-index-enable - The icon stays brown all the time
> Spindle-Phase-a - The icon is yellow
> Spindle-Position - The number starts at 1 and then changes as the spindle turns
> Spindle-Velocity - Stays at 0
My spindle motor is not connected to the computer, I manually start it. If I first I issue a spindle speed command (M3 S100), then I issue a command (G33 Z-1 k.0625) the machine will move from Z0 to Z-1 in a series of jerks, (I am guessing a series of .0625" jerks).
So, it would seem to me that maybe EMC is registering the spindle
position, but not the spindle speed.
Thanks for any help you can provide, I think I am close, but close only counts in horseshoes and hand-grenades,,,
I have attached my Hal file,
Rick
Attachment spinle_test.hal not found
Please Log in or Create an account to join the conversation.
15 years 6 months ago #9460
by andypugh
Replied by andypugh on topic Re:Configuring Spindle Feedback with Proximity Sensor
Your problem is that spindle-position only updates when the edge is detected, whereas position-interpolated updates every servo cycle (with a best-guess value).
If you don't have position-interpolated it probably means that you are using an old version of EMC2. I would suggest an upgrade (you don't have to change the OS, the fact that the 2.4 LiveCD is on Ubuntu 10.04 is a coincidence, not a necessity.
2.4.6 is the current latest release. You should be able to update through apt.
If you don't have position-interpolated it probably means that you are using an old version of EMC2. I would suggest an upgrade (you don't have to change the OS, the fact that the 2.4 LiveCD is on Ubuntu 10.04 is a coincidence, not a necessity.
2.4.6 is the current latest release. You should be able to update through apt.
Please Log in or Create an account to join the conversation.
Time to create page: 0.059 seconds