Spindle RPM control and Z-axis homing
08 Sep 2014 19:45 #50943
by olesk
That would probably also work, but since I got a full fledged Arduino sitting in-between anyways, programming it based on real readings from a tachometer will probably give the best results. Especially since I only really care about a couple of RPM values, rather than every value between 0 and max.
Replied by olesk on topic Spindle RPM control and Z-axis homing
Maybe you can use a lincurve component between the spindle speed output of motion and the PWM?
That would probably also work, but since I got a full fledged Arduino sitting in-between anyways, programming it based on real readings from a tachometer will probably give the best results. Especially since I only really care about a couple of RPM values, rather than every value between 0 and max.
Please Log in or Create an account to join the conversation.
08 Sep 2014 20:39 #50947
by cncbasher
Replied by cncbasher on topic Spindle RPM control and Z-axis homing
why use an arduino , when everything you need is in Linuxcnc , all your doing is slowing it all down
Please Log in or Create an account to join the conversation.
08 Sep 2014 20:56 #50948
by olesk
Because since I don't have physical access to the PWM pin from LinuxCNC, all I have is an analog voltage coming out of the stepper driver. In order to convert that back into the PWM signal I need for the spindle speed controller, I use the Arduino. Since the digital-analog-digital conversion introduces imprecisions at each step, I use the Arduino to define a couple of "fixed RPM" PWM pulses. I then set up ranges at the Arduino. The analog voltage from the stepper driver is approx 0-4V, so I can then set up something like 0-1V = 3000RPM, 1-2V = 6000RPM, 2-3V = 8000RPM and 3-4V = 12000RPM, for example.
Is this ideal? Nope? However, since the spindle speed control is not perfect either (PWM values over 245 leads to 0 most of the time), I can also work around imperfections in the speed controller this way. And since I'm checking everything with a tachometer, I can make 100% sure that when I request one of the fixed RPMs (3000/6000/8000/12000) from LinuxCNC, I will get _exactly_ that. The price to pay is that I can't set arbitrary spindle speeds.
Even if I made a breakout of the parallel port to get to the PWM pin, I would still have issues with the speed controller and its extremely non-linear relationship between PWM and RPM.
So in conclusion, I think I have made the best of a sub-optimal situation![:) :)](/media/kunena/emoticons/smile.png)
However, I would love to be proven wrong, as I'll be the first to admit it is a convoluted fix for something that should in theory be very straightforward..
Replied by olesk on topic Spindle RPM control and Z-axis homing
why use an arduino , when everything you need is in Linuxcnc , all your doing is slowing it all down
Because since I don't have physical access to the PWM pin from LinuxCNC, all I have is an analog voltage coming out of the stepper driver. In order to convert that back into the PWM signal I need for the spindle speed controller, I use the Arduino. Since the digital-analog-digital conversion introduces imprecisions at each step, I use the Arduino to define a couple of "fixed RPM" PWM pulses. I then set up ranges at the Arduino. The analog voltage from the stepper driver is approx 0-4V, so I can then set up something like 0-1V = 3000RPM, 1-2V = 6000RPM, 2-3V = 8000RPM and 3-4V = 12000RPM, for example.
Is this ideal? Nope? However, since the spindle speed control is not perfect either (PWM values over 245 leads to 0 most of the time), I can also work around imperfections in the speed controller this way. And since I'm checking everything with a tachometer, I can make 100% sure that when I request one of the fixed RPMs (3000/6000/8000/12000) from LinuxCNC, I will get _exactly_ that. The price to pay is that I can't set arbitrary spindle speeds.
Even if I made a breakout of the parallel port to get to the PWM pin, I would still have issues with the speed controller and its extremely non-linear relationship between PWM and RPM.
So in conclusion, I think I have made the best of a sub-optimal situation
![:) :)](/media/kunena/emoticons/smile.png)
However, I would love to be proven wrong, as I'll be the first to admit it is a convoluted fix for something that should in theory be very straightforward..
Please Log in or Create an account to join the conversation.
Time to create page: 0.117 seconds