0-10V output for spindle speed control is not working

More
2 years 11 months ago - 2 years 11 months ago #285470 by Gurt
Hello PCW, MDI M3 s1000 shows 1000rpm on LinuxCNC but my output voltage is about 9.25V instead of about 0.75, so the spindle speed is about 21'800rpm.
To solve my problem, I have to invert the duty cycle of my pwm... but how?
Probably something to set in my custom.hal where my pwmgen is set
Last edit: 2 years 11 months ago by Gurt.

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

More
2 years 11 months ago #285488 by PCW
Probably something like:

setp parport.0.pin-01-out-invert true
The following user(s) said Thank You: Gurt, BSOD

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

More
2 years 11 months ago - 2 years 11 months ago #285492 by Gurt
Thank you so much, it works with this extra line in my custom.hal !!!! :-)
Other questions :
- to go from 0V to 10V it takes a while (due to the converter on the BOB probably ; or a parameter in pwgen...)

- the "Spindle-at-speed" indicator is stuck green, I have to look about that...

Once all my problem solved, I will do a "quick help" for other users who have problems to drive the spindle with these chinese BOB
Last edit: 2 years 11 months ago by Gurt.

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

More
1 year 4 months ago #329955 by Mr.Q
Hi all, Im starting to transition from mach3 to linuxcnc on my hobby machine. Im having troubles at seting up the PWM to VFD corectly. 
I added the folowing to the custom.hal

# --- Load the PWM generator component ---
loadrt pwmgen output_type=1

# --- Add the PWM generator functions to the servo-thread for smooth updates ---
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread

# --- Spindle ON/OFF control (Relay on Pin 17 thats on my breakoutboard and works nicely) ---
# Connect the signal from the 'spindle.0' component to the physical pin.
net spindle-enable <= spindle.0.on
net spindle-enable => parport.0.pin-17-out

# --- Spindle Speed PWM signal (Speed on Pin 1) ---
net spindle-speed-cmd spindle.0.speed-out => pwmgen.0.value

# Enable the PWM generator ONLY when the spindle is supposed to be on (M3)
net spindle-enable => pwmgen.0.enable

# Connect the pwmgen output to the physical parallel port pin 1 - this sends the 0-10v pwm from breakoutboard to vfd, also needed inverting
net spindle-pwm-signal pwmgen.0.pwm => parport.0.pin-01-out
setp parport.0.pin-01-out-invert 1

# Tell the PWM generator that the max value (100% duty) equals the scale from the INI file
setp pwmgen.0.scale 24000


My problem now is, in linuxcnc the maximum rpm it lets me at 100% is 200.
but it doesnt even reac that..my pwmgen.0.value is 200 in halshow. (added a picture).
output pin is corect, i get 10V if i dont invert the pin and vely low V when i do invert it.

i am confused as to how or why max i get is 200? same with speed-out wich is the one setting the .value
What am i doing wrong?
 

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

More
1 year 4 months ago - 1 year 4 months ago #329957 by PCW
The 200 RPM is probably a GUI setup ini parameter

Can you set say 12000 RPM with (MDI)
 M3 S12000

?
Last edit: 1 year 4 months ago by PCW.

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

Time to create page: 0.290 seconds
Powered by Kunena Forum