Seeed to design and build Machinekit focused Cape for BeagleBone Black/AI

Seeed is looking to not only build a Machinekit-focused Cape for BeagleBone Black and BeagleBone AI, but to:

  • Take in features and feedback from the community

  • Contribute the design to open source and certify it as such

  • Manufacture the design under the BeagleBoard.org name to support the BeagleBoard.org Foundation and community

  • Help assemble and provide software images configured for an open source 3D printer and CNC machine (with BeagleBoard.org and community guidance and support)

  • Offer a collection of additional accessories which might commonly be needed

I am very excited about this because I know Seeed cares about open hardware and also knows how to deliver solutions reliably and cost effectively.

So, what are your ideas about where to start on such a cape?

Hi,

I’ve been proposing something very similar that would use a BBB or a PIC32. The reason for the PIC32 is the lack of I/O on the Beagle once you enable the HDMI or plug in one of those small 4.3" LCD displays.

I already have a 4DCape (attached JPG) and a Replicape c/w with poorly functioning Manga Screen. I bought the newer Manga screen but as yet haven’t really done anything with it or the Replicape.

I’ve also got an earlier xylotex DB25 cape and a LogicSupply Serial cape. Unlike say the ISA bus on the original PC, nothing is really compatible so they can all plug in at the same time which makes sense because the BBB external connections aren’t really an expandable bus.

OK. So what does a CNC system need? I think it’s always better to first specify the needs and then see what processor fits rather than insist on a particular architecture and then shoehorn in the specifications to fit the target hardware.

  1. Either 4 or 5 axis step/dir.

a. At a minimum X,Y,Z, A and B(or C) and up to 500kHz step rates to handle some of the now low cost AC servos with 2500 line encoders.

  1. Spindle control in the form of two outputs:

a. PWM and Direction or

b. Step and Direction or

c. Relay Clockwise, Counter Clockwise.

  1. Spindle Quadrature encoder input

a. Differential A/B and Index high speed hardware for 2500 line encoders turning up to 3000 RPM.

  1. Home switch input for 4 or 5 axis (does a rotary require a home switch).

a. shared with Limit switch for each axis.

b. Open circuit means activated.

  1. Limit switch for the other end of each axis.

a. Open circuit means activated.

  1. ESTOP input with ESTOP asserted when ESTOP not connected.

  2. ENABLE output.

a. One active high

b. One active low.

  1. Coolant output control

a. Flood

b. Mist

  1. General purpose output signals for power supply enables etc.

  2. Charge Pump output that when stopped shuts off all outputs including ENABLE.

  3. USB input for a pendant of some type

a. For USB stick for code or firmware updates.

  1. Or at least Inputs for Quadrature encoder knob and a few buttons.

  2. MODBus support with either RS232 or RS485

a. for something like a Homann Designs MODIO

b. Other MODBus end products for things like tool changers

  1. CAN bus with CANopen support

a. for expanding to other hardware like tool changers.

  1. Ethernet connectivity.

  2. Some sort of display. Size depending on what level of application is running on the BBB.

Point 16 is the interesting part. Should this be a small 4.3" to 7" LCD display serving as a rudimentary DRO and status display? Or should it be the entire AXIS interface or something between.

And with point 16 in mind, if the display makes the BBB into an intelligent power feed DRO controller to allow essentially manual operation on the mill then the Ethernet port could be used to connect a full size PC (laptop or workstation) running LinuxCNC/MachineKit with full graphical tool path display etc.

It’s already possible to buy a CNC controller for $200 to $300 from China with a 4.3" display, a bunch of buttons and a USB connection for loading G-Code. And there are some users who swear by that solution as the easiest and fastest way to get working. But they aren’t open source. They aren’t expandable.

To have all the above I/O requires a lot of pins. I’m not sure the BBB can do this all. Unless it uses 10Mhz SPI to a serial shift register latch to create 6 axis STEP/DIR/PWM for X,Y,Z,A,B and Spindle along with coolant outputs to a maximum of 16 outputs. Since SPI is in and out the system can just as easily hold a 16 bit latch that is shifted in at the same time holding the various inputs except for ESTOP and maybe a MACHINE ON switch.

