- Posts: 6
- Thank you received: 0
Spindle PWM Mesa 5i25 not setting speed
- e76nystrom
- Topic Author
- Offline
- New Member
-
Less
More
3 years 9 months ago #262899
by e76nystrom
Spindle PWM Mesa 5i25 not setting speed was created by e76nystrom
I am running Axis 2.8.4 with a Mesa 5i25. I have it configured to set the spindle speed using pwmgen. I get a pwm output on the correct pin at the correct frequency but it is a very narrow pulse (seen with oscilloscope) and does not change with the speed.
In the hal file I have the following:
addf pwmgen.update servo-thread
# --- SPINDLE-PWM ---
net spindle-speed-cmd spindle.0.speed-out => hm2_5i25.0.pwmgen.00.value
net spindle-on spindle.0.on => hm2_5i25.0.pwmgen.00.enable
setp hm2_5i25.0.pwmgen.00.output-type 1
setp hm2_5i25.0.pwmgen.pwm_frequency 100
setp hm2_5i25.0.pwmgen.00.scale 3600
The ini file does not contain any spindle configuration settings.
Running the command: halcmd show all | grep spindle shows a low speed
19 float OUT 0.01666667 spindle.0.speed-cmd-rps
19 float IN 0 spindle.0.speed-in <== spindle-vel-fb-rps
19 float OUT 1 spindle.0.speed-out ==> spindle-speed-cmd
19 float OUT 1 spindle.0.speed-out-abs ==> spindle-vel-cmd-rpm-abs
19 float OUT 0.01666667 spindle.0.speed-out-rps ==> spindle-vel-cmd-rps
19 float OUT 0.01666667 spindle.0.speed-out-rps-abs ==> spindle-vel-cmd-rps-abs
The command halcmd show all | grep pwm shows:
35 RT pwmgen ready
26 bit IN TRUE hm2_5i25.0.pwmgen.00.enable <== spindle-on
26 float IN 1 hm2_5i25.0.pwmgen.00.value <== spindle-speed-cmd
35 float OUT 0 pwmgen.0.curr-dc
35 bit I/O FALSE pwmgen.0.dither-pwm
35 bit IN FALSE pwmgen.0.enable
35 float I/O 1 pwmgen.0.max-dc
35 float I/O 0 pwmgen.0.min-dc
35 float I/O 0 pwmgen.0.offset
35 bit OUT FALSE pwmgen.0.pwm
35 float I/O 0 pwmgen.0.pwm-freq
35 float I/O 1 pwmgen.0.scale
35 float IN 0 pwmgen.0.value
35 s32 OUT 0 pwmgen.make-pulses.time
35 s32 OUT 801 pwmgen.update.time
==> hm2_5i25.0.pwmgen.00.enable
==> hm2_5i25.0.pwmgen.00.value
26 bit RW FALSE hm2_5i25.0.pwmgen.00.offset-mode
26 bit RW FALSE hm2_5i25.0.pwmgen.00.out0.invert_output
26 bit RW FALSE hm2_5i25.0.pwmgen.00.out0.is_opendrain
26 s32 RW 1 hm2_5i25.0.pwmgen.00.output-type
26 float RW 3600 hm2_5i25.0.pwmgen.00.scale
26 u32 RW 0x00004E20 hm2_5i25.0.pwmgen.pdm_frequency
26 u32 RW 0x00000064 hm2_5i25.0.pwmgen.pwm_frequency
35 s32 RW 0 pwmgen.make-pulses.tmax
35 bit RO FALSE pwmgen.make-pulses.tmax-increased
35 s32 RW 38025 pwmgen.update.tmax
35 bit RO FALSE pwmgen.update.tmax-increased
hm2_5i25.0.pwmgen.00.out0.invert_output hm2_5i25.0.gpio.000.invert_output
hm2_5i25.0.pwmgen.00.out0.is_opendrain hm2_5i25.0.gpio.000.is_opendrain
00035 7f3d56f07a3a 7f3d5a102680 NO 0 pwmgen.make-pulses
00035 7f3d56f07b7b 7f3d5a102680 YES 1 pwmgen.update
In the hal file I have the following:
addf pwmgen.update servo-thread
# --- SPINDLE-PWM ---
net spindle-speed-cmd spindle.0.speed-out => hm2_5i25.0.pwmgen.00.value
net spindle-on spindle.0.on => hm2_5i25.0.pwmgen.00.enable
setp hm2_5i25.0.pwmgen.00.output-type 1
setp hm2_5i25.0.pwmgen.pwm_frequency 100
setp hm2_5i25.0.pwmgen.00.scale 3600
The ini file does not contain any spindle configuration settings.
Running the command: halcmd show all | grep spindle shows a low speed
19 float OUT 0.01666667 spindle.0.speed-cmd-rps
19 float IN 0 spindle.0.speed-in <== spindle-vel-fb-rps
19 float OUT 1 spindle.0.speed-out ==> spindle-speed-cmd
19 float OUT 1 spindle.0.speed-out-abs ==> spindle-vel-cmd-rpm-abs
19 float OUT 0.01666667 spindle.0.speed-out-rps ==> spindle-vel-cmd-rps
19 float OUT 0.01666667 spindle.0.speed-out-rps-abs ==> spindle-vel-cmd-rps-abs
The command halcmd show all | grep pwm shows:
35 RT pwmgen ready
26 bit IN TRUE hm2_5i25.0.pwmgen.00.enable <== spindle-on
26 float IN 1 hm2_5i25.0.pwmgen.00.value <== spindle-speed-cmd
35 float OUT 0 pwmgen.0.curr-dc
35 bit I/O FALSE pwmgen.0.dither-pwm
35 bit IN FALSE pwmgen.0.enable
35 float I/O 1 pwmgen.0.max-dc
35 float I/O 0 pwmgen.0.min-dc
35 float I/O 0 pwmgen.0.offset
35 bit OUT FALSE pwmgen.0.pwm
35 float I/O 0 pwmgen.0.pwm-freq
35 float I/O 1 pwmgen.0.scale
35 float IN 0 pwmgen.0.value
35 s32 OUT 0 pwmgen.make-pulses.time
35 s32 OUT 801 pwmgen.update.time
==> hm2_5i25.0.pwmgen.00.enable
==> hm2_5i25.0.pwmgen.00.value
26 bit RW FALSE hm2_5i25.0.pwmgen.00.offset-mode
26 bit RW FALSE hm2_5i25.0.pwmgen.00.out0.invert_output
26 bit RW FALSE hm2_5i25.0.pwmgen.00.out0.is_opendrain
26 s32 RW 1 hm2_5i25.0.pwmgen.00.output-type
26 float RW 3600 hm2_5i25.0.pwmgen.00.scale
26 u32 RW 0x00004E20 hm2_5i25.0.pwmgen.pdm_frequency
26 u32 RW 0x00000064 hm2_5i25.0.pwmgen.pwm_frequency
35 s32 RW 0 pwmgen.make-pulses.tmax
35 bit RO FALSE pwmgen.make-pulses.tmax-increased
35 s32 RW 38025 pwmgen.update.tmax
35 bit RO FALSE pwmgen.update.tmax-increased
hm2_5i25.0.pwmgen.00.out0.invert_output hm2_5i25.0.gpio.000.invert_output
hm2_5i25.0.pwmgen.00.out0.is_opendrain hm2_5i25.0.gpio.000.is_opendrain
00035 7f3d56f07a3a 7f3d5a102680 NO 0 pwmgen.make-pulses
00035 7f3d56f07b7b 7f3d5a102680 YES 1 pwmgen.update
Please Log in to join the conversation.
3 years 9 months ago #262904
by PCW
Replied by PCW on topic Spindle PWM Mesa 5i25 not setting speed
Looks like you have both a software and the 5I25s hardware PWMgen
in your hal file, all the software PWM stuff should be deleted for clarity.
I would expect a very narrow pulse at a commanded PWM value of
1 and a scale of 3600 (just one bit time out of 4096):
26 float IN 1 hm2_5i25.0.pwmgen.00.value <== spindle-speed-cmd
in your hal file, all the software PWM stuff should be deleted for clarity.
I would expect a very narrow pulse at a commanded PWM value of
1 and a scale of 3600 (just one bit time out of 4096):
26 float IN 1 hm2_5i25.0.pwmgen.00.value <== spindle-speed-cmd
Please Log in to join the conversation.
- e76nystrom
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
3 years 9 months ago #262939
by e76nystrom
Replied by e76nystrom on topic Spindle PWM Mesa 5i25 not setting speed
With more testing, I found it will work if I set the speed with the S command and use M3 M4 and M5 from MDI. If I set the speed with the S command in MDI and use the buttons in Manual Control the speed gets reset to 1. I can increase and decrease the speed with the speed plus and speed minus.
I know at some time in the past I could set the speed in MDI and control it from Manual Control.
I know at some time in the past I could set the speed in MDI and control it from Manual Control.
Please Log in to join the conversation.
3 years 9 months ago #262940
by PCW
Replied by PCW on topic Spindle PWM Mesa 5i25 not setting speed
Looks like some kind of axis setup issue
("1" seems like a default value of some spindle parameter)
May need to open a thread on the Axis GUIs spindle setup
to get the attention of someone knowledgeable about spindle
setup for manual control in Axis...
("1" seems like a default value of some spindle parameter)
May need to open a thread on the Axis GUIs spindle setup
to get the attention of someone knowledgeable about spindle
setup for manual control in Axis...
Please Log in to join the conversation.
Time to create page: 0.081 seconds
