7i97t Spindle has 0v or 10v
06 Nov 2024 19:40 #313940
by Sziggy_NC
7i97t Spindle has 0v or 10v was created by Sziggy_NC
If I start the spindle at any speed and measure AOUT4 with a multi-meter, I get 10v. What do I need to change or add in my hal file to be able to get the scaling to work properly?
In the spindle control section of the docs, I saw loadrt scale count=1 and more for a 0-10v spindle. If this is what needs to be added to my hal file, what would the <your DAC pin name> be? Is it hm2_7i97.0.pwmgen.04.value?net spindle-speed-DAC scale.0.out => <your DAC pin name>Misc. info:
The spindle has an encoder. I counted its teeth at 256.
The spindle-vel-fb-rpm appears to read the RPM correctly.
I didn't attach my IO.hal, but if you need it let me know.
Thank you for your time.
In the spindle control section of the docs, I saw loadrt scale count=1 and more for a 0-10v spindle. If this is what needs to be added to my hal file, what would the <your DAC pin name> be? Is it hm2_7i97.0.pwmgen.04.value?net spindle-speed-DAC scale.0.out => <your DAC pin name>Misc. info:
The spindle has an encoder. I counted its teeth at 256.
The spindle-vel-fb-rpm appears to read the RPM correctly.
I didn't attach my IO.hal, but if you need it let me know.
Thank you for your time.
Please Log in or Create an account to join the conversation.
06 Nov 2024 20:03 #313948
by PCW
Replied by PCW on topic 7i97t Spindle has 0v or 10v
All the PWM channel 4 setup is commented out...
# ---PWM Generator signals/setup---
#setp hm2_7i97.0.pwmgen.04.dither true
#setp hm2_7i97.0.pwmgen.04.output-type 1 #PWM pin0
#setp hm2_7i97.0.pwmgen.04.offset-mode 1 # offset mode so 50% = 0
#setp hm2_7i97.0.pwmgen.04.scale [SPINDLE_0]SCALE
# ---PWM Generator signals/setup---
#setp hm2_7i97.0.pwmgen.04.dither true
#setp hm2_7i97.0.pwmgen.04.output-type 1 #PWM pin0
#setp hm2_7i97.0.pwmgen.04.offset-mode 1 # offset mode so 50% = 0
#setp hm2_7i97.0.pwmgen.04.scale [SPINDLE_0]SCALE
The following user(s) said Thank You: Sziggy_NC
Please Log in or Create an account to join the conversation.
06 Nov 2024 22:49 #313970
by Sziggy_NC
Replied by Sziggy_NC on topic 7i97t Spindle has 0v or 10v
Thank you for noticing my bonehead move. I commented it out when I was trying the pwm gen copied from pncconf with an 7i92/7i77. (I tried re-naming stuff to 7i97 unsuccessfully.)
Sadly I am still doing something wrong with the pwmgen. I no longer have AOUT4 stuck at 10v, but it is now stuck at 0v.
I have un-commented what you noted in my hal file. Changing [SPINDLE_0]SCALE to SPINDLE_0]OUTPUT_SCALE and adding OUTPUT_SCALE = 10000.0 to my ini file under spindle_0.
The pwmgen that you found was copied from my X axis and renamed for the spindle. It came from Mesa CT.
I am re-reading the pwmgen component in the docs, but I am having trouble understanding what I need to do.
Sadly I am still doing something wrong with the pwmgen. I no longer have AOUT4 stuck at 10v, but it is now stuck at 0v.
I have un-commented what you noted in my hal file. Changing [SPINDLE_0]SCALE to SPINDLE_0]OUTPUT_SCALE and adding OUTPUT_SCALE = 10000.0 to my ini file under spindle_0.
The pwmgen that you found was copied from my X axis and renamed for the spindle. It came from Mesa CT.
I am re-reading the pwmgen component in the docs, but I am having trouble understanding what I need to do.
Please Log in or Create an account to join the conversation.
07 Nov 2024 00:46 #313980
by PCW
Replied by PCW on topic 7i97t Spindle has 0v or 10v
I don't think I saw the pwmgen 04 enable being connected
in your hal file
in your hal file
Please Log in or Create an account to join the conversation.
07 Nov 2024 16:26 #314023
by Sziggy_NC
Replied by Sziggy_NC on topic 7i97t Spindle has 0v or 10v
I had been setting that pin using Halshow for testing, but I will go ahead and net that and add it to my classic ladder file.
Please Log in or Create an account to join the conversation.
07 Nov 2024 20:04 - 07 Nov 2024 20:06 #314035
by Sziggy_NC
Replied by Sziggy_NC on topic 7i97t Spindle has 0v or 10v
I have setup the enable pin in my io.hal and classic ladder files. I am able to rotate the spindle in either direction at about 460 rpm with the buttons on gmmocapy.
Sadly I have no control over the speed. It is either on or off. The multi-meter reads at 0.009v when at 460 rpm. If the 0-10v wires are disconnected from the spindle drive the speed is 6 rpm in either selected direction.
I found someone else's hal and ini on the forum and noticed their spindle-output was net-ed to their pwmgen.04.value. My spindle-output is net-ed to pid.s.output. I tried each method without any change in behavior.
My pwmgen.04.value is not currently connected to anything. Should it be? (Reading the pwmgen section of the docs makes me think this is my problem.)
I have attached updated hal and ini files.
Sadly I have no control over the speed. It is either on or off. The multi-meter reads at 0.009v when at 460 rpm. If the 0-10v wires are disconnected from the spindle drive the speed is 6 rpm in either selected direction.
I found someone else's hal and ini on the forum and noticed their spindle-output was net-ed to their pwmgen.04.value. My spindle-output is net-ed to pid.s.output. I tried each method without any change in behavior.
My pwmgen.04.value is not currently connected to anything. Should it be? (Reading the pwmgen section of the docs makes me think this is my problem.)
I have attached updated hal and ini files.
Last edit: 07 Nov 2024 20:06 by Sziggy_NC.
Please Log in or Create an account to join the conversation.
07 Nov 2024 20:27 #314036
by PCW
Replied by PCW on topic 7i97t Spindle has 0v or 10v
If you don't set the PWM value, the output voltage will not change.
you need:net spindle-output hm2_7i97.0.pwmgen.04.value
The 460 RPM when connected at ~0V is probably a noise issue
This may be soluble with a common mode choke on the spindle 4
analog output and ground.
you need:net spindle-output hm2_7i97.0.pwmgen.04.value
The 460 RPM when connected at ~0V is probably a noise issue
This may be soluble with a common mode choke on the spindle 4
analog output and ground.
The following user(s) said Thank You: Sziggy_NC
Please Log in or Create an account to join the conversation.
07 Nov 2024 20:53 #314041
by Sziggy_NC
Replied by Sziggy_NC on topic 7i97t Spindle has 0v or 10v
I will need to play with the scale some (and look into the choke you mentioned), but it now works. I was replacing "net spindle-output <= pid.s.output" with "net spindle-output => hm2_7i97.0.pwmgen.04.value", when I needed both present in the hal file. Another bonehead move...
Thank you for helping me.
Thank you for helping me.
Please Log in or Create an account to join the conversation.
19 Nov 2024 22:34 #314878
by Sziggy_NC
Replied by Sziggy_NC on topic 7i97t Spindle has 0v or 10v
Sadly the choke didn't seem to change the behavior of the spindle. Maybe I am using the wrong style? It is salvage from some e-waste a few years back. I picked it of the few I have since the wire diameter was similar to the 20awg I was using to wire up the mesa card. I'll attach a photo.
In an attempt to re-scale the spindle output, I was mapping out the actual speed vs the commanded speed. That was when I noticed some odd behavior. It has me wondering if I still have something wrong in the hal or ini.When commanding a speed below around 500 rpm, the spindle runs in reverse. Ex. M3 S100 runs the spindle counter clock wise at 370 rpm. When that command should have run the spindle clock wise at 100 rpm. After I start commanding S500 and up, the spindle resumes the correct rotation. Although, M3 S500 results in 20 rpm. Every commanded increase in rpm after that point is very nearly equal to actual rpm. Ex. Increasing S500 to S600 results in a reported speed of 120 rpm.
The spindle driver board has a wire for both forward and reverse. I control this with a SPDT relay. I checked this relay just in case, but it was not active while going in reverse below M3S500. When an M4 is commanded the relay does become active as it should. M4 commands behave identically to M3, but reversed. Commanded speeds below S500 are clock wise, and speeds at or above S500 are counter clock wise.
When I say actual rpm, this is read from showhal on spindle-vel-cmd-rpm. I have verified it in two ways, 1) the spindle driver has a tachometer on it, 2) I counted the rotations in one minute while the spindle was running at about 20-22 rpm.
My spindle PID are all set to 0. Is this normal for an ac spindle servo?
I will re-attach the hal & ini
In an attempt to re-scale the spindle output, I was mapping out the actual speed vs the commanded speed. That was when I noticed some odd behavior. It has me wondering if I still have something wrong in the hal or ini.When commanding a speed below around 500 rpm, the spindle runs in reverse. Ex. M3 S100 runs the spindle counter clock wise at 370 rpm. When that command should have run the spindle clock wise at 100 rpm. After I start commanding S500 and up, the spindle resumes the correct rotation. Although, M3 S500 results in 20 rpm. Every commanded increase in rpm after that point is very nearly equal to actual rpm. Ex. Increasing S500 to S600 results in a reported speed of 120 rpm.
The spindle driver board has a wire for both forward and reverse. I control this with a SPDT relay. I checked this relay just in case, but it was not active while going in reverse below M3S500. When an M4 is commanded the relay does become active as it should. M4 commands behave identically to M3, but reversed. Commanded speeds below S500 are clock wise, and speeds at or above S500 are counter clock wise.
When I say actual rpm, this is read from showhal on spindle-vel-cmd-rpm. I have verified it in two ways, 1) the spindle driver has a tachometer on it, 2) I counted the rotations in one minute while the spindle was running at about 20-22 rpm.
My spindle PID are all set to 0. Is this normal for an ac spindle servo?
I will re-attach the hal & ini
Please Log in or Create an account to join the conversation.
19 Nov 2024 23:07 #314881
by PCW
Replied by PCW on topic 7i97t Spindle has 0v or 10v
You could verify that the 7I97 analog output voltage makes sense
(it should be 10V*pwm_value/pwm_scale)
Maybe the drive needs some calibration
Also you might try adding a bit of series resistance in the analog output
for stability (say 47 ohms) in case the spindle drive input has a large capacitance
(it should be 10V*pwm_value/pwm_scale)
Maybe the drive needs some calibration
Also you might try adding a bit of series resistance in the analog output
for stability (say 47 ohms) in case the spindle drive input has a large capacitance
Please Log in or Create an account to join the conversation.
Time to create page: 0.128 seconds