Some of the features on the PMDX-126 break out board could be part of this cape. In fact the idea that perhaps a simple I/O bus structure be designed in is a really good idea. A bi-directional 8 bit bus with a 4 bit address bus along with RD/WR/ signals would allow LCD displays and other external add on devices. The PIC32 for example supports that sort of bus. I think the ARM on the Beagle does too but it may not be available.

So this cape would look a lot more like a PMDX-126 but be that large BoB cape for the Beagle. It would have the I/O and maybe even high voltage relays along with optically isolated I/O.

https://www.pmdx.com/PMDX-126

The photos show how the PMDX has an expansion bus and a set of connectors that are compatible for a smooth stepper.

Perhaps make the BBB the replacement for the Smooth Stepper and the cape the replacement for a much more extensive PMDX-126. And use the BBB Ethernet connection to be the interface, if CNC is wanted, to MachineKit or LinuxCNC or even maybe MACH4 too. Give the BBB cape a display output for rudimentary DRO and control information but for full CNC let a processor like Raspberry Pi4 or PC with much better decent HDMI control serve as the graphical and keyboard/mouse user input.

The need for the BBB to do everything just doesn’t exist anymore when that Pi4 only adds $50 to the price and the display/keyboard/mouse are fixed costs no matter what system is used.

Make the system stand alone and scalable so a user can first add just a motor to their X axis for power feed. Six monts later the Y axis for power feed. Then a year later the Z axis for power feed. When they swap in a 3 phase or AC servo motor onto the spindle they suddenly have on/off speed control and now the potential to add simple CNC operations. Some of those could even be local like the wizards in MACH3/4.

IMHO

John Dammeyer

4DCAPE-43T-1.jpg

BadFittingBox.jpg

Hi,

I’ve been proposing something very similar that would use a BBB or a PIC32. The reason for the PIC32 is the lack of I/O on the Beagle once you enable the HDMI or plug in one of those small 4.3" LCD displays.

I already have a 4DCape (attached JPG) and a Replicape c/w with poorly functioning Manga Screen. I bought the newer Manga screen but as yet haven’t really done anything with it or the Replicape.

I’ve also got an earlier xylotex DB25 cape and a LogicSupply Serial cape. Unlike say the ISA bus on the original PC, nothing is really compatible so they can all plug in at the same time which makes sense because the BBB external connections aren’t really an expandable bus.

OK. So what does a CNC system need? I think it’s always better to first specify the needs and then see what processor fits rather than insist on a particular architecture and then shoehorn in the specifications to fit the target hardware.

  1. Either 4 or 5 axis step/dir.

a. At a minimum X,Y,Z, A and B(or C) and up to 500kHz step rates to handle some of the now low cost AC servos with 2500 line encoders.

  1. Spindle control in the form of two outputs:

a. PWM and Direction or

b. Step and Direction or

c. Relay Clockwise, Counter Clockwise.

  1. Spindle Quadrature encoder input

a. Differential A/B and Index high speed hardware for 2500 line encoders turning up to 3000 RPM.

  1. Home switch input for 4 or 5 axis (does a rotary require a home switch).

a. shared with Limit switch for each axis.

b. Open circuit means activated.

  1. Limit switch for the other end of each axis.

a. Open circuit means activated.

  1. ESTOP input with ESTOP asserted when ESTOP not connected.

  2. ENABLE output.

a. One active high

b. One active low.

  1. Coolant output control

a. Flood

b. Mist

  1. General purpose output signals for power supply enables etc.

  2. Charge Pump output that when stopped shuts off all outputs including ENABLE.

  3. USB input for a pendant of some type

a. For USB stick for code or firmware updates.

  1. Or at least Inputs for Quadrature encoder knob and a few buttons.

  2. MODBus support with either RS232 or RS485

a. for something like a Homann Designs MODIO

