LPT Spindel PWM Different Speed With M3 and M4

More
26 Dec 2014 23:00 - 27 Dec 2014 03:12 #54309 by juergen-home
I set up my linuxcnc like in the pictures attached.

For this setup a worked with a Spindel attached with a FVD.
With commanded M3 S3000 (cw) it runs 2690 RPM.
With commanded M4 S3000 (ccw) it runs 2870 RPM.

So I checked the spindle-pwm signal with the HAL-Scope.
The pwm signal seems to be different with M3 / M4. (picture1+2)

Can somebody verify this on his own computer?













File Attachment:

File Name: Meine-Maschine2.hal
File Size:4 KB
Last edit: 27 Dec 2014 03:12 by juergen-home.

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

More
27 Dec 2014 00:21 #54310 by PCW
Not sure if the pwmgen offset does what you are expecting with signed PWM values

you may have to use the absolute function on the commanded spindle speed
and feed the pwmgen with only positive values (and get the dir signal from the abs comp)
The following user(s) said Thank You: juergen-home

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

More
27 Dec 2014 03:09 - 27 Dec 2014 03:32 #54311 by juergen-home
So I changed the hal file the way to be told. Now it's working perfect.
Same speed for M3 and M4. Thank You.

#old: with different speed for M3 and M4 (generated by stepconf wizard)
#loadrt abs count=1
#net spindle-cmd <= motion.spindle-speed-out => pwmgen.0.value

# new: for same speed M3 and M4
loadrt abs count=2
addf abs.1 servo-thread
net spindle-cmd <= motion.spindle-speed-out
net spindle-cmd => abs.1.in
net spindle-cmd-abs <= abs.1.out
net spindle-cmd-abs => pwmgen.0.value

addendum:
>linuxcnc.org/docs/html/man/man9/pwmgen.9.html
>loadrt pwmgen output_type=type0[,type1...]
>type 1: pwm/direction
>Two output pins, pwm and dir. The duty cycle on pwm varies as a function of the input value. dir is low for positive inputs and high for negative inputs.

There is no hint found here that negative values are not working correctly.
Last edit: 27 Dec 2014 03:32 by juergen-home.

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

Time to create page: 0.148 seconds
Powered by Kunena Forum