1
General Mach Discussion / Re: BLDC Motor Control
« on: November 16, 2009, 09:07:56 AM »
Further Thoughts,
I have got back to testing my Chinese mill with BLDC motor and tried a few more things.
Some of my problems must be put down to bad contacts, cheap test equipment etc but I still have the same basic problem of getting a good correlation between
the input "S" word and the output speed.
I have been trying a Smooth Stepper and this does give much better pulses and speed steps as it uses a 32KHz clock just for this function.
The one thing I have noticed is that If I could add a fixed offset to every input "S" value of about 370RPM I would then get a reasonable speed correlation from
300 to 6000 RPM with a maximum of +7% difference.
Is it possible to modify Mach3 to do this?
I notice in an answer to another question HimyKabibble said
" Or, do what I did - customize the post for your CAM software. I wrote a post-processor to manage the spindle on mine. The CAM program spits out G-code,
with spindle RPM in the S words. My post-processor parses the G-code, finds the S words, and figures out the best motor speed (I have a 2-speed motor) and
pulleys to use to minimize the number of pulley changes, then adds code to prompt me to change pulleys/motor speeds when necessary, and changes the S
words to the proper values to make the VFD run at the correct speed. Doing that would allow you to have a linear command value in the S words in your CMA
program, but generate non-linear S words in the actual G-code you run on the machine, so it works the way you want it to. With a simple relationship like you
seem to have, you could easily do the translation directly in the CAM post processor."
How do I write a post processor to add a fixed increment to the "S" input?
Thanks,
JohnD
I have got back to testing my Chinese mill with BLDC motor and tried a few more things.
Some of my problems must be put down to bad contacts, cheap test equipment etc but I still have the same basic problem of getting a good correlation between
the input "S" word and the output speed.
I have been trying a Smooth Stepper and this does give much better pulses and speed steps as it uses a 32KHz clock just for this function.
The one thing I have noticed is that If I could add a fixed offset to every input "S" value of about 370RPM I would then get a reasonable speed correlation from
300 to 6000 RPM with a maximum of +7% difference.
Is it possible to modify Mach3 to do this?
I notice in an answer to another question HimyKabibble said
" Or, do what I did - customize the post for your CAM software. I wrote a post-processor to manage the spindle on mine. The CAM program spits out G-code,
with spindle RPM in the S words. My post-processor parses the G-code, finds the S words, and figures out the best motor speed (I have a 2-speed motor) and
pulleys to use to minimize the number of pulley changes, then adds code to prompt me to change pulleys/motor speeds when necessary, and changes the S
words to the proper values to make the VFD run at the correct speed. Doing that would allow you to have a linear command value in the S words in your CMA
program, but generate non-linear S words in the actual G-code you run on the machine, so it works the way you want it to. With a simple relationship like you
seem to have, you could easily do the translation directly in the CAM post processor."
How do I write a post processor to add a fixed increment to the "S" input?
Thanks,
JohnD