b. Other MODBus end products for things like tool changers

  1. CAN bus with CANopen support

a. for expanding to other hardware like tool changers.

  1. Ethernet connectivity.

  2. Some sort of display. Size depending on what level of application is running on the BBB.

Point 16 is the interesting part. Should this be a small 4.3" to 7" LCD display serving as a rudimentary DRO and status display? Or should it be the entire AXIS interface or something between.

For the inclusion of UI support, does it really need to be BeagleBone Black or can that be BeagleBone AI? Today, we need some software updates to run reliably without a fan, but I think that can be incorporated–unless you think a fan should reasonably be a part of the solution. BeagleBone AI does jump the price of the BeagleBone to $99 (assuming tariff situation is put under control with either a US source or the tariffs go away), but is that really significant for a CNC solution that includes the UI? BeagleBone Black can handle the UI, but could be considered generally be a bit sluggish on that, especially if the 3D accelerator isn’t integrated nicely.

And with point 16 in mind, if the display makes the BBB into an intelligent power feed DRO controller to allow essentially manual operation on the mill then the Ethernet port could be used to connect a full size PC (laptop or workstation) running LinuxCNC/MachineKit with full graphical tool path display etc.

That seems like the sweet spot for BeagleBone Black to me. Still running Machinekit on the board, but running the UI remotely.

It’s already possible to buy a CNC controller for $200 to $300 from China with a 4.3" display, a bunch of buttons and a USB connection for loading G-Code. And there are some users who swear by that solution as the easiest and fastest way to get working. But they aren’t open source. They aren’t expandable.

Exactly. How can we create a nice experience out of box like something purchased off the shell for CNC control, but keep it open and expandable. If $300 is the expectation with 4.3" display and USB port for G-Code, then let’s work together to set the requirements appropriately.

To have all the above I/O requires a lot of pins. I’m not sure the BBB can do this all. Unless it uses 10Mhz SPI to a serial shift register latch to create 6 axis STEP/DIR/PWM for X,Y,Z,A,B and Spindle along with coolant outputs to a maximum of 16 outputs. Since SPI is in and out the system can just as easily hold a 16 bit latch that is shifted in at the same time holding the various inputs except for ESTOP and maybe a MACHINE ON switch.

Some of the features on the PMDX-126 break out board could be part of this cape. In fact the idea that perhaps a simple I/O bus structure be designed in is a really good idea. A bi-directional 8 bit bus with a 4 bit address bus along with RD/WR/ signals would allow LCD displays and other external add on devices. The PIC32 for example supports that sort of bus. I think the ARM on the Beagle does too but it may not be available.

Worth exploring what we can do to effectively generate such an expansion. I think there are many options for it.

So this cape would look a lot more like a PMDX-126 but be that large BoB cape for the Beagle. It would have the I/O and maybe even high voltage relays along with optically isolated I/O.

https://www.pmdx.com/PMDX-126

The photos show how the PMDX has an expansion bus and a set of connectors that are compatible for a smooth stepper.

Perhaps make the BBB the replacement for the Smooth Stepper and the cape the replacement for a much more extensive PMDX-126. And use the BBB Ethernet connection to be the interface, if CNC is wanted, to MachineKit or LinuxCNC or even maybe MACH4 too. Give the BBB cape a display output for rudimentary DRO and control information but for full CNC let a processor like Raspberry Pi4 or PC with much better decent HDMI control serve as the graphical and keyboard/mouse user input.

The need for the BBB to do everything just doesn’t exist anymore when that Pi4 only adds $50 to the price and the display/keyboard/mouse are fixed costs no matter what system is used.

I’d agree with that. The BeagleBone Black should really be valuable for its ability to act as the real-time controller, not as the UI. BeagleBone AI should be able to do both and also potentially introduce some kind of preventive maintenance modes, tough greater stepper driver/motor feedback would be needed.

One has to be careful here not to spec in a 10 ton dump truck for that once a year 500 lb utility trailer load of peat moss for the garden. For one thing they are hard to parallel park and really expensive for fuel.

