How to configure for spindle motor - DC brushed servo w/encoder step/dir

More
7 years 7 months ago - 7 years 7 months ago #129561 by Vinito
Holy cow, thanks for that reply.
If nothing else, I feel a bit better knowing my problem seems easier to overcome than yours. All I'm trying to do essentially is spin a motor at commanded RPM.

I think I've gathered a couple hints from what you've posted.
I got to thinking and my biggest problem seems to be that I'm so ignorant of this stuff that I don't know where to start. With that in mind I was thinking that maybe I ought to start with knowing what part of the hal "hears" M3, M4 and M5 commands and starts something going downstream. Then maybe I could work out what part of the hal generates then sends pulses to the appropriate two pins. Then maybe I can figure out what to put in between so it sorts it out right. I have a foggy idea now what some of that could be, but really I'm not certain of any part of it yet.
I grok the stepgen ctrl_type=v part, but there's enable, make-pulses, scaling (what the...), even step and dir, and others, then various parameters, all of which I can somewhat understand but I don't know which are actually required or necessary. I sure haven't had any luck so far - all I get is an error popup window on startup every single time. Could be missing structure, could be syntax... who knows? Not me yet.
Anyway, thanks for your reply. I'm a bit burned out but I'll come back to it a bit later and maybe start to make a bit of sense of it.
Last edit: 7 years 7 months ago by Vinito.

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

More
7 years 7 months ago - 7 years 7 months ago #129590 by Richard J Kinch

Vinito wrote: ... but there's enable, make-pulses, scaling (what the...), even step and dir, and others, then various parameters, all of which I can somewhat understand but I don't know which are actually required or necessary.


It is indeed baffling.

To simplify the puzzling configuration: use stepconf to create a valid PWM spindle configuration, pretending your spindle motor has a PWM-signal velocity-control. Then hand-edit the configuration (.ini and .hal files) to modify the pwmgen to the stepgen that matches your hardware. This minimizes the amount of HAL schemas you have to invent.

You should also qualify your system's base-thread bandwidth available before investing in the approach. This is an upper bound on stepped spindle performance. For example, if your system were limited to, say, 12 kHz step rates and the motor is 600 steps/rev, then that's 12K/600 = 20 rev/sec = 1200 rpm max spindle speed. That's going to foil any 1800, 3000, or 3600 rpm imaginations you might dream from a given motor's native capacity. Motor speeds are a problem for small machine tools, which require using small diameter cutters, which require higher rpms to maintain SFM speed. In the end you can find yourself unhappily cornered into an unfavorable area of the performance envelope and crossing into infeasible areas. Then you'll regret the investment and learn the hard way that a 6000 rpm motor-spindle with sub-thou runout/rigidity is what a small machine needs as a basic element. These competing factors all must be orchestrated and harmonized from the concept stage, if you're inventing instead of following a proven configuration recipe.
Last edit: 7 years 7 months ago by Richard J Kinch.

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

More
7 years 7 months ago #129594 by rodw
This might be a bit crude but its possible to drive a stepper motor with a square wave. I've done this with some interrupt driven code on an Arduino. I Will say the motor gets a bit hotter than it does in LinuxCNC. So you might be able to do this with the siggen component.

But a custom component might be the order of the day. I'm sure I saw a post where Dewey Garrett pushed a change to support 16 axes but the extra axes require a seperate controller as they are outside of the kinematics paradigms. He suggested using limit3 to drive them. Good luck!

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

More
7 years 7 months ago - 7 years 7 months ago #129603 by Richard J Kinch

rodw wrote: This might be a bit crude but its possible to drive a stepper motor with a square wave.


Right, but in the OP's case he's determined to use a brushed-DC servo controller with stepped signals, not a drive a stepper motor. So a HAL-generated single-phase square wave is all that is needed, with programmable frequency under HAL control, which is what HAL stepgen (in velocity mode) does. The OP is just asking for apocryphal HAL code to implement that. Some LinuxCNC scholar should just answer with a experience-proven example (I don't have one offhand, I gave up and resorted to PWM that stepconf comprehends) to this homework problem. It's not in the textus receptus or the forum midrash.
Last edit: 7 years 7 months ago by Richard J Kinch.

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

More
7 years 7 months ago #129618 by Mike_Eitel
Why not use siggen and the digital output?
m5c
MIKE

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

More
7 years 7 months ago - 7 years 7 months ago #129624 by Richard J Kinch

Mike_Eitel wrote: Why not use siggen and the digital output?


The siggen component is servo-thread floating point, trigonometric, and oversampled (less than 1 kHz bandwidth), while stepgen is integer and base-thread.

The stepgen base-thread bandwidth of (10s of kHz) is needed to generate spindle motor signals to run the spindle at decent rpms.

If you meant to suggest freqgen, that has been subsumed into stepgen's velocity mode.

Even at optimistic base-thread rates, the square wave frequency will be aliasing the sum and difference of the nominal frequency and the base-thread rate, introducing heterodyne harmonics that can transmit through the servo controller and make the motor sound strange. A better-featured servo controller would have a speed mode that avoids this artifact of step synthesis.
Last edit: 7 years 7 months ago by Richard J Kinch.

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

Time to create page: 0.271 seconds
Powered by Kunena Forum