My real motivation is that right now on my desk are parts of a 12 degree freedom robot dog. It will likely grow to use 16 motors. Today I have 12 hobby servos but they are about 20x too slow. So I'm hunting down ideas for motor control to be used for "version 3" of the dog-bot. Version 2 is coming along in CAD and will use bus-servos. I want version 3 to use FOC-controlled BLDC motors, and I want a price of under $100 per axis.
If you want to understand my belief that each motor really needs it's own microcontroller look at the new "bus servo" I plan to use on Version 2. What they are is a motor and gearbox but also a microcontroller and a dual h-bridge that fit inside a box 20 x 40 x 40 mm. These have a bidirectional serial interface. Each box has its own bus address and you can send commands and query status. What is really impressive is that prices start at about $17. Yes, $17 for a small motor with integrated serial interface controller, and rotation sensor, PID loops and all in that little box. amazon.com/LewanSoul-Real-Time-... <https://www.amazon.com/LewanSoul-Real-Time-Feedback-Temperature-Indicator/dp/B07G11VJWR/ref=sr_1_5?crid=WHKUPEMFC7MT&keywords=lx-15d+servo&qid=1642050006&s=toys-and-games&sprefix=lx-15d+servo%2Ctoys-and-games%2C100&sr=1-5> Here is a better one for $21 amazon.com/dp/B09CMGN25Q <https://www.amazon.com/dp/B09CMGN25Q/ref=sspa_dk_hqp_detail_aax_0?psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExQjEwWENON1MyS0RQJmVuY3J5cHRlZElkPUEwNzQ2MTkyS09VSjI4QklZVU1XJmVuY3J5cHRlZEFkSWQ9QTAwODUxMzJDR1VVOVI3RjhMVkYmd2lkZ2V0TmFtZT1zcF9ocXBfc2hhcmVkJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==> So obviously, adding a microcontroller and serial interface to a motor does not cost much. A bigger motor would need bigger MOSFETs but not a bigger microcontroller. You can synchronize the action of many of these by sending commands like "on my mark, move from current location to location XXX over a period of XXX milliseconds." In this way you have primed a dozen servo motors with a speed and location. Then we send one command on a broadcast ID that just says "MARK". While those are running, the main computer calculates the next set of commands. Do this about 20 times per second. They reserved the ID=255 for broadcast, all motor listen to that ID in addition to their own. ID. You synchronize motion by sending "DO It NOW" on the broadcast ID channel. In a more sopisticed system I can image broadcasting a clock synchronization every few seconds so each motor would adjust their local real-time clock. With this you no longer need to say "MARK". But rather you command the motor to by at positionXXX and tie YYY so synchronization is distributed ROS MoveIt's joint action messages are like that. The main planner sends a "target state" that has (time, position, velocity, acceleration) and it is the motor's job to be at the target position, velocity and acceleration at the target time. "MoveIt is likely the most popular robot motion planner in use today and there time-taged targets are how it is done, It does not centrally control the motors. OK That is maybe not true. Typicaly the motor controllers all run on the same computer. But logically they would be independent. The current cheap bus-servos lack real-time clocks so the command uses relative time and says only how long the servo shall take to do the motion. Obviously, this is not expensive to implement as the whole unit sells for $20 I doubt the controller costs over $1. Think of a military analogy for synchronized movement. The usual plan in old war movies is that someone says "my watch says 4:00. If yours don't, set it to 4:00. Now I want everyone to be over at location XXX by 6:00. This works. The LCNC way is different. In the LCNC movie the commander tells each and every person "lift your left foot and move it forward 4 inches", "Transfer your weight and prepare to lift the other foot." This works too and everyone gets at the meeting place at 6:00 but it requires a lot of the commander and low latency communications to prevent people from falling down. My inspiration is "Spot" He is really just four robot arms and a box full of batteries. The rocket science is the control algorithms and the POWER of some very expensive motors. I want those motors for my Version 3. Spot is an $80K machine, I will never get there with my budget but maybe closer each version. On Wed, Jan 12, 2022 at 7:50 PM Ralph Stirling < [email protected]> wrote: > 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 [[email protected]] > 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 < > [email protected]> 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 [[email protected]] > > 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 <[email protected]> wrote: > > > > > On Wed, 12 Jan 2022 at 01:28, Chris Albertson < > [email protected] > > > > > > 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 > > > [email protected] > > > > > > 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 > > [email protected] > > > > > 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 > > [email protected] > > > 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 > [email protected] > > 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-users > -- Chris Albertson Redondo Beach, California _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