There already exists, and will for some time, systems that can handle multiple spindles, closed loop control of the encoders back to the PC along with multiple FPGA controlled I/O and smart serial motor control for these retrofitted large commercial milling machines. Those users will never ever install a BBB with a cape that has slow HMDI screen updates and limited I/O.

So forget them.

By the same token, the customers who are using Ardunio based duos or whatever the latest flavour is for their 3D printers are also of no interest. If they were we’d have seen the Replicape on a BBB become the standard with Machinekit or Linux as the backbone. Hasn’t happened. Won’t happen. Not sure why. Probably price.

So what is the target market for this type of product? Well who is buying the ready to go $200 to $500 CNC boxes in China and for what machines?

If I were to venture a guess I’d say the ones that are about this size:

https://www.grizzly.com/products/Grizzly-7-x-27-1-HP-Mill-Drill-with-Stand/G0704

They come in all sorts of flavours. They are generally driven open loop with stepper motors and require only a spindle sensor for quadrature and maybe a second quadrature input for an MPG control although those can be had pretty inexpensively as USB devices. And to tell you the truth I really like my ShuttleExpress over the USB MPG pendant.

As along as the BoB has a FAULT input, which I forgot to put on my previous list, you can even use intelligent drives like the step-servos that close the loop but provide a FAULT output when something goes wrong. My STMBL, Bergerda and HP_UHU drives all have that. I think the GECKO I have on the KNEE also does but I’m not using it at the moment. All open collector outputs that pull the signal low when a fault occurs.

Anyway, that size of a machine and the price tag associated with it will set the price of the CNC conversion. Most of the cost is in the mechanics and the electricals.

So two PRU accessed quadrature inputs are more than enough to close the loop for power tapping as long as the spindle speed control is responsive.

About the only limitation I see in my list is that 500kHz stepping is really fast. I used that number because that’s the step rate for the Bergerda AC servos with the 2500 line encoder. That math works out to 10,000 edges per revolution and 3000 RPM is 50 RPS which means a 1:1 ratio is 500kHz. The Bergerda can scale the step pulses in order to match the encoder with slower step rates. I don’t know if the STMBL AC Servo drive can do that. Pretty sure the HP_UHU with the dsPIC can or almost can.

But for this target market, using standard stepper motors with micro-stepping drives we’re back to 25kHz max before we see the motor torque drop off to a point where step speed doesn’t matter. And if you are using the step-servos the selection of the encoder will determine what’s required.

So I’ll agree with Chris that it’s the I/O on the BBB that is the limiting factor. But 10MHz SPI bus could take care of that.

What I would do is use the PRU to load the DMA device to write two bytes to and read two bytes from the SPI port at a 1MHz rate. It’s the BBB’s main processors responsibility to keep this filled or to stall it with step levels low and dir at last used value.

The trajectory planner is responsible for setting the step pulses ON within the two byte packet to send out the SPI port. The next two bytes hold the direction and drop the STEP. Any other outputs on that buffer will also be left as is.

Now you have hardware generating 6 pairs of step/dir as high as 500kHz. The amount of time the 8th pair is ON and OFF is dependent on the PWM frequency and PWM pulse period within that frequency. It’s a simple matter of keeping the queues with this information full and default values when they aren’t.

John Dammeyer

Although the subject talks about SeeedStudio let’s leave that part alone for a moment and discuss what the Beagle’s part is in all this.

I’d like to take everyone back to geometry learned in school. SQRT(X^2+Y^2) = hypotenuse of a right angle triangle. When we look at velocity we can use the same math. If both X and Y axis are moved at 12 IPM then the movement along that path happens at 16.97 IPM. SQRT(144+144).

So when you set a G-Code value of F12 and execute a move with G1 set then X and Y will not move at 12 IPM. First the distance of each axis is determined. Assume for this example it’s the same distance of 12". That means the total distance moved along the hypotenuse is 16.97" and as we move along that path we want that to be done at 12 IPM because of the F12.

