Linuxcnc with the bldc component can certainly drive an induction motor or other 3-phase motor as a variable frequency drive, but I have never heard the term "VFD" used for driving two-phase steppers before. What Andy was suggesting, and what I looked up, was doing the full FOC drive of steppers (or 3-phase motors for that matter) with Linuxcnc directly. The bldc hal component does the relevant calculations already. The only slightly tricky part is measuring phase current. You could use an A/D converter with SPI interface to the Mesa FPGA, but it is still harder than grabbing analog values in a microcontroller.
Personally, I am more interested in the approach you've been advocating for years, of having a microcontroller per motor handling commutation and drive, with the Linuxcnc/Mesa setup sending step/direction pulses or communicating via sserial or Ethercat with each motor. I've built a number of mosfet bridge boards for 2 or 3-phase drive of small motors which have been good enough for in-house use, and it isn't too difficult. Making them bullet-proof for other end-users to connect to their own motors and power supplies would require some design hardening. The bldc hal component is great for experimenting with driving brushless motors, though, if you don't need phase current feedback in your control scheme. -- Ralph ________________________________________ From: Chris Albertson [albertson.ch...@gmail.com] Sent: Wednesday, January 12, 2022 6:57 PM To: Enhanced Machine Controller (EMC) Subject: Re: [Emc-users] Field Oriented Control (FOC) algorithm for BLDC and Stepper motors. CAUTION: This email originated from outside the Walla Walla University email system. Thanks, this might be of value to someone who wants a VFD for the cost of a few h-bridges. On Wed, Jan 12, 2022 at 6:35 PM Ralph Stirling < ralph.stirl...@wallawalla.edu> wrote: > The bldc.c component computes the two-phase sin/cos > terms from phase angle, but I don't think it outputs them, > so a very slight modification would be necessary. The sin/cos > output values would be connected to PWM inputs in hostmot2, > which would generate the actual signals for two H-bridges to > switch the motor phases. The Mesa card generates the high > speed PWM. A 1kHz servo thread should be sufficient for > computing the sin/cos values. Here are the relevant lines in > bldc.c: > > sintheta = sin(phase_angle * pi2); > costheta = cos(phase_angle * pi2); > A_value = out_abs * costheta; > B_value = out_abs * (costheta * cos120 + sintheta * > sin120); > C_value = out_abs * (costheta * cos120 - sintheta * > sin120); > > The sintheta and costheta are appropriate for two-phase steppers, > and the A, B, and C_values are for three-phase bldc motors. > > The sintheta and costheta values could be multiplied by the output > of a PID loop to adjust the amplitude based on torque or velocity > requirements. Bldc connects to an encoder counter to track rotor angle. > > -- Ralph > ________________________________________ > From: Chris Albertson [albertson.ch...@gmail.com] > Sent: Wednesday, January 12, 2022 5:41 PM > To: Enhanced Machine Controller (EMC) > Subject: Re: [Emc-users] Field Oriented Control (FOC) algorithm for BLDC > and Stepper motors. > > CAUTION: This email originated from outside the Walla Walla University > email system. > > > So how would I connect the four wire stepper motor to my PC to allow for > software commutation and continuous rotation of a stepper? > > If this works, it could save people money by eliminating the need for a VFD > spindle drive and also > People are paying quite a lot for these self-contained "closed-loop > steppers" If this can already be done in software how? > > But I have serious doubts a Linuc PC has good enough timing even with an RT > kernel. But in theory, how to connect the stepper? > > > On Wed, Jan 12, 2022 at 1:26 AM andy pugh <bodge...@gmail.com> wrote: > > > On Wed, 12 Jan 2022 at 01:28, Chris Albertson <albertson.ch...@gmail.com > > > > wrote: > > > > > This library would allow the stepper to be commanded > > > as if it were a serial interfaced servo motor. > > > > In principle so does LinuxCNC HAL and the "bldc" HAL component. > > > > -- > > atp > > "A motorcycle is a bicycle with a pandemonium attachment and is > > designed for the especial use of mechanical geniuses, daredevils and > > lunatics." > > — George Fitch, Atlanta Constitution Newspaper, 1912 > > > > > > _______________________________________________ > > Emc-users mailing list > > Emc-users@lists.sourceforge.net > > > https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-users&data=04%7C01%7Cralph.stirling%40wallawalla.edu%7C10857561c210488b31d708d9d6409129%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637776395072450627%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Nno9PFeqyb1z0n9zjUCXJYDw%2F6aO%2Bx4P3dpr%2BxiVv00%3D&reserved=0 > > > > > -- > > Chris Albertson > Redondo Beach, California > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > > https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-users&data=04%7C01%7Cralph.stirling%40wallawalla.edu%7C10857561c210488b31d708d9d6409129%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637776395072450627%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Nno9PFeqyb1z0n9zjUCXJYDw%2F6aO%2Bx4P3dpr%2BxiVv00%3D&reserved=0 > > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-users&data=04%7C01%7Cralph.stirling%40wallawalla.edu%7C10857561c210488b31d708d9d6409129%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637776395072450627%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Nno9PFeqyb1z0n9zjUCXJYDw%2F6aO%2Bx4P3dpr%2BxiVv00%3D&reserved=0 > -- Chris Albertson Redondo Beach, California _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-users&data=04%7C01%7Cralph.stirling%40wallawalla.edu%7C10857561c210488b31d708d9d6409129%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637776395072450627%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Nno9PFeqyb1z0n9zjUCXJYDw%2F6aO%2Bx4P3dpr%2BxiVv00%3D&reserved=0 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users