- Posts: 752
- Thank you received: 0
Automatic spindle gear detection
Will I not be able to circumvent this issue by telling Hal what gear I am in?
Regards
Marius
www.bluearccnc.com
Please Log in to join the conversation.
mariusl wrote: Will I not be able to circumvent this issue by telling Hal what gear I am in?
Yes, of course.
But the whole point of this system was to detect gears automatically. if you don't want to detet gears automatically then this is not the HAL you are looking for.
Please Log in to join the conversation.
I will still give it a go but I am going to assume that I know the motor speed. If I run the motor full speed and then read the spindle feedback I can determine the gear with the lincurve table. Maybe have a comp in the spindle command line to do this.
So what ever gear I am in it will still require the output to be 0-10v for full speed (2450rpm of motor). I will just have to scale the perceived commanded speed to be no more than the upper limit of that gear.
I think it is the same as what you achieve with the scaling of the pwm not so?
Let me think on this a while and I will ask your opinion on it again when I have something more concrete to show. I need to get my head around this a bit.
Regards
Marius
www.bluearccnc.com
Please Log in to join the conversation.
mariusl wrote: So what ever gear I am in it will still require the output to be 0-10v for full speed (2450rpm of motor). I will just have to scale the perceived commanded speed to be no more than the upper limit of that gear
I think that you may still be confused?
The HAL code should be able to detect the engaged gear at any motor speed. However it will only do it accurately if the motor speed data it gets is accurate.
When you first request a spindle speed the motor is not turning, so the HAL version of motor speed is not true, and the detected gear is not true.
Eventually the VFD will get the motor to the requested speed. At this point the calculation will be correct, and the gear will be correctly calculated.
It may well be at this point that the detected gear changes, and a new motor speed request happens. At this point the calculation is wrong again....
This situation can be eliminated with accurate motor speed measurement.
On my milling machine it doesn't take very long to sort itself out and settle on a gear. But on a lathe running CSS the spindle speed request changes very rapidly at the end of a facing cut as the tool pulls, out, and you may lose gear-synch again.
One way to improve this situation would be to low-pass the motor speed command in HAL so that the error between commanded motor speed and actual motor speed is small.
If you are in a gear with a 600rpm top speed and you want 600 rpm, then you need 10V output to the VFD. The point of the lincurve and gear detection is not to limit PWM command, it is to ensure that in the 600rpm gear that 600rpm is 10V and 300rpm is 5V, and in the 2250rpm gear 600rpm is 2.66V,
So, in the 600rpm gear the spindle-speed-request to PWM voltage factor is 10/600 and in the 2250 rpm gear the factor is 10/2250.
Perhaps the fact that in my example the PWM is scaled to 5000 for the full-scale output is confusing matters? (so, an input value of 5000 is 10V. You may have scaled your PWM to require an input of 10 for 10V output?)
Please Log in to join the conversation.
I think I understand what happens now. I will have to fit a sensor on the motor to get that feedback then.
I still have a parport open to enable me to do that. A single pulse per rev should do not so?
P.S. My confusion was caused by the fact that I did not have a motor speed feedback.
Regards
Marius
www.bluearccnc.com
Please Log in to join the conversation.
Maybe, I can't be sure.mariusl wrote: I still have a parport open to enable me to do that. A single pulse per rev should do not so?
I don't have motor speed feedback, I just accept that the mill takes a little time to sort itself out. But a mill runs at a constant speed so after the initial spindle start the motor speed matches the commanded motor speed. This isn't necessarily true for a lathe in CSS mode.My confusion was caused by the fact that I did not have a motor speed feedback.
The underlying problem is that the actual motor speed doesn't always match the commanded motor speed (ie, the input to the pwmgen or analogue output). The two ways to address this are to either use some other source of motor speed data, or to attempt to ensure that the motor speed matches the commanded speed more closely. One way to attempt the latter approach is to pass the spindle speed command through a low-pass filter so that the motor can always keep up to the commanded speed, then to feed this filtered speed command to both the motor and the lincurve ratio calculation.
In your position I would try the all-HAL approach first before adding any hardware. You might, at that point, want to reduce the internal ramping in the VFD if there is any configured.
Please Log in to join the conversation.
Here is the information of my spindle. Is it good enough to work with?
Hmm: no attachment
Attachment not found
Regards
Marius
www.bluearccnc.com
Please Log in to join the conversation.
I did a component that I hope will cater for the CSS problem. It caters for the revers condition of a mill wher the speed is not changing and once the gear id=s found it is happy. With CSS I have to find the suitable gear every time and prompt the user to select the correct gear in order for the CSS to work correctly
NOTE:
I have not tested this yet but I would like if you could scan it over please.
I commented out the 5i25 stuff
Attachment not found
Attachment not found
Attachment not found
Regards
Marius
www.bluearccnc.com
Please Log in to join the conversation.