Well that’s (144) = (X^2+Y^2) or in this case because we have a 45 degree angle with equal X and Y it’s SQRT(144/2) = SQRT(72) = 8.48 IPM. So both X and Y will be moved at 8.48 IPM. (in really we use the cos and sin of the angle to proportion the speed to achieve the F speed value.

It’s more complicated than that if the acceleration for each motor is different. So the simple path planner will use the lowest acceleration and make both motors accelerate at that speed so they move at the same rate per second per second to reach the velocity. Same with deceleration.

Once this has been calculated the next question is how to translate a real world velocity (IPM) into steps per second. Once again not really hard if the reduction drive on each axis is identical. A bit harder if one uses 4:1 and the other uses 3:1.

Now the software has to decide when to create each step pulse. Assuming both axis require the same number of steps to move 1 inch (0.2" per rev and 10 uSteps/Step = 2000 steps per rev = or 2000 steps to move 0.2")

We’re asking for 12 IPM which is 0.2" per second so that’s 2000 steps per second. That’s a step pulse every 500 uS. Our DMA clock is set to run at 1MHz spitting out the 16 bits into the SPI device so we get a 1uS long step pulse.

Or in simple terms we get one 16 bit packet, with X and Y STEP pins both set high and another packet with X and Y STEP pins set low . Then the next 498 packets do not change the X and Y step pins. So for one second of data we need at 1000 byte array with 500 values where only one of those has X and Y set high. We need a second 1000 byte array with 500 values for the next 1 second worth of messages.

The trajectory planner has one second to populate the array. The DMA controller signals when it switches to the next array and we ping pong back and forth. When there isn’t any motion the array just has the DIR pins and the COOLANT pins set to their previous values. The output doesn’t appear to change even though the SPI hardware is loaded by the DMA hardware to spit out new data at a 10Mhz rate.

The question is…who and what populates the array and when and how.

John Dammeyer

I would use a cape who can drive DC and BLDC motors with encoder feedback. and has room for 24V I/O thru screw terminals.

A motor such as these types (just an example, maybe different capes for different power ratings) which would make creating tools for industrial situations much, much easier. No need to buy a €250 driver per motor.

https://en.nanotec.com/products/2265-internal-rotor-motors/

Such a cape would need to have enough oomph to drive 24V relays, and connect 24V limit or proximity switches.

Maybe max out on motor+encoder and have a complimentary cape use the rest for the io’s.

Having hardware that drives these motors would help enormously in just creating a working machine (I’m not looking for 3D printing or CNC myself, but for custom machines) It would help me to focus on creating a machine, and not have me connect a bare BB to an industrial driver.

Bas

I would use a cape who can drive DC and BLDC motors with encoder feedback. and has room for 24V I/O thru screw terminals.

And how many people would be interested in a cape like that? The moment you put one type of driver on the cape you restrict the market. For example the Replicape comes with stepper drivers sized for 3D printers. Try using that on a mill with size 34 steppers or an AC Servo like I have for the 4th axis.

The days are past where there is a need or even a desire to close the motor control loop within the trajectory planner CNC control computer. No offense meant to people who manufacture that sort of hardware but 15 years ago the processors to do that were few and far between.

Now there are kits like the STMBL which would still be available in its original form had not the motor driver chip been discontinued. A new version is in the works. This drive can do AC servos and DC brushed or brushless. Step/Dir or Smart Serial. And it’s small and modular and can be replaced. Yes it’s expensive compared to a far east stepper motor driver.

A motor such as these types (just an example, maybe different capes for different power ratings) which would make creating tools for industrial situations much, much easier. No need to buy a €250 driver per motor.

https://en.nanotec.com/products/2265-internal-rotor-motors/

Such a cape would need to have enough oomph to drive 24V relays, and connect 24V limit or proximity switches.

Maybe max out on motor+encoder and have a complimentary cape use the rest for the io’s.

The market for such as you describe exists with MESA and external drives using a standard PC.

Having hardware that drives these motors would help enormously in just creating a working machine (I’m not looking for 3D printing or CNC myself, but for custom machines) It would help me to focus on creating a machine, and not have me connect a bare BB to an industrial driver.

What you want will not be built. The amount of work needed to create something like that for sales in the under 100 units just won’t happen.

For example in 2016 I created my Electronic Lead Screw project. I included on that board two awesome driver chips that allowed control of a stepper motor up to 3A and 55V. Therefore with a 48V supply one could run 300 oz-in stepper motors. Just the two LMD18245 devices now cost more than an entire micro-stepping driver from the far east. And if someone wants to control both Z and X on their lathe they would still need a second driver.

The software inside the ELS has the full micro-stepping code including acceleration and deceleration that now is wasted but I have to maintain it on newer versions for those using the chips.

And if someone damages that high current driver I generally have to replace the entire board. The ELS also requires a heat sink if the on board drivers are used resulting in a larger package and since it includes 35 key buttons, an MPG and a display it’s not something buried deep in a box behind the machine.

So based on my experience I would never again build the motor drivers onto the cape.

John Dammeyer

Bas

This depends a lot on what sort of machine you're trying to drive. A "standard" CNC machine with step/dir typically needs a DB25 (aka: parallel port) with buffered signals you can connect to external stepper drivers. A 3D printer would more typically have low-powered "Pololu" style drivers either on-board or via sockets along with some high power outputs for the extruder and bed heaters. A more advanced system might provide a control signal (+/- 10V, or perhaps PWM) to drive a motor driver and provide for encoder feedback to close the servo loop.

...so it really depends on what sort of system(s) you want to support, and how much you want to try to be a "one size fits all" solution.

I think we have to reliably enable hobby-class machines first. Now, some people take hobby pretty far and I’m not trying to cap this off too small, I just don’t want to boil the oceans. I’d say if we can do a bit more than what CRAMPS can do today, we should.

Personally, I’d want to at least be able to handle the larger 3D printers, smaller CNC mills and some pick-and-place machines. Looking around for some open source ones where the controller could be swapped:

  • Aleph Objects LulzBot Tax Pro
  • SeeMeCNC Rostock Max v3
  • PocketNC V2
  • Charmhigh CHM-T36VA (not open source, but affordable and hackable)
  • Lasersaur

The desire for the above is mostly to be a vehicle for demonstrating motion control in a familiar way. Something CRAMPS-like could largely serve the above, though would need to be done regarding the price to make it sufficiently attractive, perhaps bundling as a kit.

Getting to the standard DB25 seems like a required thing to be widely usable in the community, no?

This all said, I think handling BLDC motors or even small AC motors with encoders and adding software motor control functions would be fantastic and would give some important examples to the community. What I need to try to understand the requirements are examples like the above. Then we can add up all the I/Os, required currents/voltages, look at the encoder protocols, etc. and arrive at a sane set of compromises.

If I go look around a place like https://openbuildspartstore.com/openbuilds-c-beam-machine/, it seems all their machines use steppers.

Looking around https://odriverobotics.com/, perhaps this stuff just hasn’t become popular with hobbyists yet? Can we get a sane set of requirements on what motors we need to drive and encoders we need to support? Are hobby motors like https://hobbyking.com/en_us/9235-100kv-turnigy-multistar-brushless-multi-rotor-motor.html really available in a steady supply (I’ve had issues with this in my quadcopters)?

If there was a solution for 48V BLDC motors w/ encoders, would people start building something or am I just missing where all these machines are already? (Help me find them.) Would it use something like http://www.machinekit.io/docs/man/man9/bldc_hall3v2/ or something else?

/me reads https://www.reddit.com/r/AskEngineers/comments/4qx9b0/why_arent_brushless_dc_motors_more_commonly_used/

Man, I think I’m about to step in an ants nest wondering about BLDC vs. why not just control AC servo motors, but why not?

Looking around for some decision factors on motor type support, I found an add for the ClearPath motors that clarified some things for me: https://www.youtube.com/watch?v=zUy89MT_Rkk. Looking around a bit more, I found on this discussion form a message where Rick Mann got those ClearPath motors working with his BeagleBone.

Anyway, I’d expect there to be a sweet spot for a motor power range and amount of integration suitable to be covered, though perhaps we are talking about needing 2-3 cape designs to be available based on how different some requirements are? Is there real value in providing just the DB25?

Once I can gather a bit more feedback, I’ll come up with a good mechanism for a survey. I’m really looking for those open hardware examples sitting at higher power than the examples I gave that are nicely handled by steppers.

Just a comment... The DB-25 connector was used for RS-232 SERIAL prior
to the mass adoption of the DB-9... Besides also being used as the computer
end of a Centronics parallel printer cable (wired quite differently).

Would someone perhaps be able to describe simply (like MachineKit for Dummy’s) how exactly the step pulse and direction shows up on the Beagle pin relative to the motion command from a G00 X1.0 where current X position is 0.0.

Clearly we accelerate and move and then decelerate to arrive at the end point of 1.0. I do this in my ELS code inside the interrupt routine which happens at a 20kHz rate. If a step is required I set the output at the beginning of the routine and then clear it at the end after a whole bunch of other stuff is done.

Whether to step or not is done by the equivalent of a trajectory planner. For example in simple terms if the motor could accelerate instantly and the step rate was 10kHz then every second interrupt the axis is pulsed. Also for every pulse the position is incremented if going in the positive direction. Decremented if going in the other direction. When it matches the end position the stepping is terminated and we have a move to position.

Inside my ELS interrupt code I do the accel/decel too. The interrupt routine changes the number of 20kHz intervals between step rates and also tracks the half way point. If we’re not up to speed yet but the halfway point is reached then deceleration is started and by the time the stepping rate reaches 0 the motor has also reached it’s desired position.

Otherwise once the step output pulse rate matches the desired velocity the acceleration part is terminated and the number of steps it took recorded, and now a pulse happens every second interrupt (for 10kHz step rate). When the destination location minus the time it took to accelerate is reached deceleration begins. And since we decelerate at the same rate as accelerating and we have that same distance to move, once we reach 0 speed we’ve also reached the destination.

Now this could all be done outside the interrupt routine in a trajectory planner. One could determine that it will take time X to reach either target speed or midpoint of the distance to move. Broken into the 20kHz steps then the information could be fed into a FIFO so no math is done at all inside the interrupt routine. It’s only task would be to read this from FIFO one byte during each interrupt and write it to the port. The interrupt routine could then run 40kHz and clear the port of step signals every second pulse. If there is no motion the FIFO, flagged as empty, holds the last entry for the port and it’s just mirrored out to the port.

So how is it done in the Beaglebone with MachineKit. Is there a function that reads a FIFO filled by the trajectory planner or is it done yet some other way? I would look it up but don’t even know where to start.

Obviously there’s probably more going on under the covers to deal with hard limits. Seems like soft limits are dealt with before motion starts with the option to not move because it will exceed machine limits.

Thanks
John Dammeyer

Wow that has absolutely nothing to do with seeed’s cape.

Wow that has absolutely nothing to do with seeed’s cape.

Yes it does! My previous posting suggested that a cape by SEED should include the infrastructure to have a display and function as a standalone electronic lead screw for a mill. And accept the motion information from something like a Pi or PC via Ethernet if full CNC was required.

That means the software running on the BBB would not be conventional MachineKit. In fact the software might be straight C code developed with the TI IDE as a standalone project with display that can service as a multi-axis power feed and DRO. Or if could be a subset of MachineKit without the HDMI interface.

So it could do motion. The idea is that it could also, via Ethernet, like the MESA 7i92H receive information that would generate the stepping pulses and feedback the DRO information.

It’s time to think outside the box because with the much more powerful Pi4 coupled to MESA hardware there is no way that SEED or anyone else can produce something as good. So it has to be something different.

Seriously. Why pay $150 for a full blown BBB Cape that serves as a Break Out Board and $50 for a BBB that then gives you sub par video compared to a much faster quad core Pi4 running LinuxCNC and Ethernet to a MESA board where the total price ends up pretty well the same.

Technologically the BBB is now old. Very old. And it’s just plain silly to continue to try and make it a be all end all. I’d say 99% of the people I talk to who have CNC are running either MACH or maybe LinuxCNC. Mostly they aren’t interested in changing. The ones who have mill but not CNC either want to add power feed and perhaps DRO but again most of them are not interested in CNC.

So where’s the market? It’s easy. The DRO and Power feed controller that can magically turn into a CNC controller.

John Dammeyer

My two pennyworth.

From origin

G00 X1 Y2

Would go to 1,1 then 1,2 in a “knight’s move” diagonal then straight. There should be no force on the tool except acceleration of a mass.

From origin

G01 X1 Y2

Would linear interpolate, stepping 2 Y for each X. With velocity limited by feed rate, the displacement is sqrt(1^2 + 2^2) = 2.236, the stepping is 2/2.236 Y and 1/2.236 X for each step.

Most home NC milling machines use fractional/micro stepping to get the required resolution (and reduce the noise).
A stepping motor typically has 200 or 400 steps per revolution, (1/16) micro-stepping gives 3200 or 6400 micro-steps per rev. (1/256) micro-stepping might increase that to 51,200 or 102,400.

Lets assume belt drive is 16 tooth 2mm pitch therefore 32 mm per rev (radius 5mm) or 0.16 mm per step; and 0.01 mm per micro-step (or 625 nm per micro-step).

Each micro-step is the system’s unit of distance/displacement; velocity is the rate of steps; and acceleration the rate of change in velocity.
The motor’s available torque/force and the mass to move limit the acceleration, torque/force reduce with speed/velocity.

Some motors (103H5205-4240) will do 200 (or 4000) pulses per sec with torque 0.15 Nm (0.1 Nm) that is velocity of 32mm/sec (640mm/sec) with 0.08 m kg m^2 inertia (3 kg)
Force = m a; a = 0.15/0.08 m 1875 rad/sec/sec or a = F / m = 30 N / 3 kg = 10 m/s/s

A sort of rate multiplier was described which outputs pulses at a rate lower than some maximum.

There are four cape ‘slots’, so a cape for steppers, a cape for BLDC (with/without encoders), …

True.

My CNC project has steppers for X, Y1, Y2, and Z; with either stepper or DC motor for tool. In a 3D printer, the tool is a nozzle size and plastic temperature of the additive, also the bed is often heated, but not in my case. I have not planned a sheet cutter based on laser, water, sand, etc. I have only envisioned milling, drilling, threading, 3D printing, engraving, measuring, and may be pick n place. There are limit switches on X, Y and Z axes, temperature sensor on print head (and bed).

My project is (cheap) tooth belt drive for X and Y, but lead screw is probably better. The steppers are weedy 2A 24V types with micro-stepper driver. The DC motor is stupid RPM 200W 30A 7,2V run from 12V with PWM, that heats up the bearings used in the spindle, the spindle is a 3mm collet type pin vice.

  • Stop and safety switch inputs

  • Stepper control with/without driver

  • Motor and positioning loop control and may be motor driver

  • Limit switch inputs

  • DC motor control with/without driver

  • Heater control with/without driver

  • Temperature sensor inputs

  • Broken/Missing tool sensors

The BBAI is a little different to other SBC, in that it has DSP cores, GPU cores, application cores and controller cores. A glance at the machine kit, it expects a vanilla SBC, access to the DSP, controllers and capes is through HAL/drivers.

How close to the BBAI and its capes, do you want high voltage, high current switching?

A pick n place machine might have camera inputs to identify the PCB, check application of solder paste, identify component, orientate component, check component placement, check soldering faults, etc.

It might have 6 axes positioning of camera and/or placement head. Vacuum or clamp control, to hold down the PCB and pick up the components.

Would you use the BBAI DSP for image recognition, its application processor and GPU to run application and calculate tool paths, microcontrollers to control data interfaces and capes?