spindle reverse using PMW

More
11 Apr 2018 22:09 #108841 by dhanger
Hi group-

I've done a lot of reading and have seen this come up before, but haven't found an answer. I am trying to set up a spindle reverse signal using pmwgen, but can't get it to work. I can get a pwm signal at my BOB's vfd output for forward, which works great, but when I use M4 for reverse I get nothing at the vfd output. I set up a watch list in HAL and see that everything is switching per my setup correctly, except that the pwmgen signal in the watch list for spindle ccw does nothing, so it seems to originate at LinuxCNC (the signal is intermittent in the watch list for spindle cw

Attachment not found

Attachment not found

, so assuming that it can't update in real time, but nothing at all in spindle ccw). I am attaching my HAL file--any help would be greatly appreciated.

Thanks,
Dan
Attachments:

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

More
11 Apr 2018 22:10 #108842 by dhanger
Replied by dhanger on topic spindle reverse using PMW
Sorry for the botched attachment in the message, don't know why that happened....

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

More
12 Apr 2018 17:10 - 12 Apr 2018 17:28 #108890 by Patrik T
Replied by Patrik T on topic spindle reverse using PMW
You say these are all OK for both M3 and M4:
net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= motion.spindle-on => pwmgen.0.enable
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse

But this is only OK for M3, not M4:
net spindle-pwm <= pwmgen.0.pwm

What does "pwmgen.0.curr−dc" show?
What S-value are you using?

What happens if you try this?
net spindle-cmd-rpm-abs => pwmgen.0.value

Why do you need the offset?
setp pwmgen.0.offset 0.114285714286
Last edit: 12 Apr 2018 17:28 by Patrik T. Reason: Spelling

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

More
12 Apr 2018 21:46 #108908 by dhanger
Replied by dhanger on topic spindle reverse using PMW
Hi Patrik-

You say these are all OK for both M3 and M4:
net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= motion.spindle-on => pwmgen.0.enable
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse

But this is only OK for M3, not M4:
net spindle-pwm <= pwmgen.0.pwm

What does "pwmgen.0.curr−dc" show?
What S-value are you using?


M3S500 gives 0.134932
M4 produces the same value (positive).

What happens if you try this?

net spindle-cmd-rpm-abs => pwmgen.0.value


Nothing changes.

Why do you need the offset?

setp pwmgen.0.offset 0.114285714286


I don't know. This is a stock HAL produced by stepconf using PWM. It's not the same as the one I've been using for several months before trying to get a reversing spindle working. I've just been using the machine this way but recently acquired a polarity reversing circuit from a CNCzone member. The idea is to generate a PWM signal for both forward and reverse, then the circuit reverses the polarity by applying a 5 volt signal, before sending it to the spindle amp.

I was reading this thread from a few years back:

forum.linuxcnc.org/38-general-linuxcnc-q...-no-pwm?limitstart=0

Apparently there was some problem with it a while back but I got the impression any problem with it was fixed. I don't claim to know much about what I'm reading, I'm a newbie (sorta) to HAL configuration so I'm just poking and hoping.

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

More
12 Apr 2018 21:59 #108910 by dhanger
Replied by dhanger on topic spindle reverse using PMW
Patrik-

I was wrong about changing that line:

net spindle-cmd-rpm-abs => pwmgen.0.value

I am now getting a PWM signal at the VFD and a negative signal at the spindle amp, for some other reason the spindle still isn't turning. I'm sure it's just some other configuration error I've made that I need to investigate since I've been able to get the spindle to reverse when applying the 5 volt signal manually. I'll report back when I get that problem straightened out, but it appears you've put me on the right track.

Thanks,
Dan

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

More
12 Apr 2018 22:10 #108913 by dhanger
Replied by dhanger on topic spindle reverse using PMW
Yup, I wasn't applying the signal to the spindle amp enable properly in M4, once I corrected that everything is good. Thanks again.

Dan

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

More
12 Apr 2018 22:26 #108917 by Patrik T
Replied by Patrik T on topic spindle reverse using PMW
OK, great.
I don't think I actually helped much, I only got you to start poking again :)
But if you are happy, I'm happy.
Cheers

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

Time to create page: 0.078 seconds
Powered by Kunena Forum