Spindle PWM pins?
29 Apr 2024 21:36 #299344
by Dave2024
Spindle PWM pins? was created by Dave2024
Hi so my machine uses a parallel port and the spindle speed can apparently be controlled by PWM. The thing is that there’s only two pins for the spindle control, pin 2 and pin 3. In my user manual it says pin 2 is Spindle-CW and pin 3 is Spindle-CCW. Does this mean that the PWM signal also needs to be set to those same pins? I’m looking at the instructions for PWM spindle speed
here
and but don’t understand what I’m supposed to do? Do I just follow the directions but set the pins to be those same pins 2 and 3 in the hal file? Thanks
Please Log in or Create an account to join the conversation.
29 Apr 2024 21:41 #299345
by Dave2024
Replied by Dave2024 on topic Spindle PWM pins?
Like in the hal file do I just add:
loadrt pwmgen output_type=0
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-on motion.spindle-on => pwmgen.0.enable
net spindle-pwm pwmgen.0.pwm => parport.0.pin-02-out
# Set the spindle's top speed in RPM
setp pwmgen.0.scale 1800
And
loadrt pwmgen output_type=0
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-on motion.spindle-on => pwmgen.0.enable
net spindle-pwm pwmgen.0.pwm => parport.0.pin-03-out
# Set the spindle's top speed in RPM
setp pwmgen.0.scale 1800
loadrt pwmgen output_type=0
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-on motion.spindle-on => pwmgen.0.enable
net spindle-pwm pwmgen.0.pwm => parport.0.pin-02-out
# Set the spindle's top speed in RPM
setp pwmgen.0.scale 1800
And
loadrt pwmgen output_type=0
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-on motion.spindle-on => pwmgen.0.enable
net spindle-pwm pwmgen.0.pwm => parport.0.pin-03-out
# Set the spindle's top speed in RPM
setp pwmgen.0.scale 1800
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
Less
More
- Posts: 19300
- Thank you received: 6462
29 Apr 2024 22:26 - 29 Apr 2024 22:26 #299350
by tommylight
Replied by tommylight on topic Spindle PWM pins?
1. the above will not work, there can not be same lines inside a hal file
2. what drive?
We can not help without more info, and please do not make us chase info on the internet, we all volunteer out time here to help.
-
In case it ends up as you mention above in needing a PWM signal in one or the other pin, that would need a bit of hal wizardry to change from one pin to the other when changing direction, i would guess doable.
First, we have to be sure that is the case, then we can venture into hal and come up with something that works for you.
Edit:
Pictures always help.
2. what drive?
We can not help without more info, and please do not make us chase info on the internet, we all volunteer out time here to help.
-
In case it ends up as you mention above in needing a PWM signal in one or the other pin, that would need a bit of hal wizardry to change from one pin to the other when changing direction, i would guess doable.
First, we have to be sure that is the case, then we can venture into hal and come up with something that works for you.
Edit:
Pictures always help.
Last edit: 29 Apr 2024 22:26 by tommylight. Reason: more info
Please Log in or Create an account to join the conversation.
29 Apr 2024 22:37 #299351
by Dave2024
Replied by Dave2024 on topic Spindle PWM pins?
Well hey thanks for your helping us noobies out. I did an experiment where rather than having Spindle-CW going to pin 2 i changed it to Spindle-PWM and left Spindle-CCW on pin 3. Now the spindle starts up when running M3 S1000 only its spinning way faster than 1000 RPM. It also actuates +- about 400RPM and doesn’t sound very good either. I believe the PWM frequency is out of tune. How do I figure out the frequency settings to match for the motor so it spins at the correct speed and doesn’t fluctuate? Again thanks for your help
Please Log in or Create an account to join the conversation.
Time to create page: 0.100 seconds