CNC-Specific Board
-
I was thinking of putting together a new board design based heavily off of the Duet 3 6HC mainboard, but specifically designed for CNC usage. I'm targeting the price of the Duet 3 Mini 5+ board.
This is the feature list I've put together, I was just hoping for some of your thoughts before I start doing any work:
Screw terminals (Or JST VH connectors) used throughout (Allows for a decent wire size - The EN60204-1 recommendations suggest a minimum of 1.5mm² for power wires, a minimum of 0.75mm² for control wires or 0.5mm² for I/O / PLC wiring)
DIN rail mountable
Main Input:12-24V (12-32V)5V [No need for a high voltage input]
External 5V input with PS_ON output[Not needed, there should be physical controls for power on a CNC machine]
Processor: ATSAME70Q20B
USB & Ethernet
2x CAN
SD card
SBC connector[There will not be a 40 pin connector for an SBC, if SBC integration is to be included (still up for debate) it will be a requirement to use a Raspberry Pi CM4 and the Duet processor will not have an SD card or ethernet port]
2x Serial connector (PanelDue & VFD) [Possibly a third for an MPG, maybe one should be RS485]
6x 5V differential Step, Dir and Enable outputs for external stepper drivers (Molex KK 254 connectors for their slightly higher density, but this only allows for up to 0.5mm²)
1x PWM outputwith Vin supplyfor a PWM to 0-10V converter(Molex KK 254 connector)[Vin supply is not needed as this should be taken from the VFD - This should be a regular output]
9x Opto-isolated open-collector digital outputs, each with indicator LEDs [Must be suitable for driving relays]
9x 30V-tolerant digital inputs, each with indicator LEDs [More inputs are required?]
2x Separate charge-pump outputs, one discrete and one using a small micro-controller (Opto-isolated open-collector output: https://www.machsupport.com/wp-content/uploads/2013/02/ChargePumpSafety.pdf / http://wiki.linuxcnc.org/cgi-bin/wiki.pl?About_Charge_Pumps - A mechanism to monitor an external safety circuit will also be included)Again a lot of this is based upon the 6HC mainboard. The main changes are the removal of the built-in stepper drivers and inclusion of outputs for external drivers. Also there's the change to opto-isolated open-collector outputs (No fan outputs, no high current outputs), LED indicators all over the board and the two charge pump channels for safety circuit integration. (Running at a frequency that can be easily bit-banned from the processor) Everything is based upon 24V being the main control voltage.
I did consider a built-in safety circuit to disable various outputs, but decided against this as the safety portion should be handled via external safety relays. The charge pumps are there to handle a scenario where the software hangs and will allow it to trip the safety relay.
Finally there's the use of either screw terminals or JST VH connectors for almost everything so that proper-sized wiring can be used. (0.75mm² and above for handling rather than current capacity) It's worth noting that in the EN60204-1 recommendations, for signal wiring 0.5mm² is prefered for PLC I/O wiring, 0.75mm² is the minimum for "general panel wiring" and 1.5mm² is the minimum for any power wiring.
-
@yngndrw
Some questions:
Q1: Why do you use 24V input for DuetCNC? Are there any 24V devices on the Duet left? (there are no fans, no heaters...)
The external drivers should better be fed by their own supply, with only common GND.
The 'star' point of GND should sit on the power supply of the Duet.
Q2: What about endstops?
Q3: What about closed loop steppers? Do they communicate with Duet FW? Or is it just like every stepper has it's own closed loop?
( I killed my CNC-frame, because one Y-stepper stalled, while the other pulled on_and_on).
A 'real' closed loop CNC FW would have stopped the second Y-stepper...) -
@o_lampe
Thank you for your responses. I've made a couple of changes to the original list (In square brackets) after sleeping on it, the main things are the removal of PS_ON and the removal of the Vin output for the 0-10V converter as this is usually powered directly from the VFD. I've removed PS_ON from the list because it somewhat conflicts with the concept of a safety relay managing the power supply and reset conditions - We're talking about a CNC machine rather than a 3D printer so being able to remotely turn it on or reset an emergency stop condition is a no-no.[A1] This leads on to your first question, why use a 24V input. It really comes down to convenience as 24V is very common in industrial systems and is also the voltage of choice for most safety relays. Having said that I think you're right that just using an external 5V power supply isn't an issue and probably fits a CNC application better, where DIN mounted power supplies are both plentiful and cheap. It would also make it harder for a user to share a power supply between the safety system and the controller, which I think is best to avoid.
[A2] These would just be conventional inputs, mapped as required. The 30V tolerance should allow for 24V sensors with PNP outputs, while also allowing for just about any other configuration. You could also use an external board via CAN. I'll try and add more inputs seems as there are no-longer any thermistor inputs so there should be plenty of spare pins.
[A3] I don't actually like fully closed loop setups, let me explain. I think they have their place where backlash is a major issue, but if you're going down the rabbit hole of using AC servos with proper drivers (Using velocity or torque control, not step / direction) and have proper linear scales on your machine (Motor-mounted encoders are pointless for full closed loop control as they cannot prevent any backlash), a budget version of the Duet 3 controller is probably not right for you. In this scenario you'd probably be looking at something like the Centroid Oak controller, which costs around $1250 - Small change considering the other costs.
This brings me onto these partially closed loop setups, I like these setups. (The CNC I'm building has JMC 180W brushless servos) You get the maximum performance from the motor without any instability and it draws the line where I think it should - You should be able to trust the controller to motor driver communication. If you're losing steps due to interference for example, you're better served fixing your wiring. The only real disadvantage (Aside from the backlash as mentioned above, for machines in this category anti-backlash mechanics are the solution) from not having a fully closed loop setup is that you have to tune an additional positional PID loop, but that's not a bit issue.
As for your dual Y axis issue, I think there's a couple of questions to be asked and possibly some other solutions which are a better fit:
- Why did your motor stall in the first place? Is it running too close to the edge of its limits or did you have issues with midband-instability?
- Why did the second motor have enough torque to cause an issue if the first motor stalled? Is one side binding or is the frame misaligned?
- If your motors have enough torque to destroy your frame, the frame isn't strong enough. This would have caused machining issues so the frame probably needs to be stronger.
- If the motors are still too strong, it may be worth setting a torque limit if you can depending on the driver you're using. It may be that you need a powerful motor for higher speeds, but at lower speeds they are providing too much torque. A torque limit could flatten this to an acceptable level across the whole speed range.
- The motor drivers should output a fault signal which should be used to stop the machine, preventing damage. The fault could be that too much torque is being demanded, the motor is too far from its commanded position (Either a tuning issue or a faulty encoder causing runaway?) or that the driver or motor has overheated.
-
@yngndrw said in CNC-Specific Board:
We're talking about a CNC machine rather than a 3D printer so being able to remotely turn it on or reset an emergency stop condition is a no-no.
I agree about that safety issue, but there 'should' always be a safety keylock or emergency button on the machine to prevent remote control while someone is 'in the machine'.
Re: Why my machine failed
I replaced the M12 threaded rods with ballscrews and was too keen to find out new max-speeds and accelerations. -
@o_lampe
Yes that's what I meant about not allowing remote resetting. You should need to physically return to the machine in order to reset and re-arm the machine.I think from a software point of view, this means that there should be slightly different terminology within the software. You can trigger the emergency stop and you can clear the fault from the software's point of view, but you cannot reset the emergency stop from there. From a documentation point of view, I'd try to push people down the route of using a real safety relay with redundancy and dual channel emergency stops.
I'd recommend #5 from my list above for your machine if your drivers support it, it should be the easiest to configure and it will prevent burning out motors / drives and destroying mechanical parts if the same thing happens again. (Or at least, it will in some scenarios!)
-
This looks like a worthwhile project. I have a few duets in use that could have used this board instead.
If you want to target a larger spectrum of users, make the motor power supply accept up to 48v; this, too, is very common in industrial use, but will provide better performance, especially with larger motors.
-
@tenaja The main goals are both a cost reduction and a reduction in the overall size for those using separate drivers. (The Duet 3 Expansion 1XD is nice, but it's simply way too large and expensive for a single axis - If you want to drive four axes you're nearly doubling both the price and space required)
Sorry I forgot to update the original post with the latest specs, after @o_lampe's comments I was planning on dropping the higher voltage input altogether and just accepting a regulated 5V input which greatly simplifies the board and means that there's no limitations in motor supply voltage. For my own machine I plan on using a Mean Well HRPG-600-36 (36V @ 17.5A / 600W) for the brushless servos and a Mean Well RD-65B (5V @ 8A / 24V @ 3A / 65W) for both the controller and the safety circuit.
My latest considerations are around whether or not to make this a stand-alone board or build it around the Raspberry Pi CM4 SBC. I personally really like the way I interact with my Duet 2 on my 3D printer so I wasn't originally planning on going down the SBC route due to the added complexity and space usage, but MPGs complicate that somewhat. There is a thread (https://forum.duet3d.com/topic/11389/cnc-style-pendant/150) about building a serial MPG which interfaces with the standalone Duet boards so if gives smooth jogging then I probably won't bother with the SBC route, but if I were going to go down the SBC route I think I'd rather go all-in with the board and accept (Require) a compute module directly - This would mean the removal of the SD card and the ethernet controller from the Duet processor. I'm not sure I see enough benefit for the extra cost, complexity and space though. ( @dc42: Are there any plans to drop support for the "standalone" Duet mode, or will the SBC always be optional?)
-
@yngndrw sorry, I overlooked where you said you were omitting the on-board drivers; I think that is a great decision. That will make it much better for bigger projects.
-
@tenaja Yea that was the main aim really, to replace a ~£300 200x100mm Duet 3 Mini 5+ / 4x Duet 3 Expansion 1XD setup with a ~£150 100x100mm board, while still supporting the latest from the Duet platform. (I.e. CAN)
Another goal is to have something which properly integrates with a safety relay, I see so many people mess up their emergency stop wiring both with and without a safety relay. Something is bound to go wrong if somebody doesn't step in so that's why I'm going to add first class support. (I plan to make it difficult to cut corners, I'm only going to provide diagrams showing how to use it with the safety circuits.)
I've updated the first post with the latest.
-
@yngndrw if you are only using external drivers, you might also consider setting it up for opto-22 i-o modules & boards. Then the control is a mere ribbon cable, and every port is configurable for in or out, optically isolated, and configurable via the module selection for the appropriate voltage & load. The boards come with screw terminals. This is a random photo:
http://oakbluffclassifieds.com/Funny-Listings/Opto-22-G4PB16HC-board-with-qty-4-G4-IDC5-modules-picture.jpgThe boards come in many sizes, from 4 sockets (maybe less) to dozens. There's also a handful of module sizes, so people can pick what works for them.
It's not a super cheap system, but it's very flexible and customizable, and also robust. (Generic modules are a couple bucks each.)
If you wanted tight control of a few inputs, you could hardwire those on your board.
-
@tenaja I've not seen those before, they look like a very interesting concept.
I think for this usage they will take up too much space and cost too much, but I do wonder if the concept could be used - Maybe add-on boards that can adapt banks of outputs to meet various requirements. For example you might want relay outputs, or open collector outputs, 5V outputs, 24V outputs.
I'm trying to balance this with the space usage because I think for the people who are likely to use it (For "desktop" to medium CNC machines essentially), they are likely to have limited space in their control enclosures. For myself, I need to fit everything in a steel enclosure which will slide out beneath an Ikea Lack table which gives me about 500x400x200mm - VFD and all. I think I can get the size down to about 100x50mm or less.
I've also been considering the selection of some of the connectors. I've chosen a right angled RJ45 & RJ11 connector with the release tab on the top, a "flip up" SD card holder which could be mounted away from the edge of the board and a "vertical" micro USB connector which again can be mounted away from the edge of the board. I might even do away with the reset button / external reset input as I don't think it's really required for this application. On the flip side, I'm going to add a lot of status LEDs for every input and output for example.
I typically use EasyEDA as I really like their library integration and I'd probably use JLCPCB's assembly service, but sadly some of the components (The processor for example) do not seem to have footprints right now. I've tried all of the PCB / Schematic software packages and I'm yet to find one I'm really happy with.
https://lcsc.com/product-detail/Ethernet-Connectors-Modular-Connectors-RJ45-RJ11_CONNFLY-Elec-DS1133-S60APX_C77858.html
https://lcsc.com/product-detail/Ethernet-Connectors-Modular-Connectors-RJ45-RJ11_UDE-Corp-S22-ZZ-0019_C711502.html
https://lcsc.com/product-detail/USB-Connectors_Korean-Hroparts-Elec-U-D-M5DD-W-1_C145795.html
https://lcsc.com/product-detail/Card-Sockets-Connectors_MOLEX-472192001_C164170.html