Controller from NUCLEO board

346 views
Skip to first unread message

Jarosław Karwik

unread,
Oct 11, 2024, 5:18:27 AM10/11/24
to OpenPnP
Hi,

After long delay I decided to get back to own motion controller.
This time a bit differently - version made from ready mad and realtively cheap modules, so everybody could make his own.

Zrzut ekranu z 2024-10-11 10-43-38.png

Small reuse of PCB - head junction board
Zrzut ekranu z 2024-10-11 10-41-32.png

I have attched preliminary schematics - it is still under work, but comments are welcomed.

I already have firmware which worked with OpenPnp - only needs some final testing.





UniMix.pdf

Michael Anton

unread,
Oct 11, 2024, 4:33:21 PM10/11/24
to OpenPnP
I'd recommend putting in some form of ESD clamping for all of the inputs and outputs that go off the board.  This is the sort of thing that is always included in industrial hardware.

Jarosław Karwik

unread,
Oct 12, 2024, 3:10:46 AM10/12/24
to OpenPnP
Hi,

It may be not obvieous, but inputs already have it. See 74AHC specs:

They have ESD and overvoltage protection - this with external series resistance makes them very robust ( I have 300+ industrial controllers with such design and it has proven itself reliable - not a single fault).

With outputs it is a bit more tricky. My industrial designs use high side switches instead of MOSFETs, but it makes impossible to have reasonable PWM ( they are heavilly protectd, but slow on single kHz level). On low power pick&place  slightly overpowered MOSFETS ( higher voltage + diode) makes reasonable compromise.   

Slavko Kocjancic

unread,
Oct 12, 2024, 11:10:39 AM10/12/24
to ope...@googlegroups.com
They have ESD protection, but it's prowen to fail if just 1k series resistor is included. If you want to relly on internal protection then you must limit current into pin. And to do that at least 10k must be used. I remember decade ago similar design on paper mill failing around once a week. When input resistor is raised to 47k the problem gone. With 10k was better failing once per two months...
But that is really harsh environment. The cables are indeed short (around 5m) but nearby are few motors all over 150kW!
The design isn't mine. In my design I always attach some load to input. My prefered value is 5 to 10mA. Otherwise in such harsh environment there are possible to got false signals.

... but we are talking of PNP machine. So I just sugest just to raise resistance to 10k.

Slavko.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/301dad50-191d-481d-b59c-71563fe7ac2an%40googlegroups.com.


Jarosław Karwik

unread,
Oct 15, 2024, 9:52:34 AM10/15/24
to OpenPnP
New schematics revision:
- Bigger series resistance to inputs, also small redesign there ( pull down on inputs )
- Reverse polarity protection , fuses added
- Output transistor changed - to fully protected low side swtches
UniMixBase.pdf

Ron Hille

unread,
Oct 15, 2024, 5:23:28 PM10/15/24
to OpenPnP
Hi,
I think the signals like "PUMP_VACUUM" on the lowside switches must be connected to the cathode side of the recovery diodes........
What about the series resistors at the inputs of the gates? I don`t see them in the schematic...

I would also add a capacitor each (~10nF) parallel to R26 and R27 at the analog inputs. 

Why did you choose different micro steps on the motor drivers?

Best regards, Ron

Ron Hille

unread,
Oct 15, 2024, 5:47:13 PM10/15/24
to OpenPnP
Hi Jaroslaw,

forget the microstep comment because you are using serial mode.

Please add capacitors on the VIO motor driver pins, 100nF parallel with 2u2.

Ron


On Tuesday, October 15, 2024 at 3:52:34 PM UTC+2 jarosla...@gmail.com wrote:

Jarosław Karwik

unread,
Oct 16, 2024, 10:08:29 AM10/16/24
to OpenPnP
Hi,

1) The protection circuit for the transistor is quite standard one:
Zrzut ekranu z 2024-10-16 15-25-00.png
It can be done in other ways ( e.g. diode over transistor), but this one has been proven in one of my controllers.

2) 10nF for analog - yeah, you are right
3) VIO pins - there are already capacitors on TMC2209 stick ( at least 100nF), but this may be wise to add it here anyway.
4) Series resistors on gates- usually I do not add them for combination of low mA control output ( here ~25mA) and low power. Especially if this is not pure transistor, but low side switch.

Ron Hille

unread,
Oct 16, 2024, 3:28:49 PM10/16/24
to OpenPnP
Hi,

I just had a quick view over your schematic.
If you want to connect the pump etc. directly (2-wire) to the connectors shoudn`t  you change the connector pins 2 from GND to +24V?

Good luck,

Ron

Roland Exler

unread,
Oct 16, 2024, 3:33:39 PM10/16/24
to ope...@googlegroups.com
Just to note. The diode over transistor (MOSFET) is a different thing, typically included in bridges with transistors in high and low side. 

Also note most MOSFETs have the diode integrated, just a part of them show it explicitly in the symbol (but will be mentioned in the datasheet).

In your circuit a diode over transistor would help with ESD, but not with the high voltage switching off the coil.

Roland

jdlv

unread,
Oct 16, 2024, 4:36:01 PM10/16/24
to ope...@googlegroups.com

Hi,

from the datasheet serie resistor on gate should be 220Ω minimum including driver output resistance :


Clamping diodes are not needed, the device is internally clamped but it certainly won't hurt adding and could help EMC when switching inductive loads.

joël

Jarosław Karwik

unread,
Oct 17, 2024, 4:20:13 AM10/17/24
to OpenPnP
Hi,
New schematics released.
As I wrote before:
- 10nF added for analog lines
- 100nF/2.2uF - for TMC2209 VIO line
Thank you all for help - there were indeed sevearl issues ( mainly my mistakes)

1)  You were right Ron about connectors - I have changed GND to +24V
Original design ( not shared here) had High Side Switches - and that's why ground was there. I have changed them to  transitors first and later Low SIde Switches, but missed that change. Unfortunately High Side Switches are poor PWM dirvers ( they are slow). 

2) Joël you were right about series resistors. I have not used Low Side Switches for quite some time and now after re- reading the documentation ( which you referd to)  it is clear that it should be there.

3) Roland / Joël - I have read more about the clamping diodes. And as you pointed out the one over the inductive load is the  needed one. H bridges use full set, but it is just different case.  I will also keep the diodes as some valves/drg pin coils are reslly huge inductances.
UniMixBase.pdf

Michael Anton

unread,
Oct 17, 2024, 4:22:52 AM10/17/24
to OpenPnP
That is interesting, as I haven't seen ESD clamping on a logic device like that before.

I do agree with the other posters that the series resistor does need to be increased by quite a bit to keep within the max input current rating of 20mA.  To support a 2kV HBM, the value needs to be at least 100K though, and a more conservative one of 200K would keep you within half of the max clamp current (I don't get why they even mention latch-up at 250mA, when the max input current is 20mA).  Also, that series resistor probably should be a carbon comp type, and not an SMT part, or the 2kV will just jump the gap, or be higher than the voltage rating of the resistor.

It sure is much less problematic to just use external clamp diodes, so that the series resistor can be kept to a more reasonable value.  Typically I'd use a series resistor from the input to a dual diode that shunts the voltage to the supply rails or a transorb (or even just leave the resistor out, and connect transorb right on the input), and another series resistor from that node to the logic input.  Once you have the voltage clamped to a known value, you can calculate a resistor to keep the input current reasonable.  If shunting to the supply, you need to make sure there is enough capacitance on the supply rail to absorb the energy of the ESD pulse.  If memory serves, we once worked this out to be something like a minimum of 10uF or so.

Note that now that you have put in 10K series resistors, that you have a pretty serious voltage divider on the input.  You may want to raise the value of the pulldown resistors so that it will still work with 3.3V logic levels.

Michael Anton

unread,
Oct 17, 2024, 4:27:16 AM10/17/24
to OpenPnP
You may want to put in a series resistor between the clamp on the analog inputs and the input pin, to limit the peak current here.  Probably 100 ohms would be fine here, since you are just worried about the diode drop voltage across the resistor, assume the max input current is something like 20mA or so.

jdlv

unread,
Oct 17, 2024, 6:09:55 AM10/17/24
to ope...@googlegroups.com

Hi,

those switches are not fully specified for input voltage under 3.5V, it will work at 3.3V but with some derating, Rdson will be higher, max drain current will be lower and swtiching times will increase unspecified.

To save input voltage you can push the pulldown resitor R25 to the right so it will not form a voltage divider no more.


5A schottky diode is a bit oversized as current is only switching spikes , 1A standard diode in SMA case will be more than enough. But it will work the same. 

joël

jdlv

unread,
Oct 17, 2024, 6:22:50 AM10/17/24
to ope...@googlegroups.com

Hi,

20mA is the max continuous average DC current, 250mA is the max spike current before latch-up occurs. With a 10K resistor the gate will survive to 200V DC and 2500V spikes. Looks safe enough.

joël

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.

SM

unread,
Oct 17, 2024, 6:38:38 AM10/17/24
to OpenPnP
Hello Jarosław,

Many years ago I also realized the simple way of a central “allinone”-controller with cheap stepstick modules. In addition to control via Ethernet, the main focus at that time was a true 7-segment ramp control for each axis and connection of the servo lines (symmetrical line drivers) and lots of I/O ports. Unfortunately, this solution had the serious disadvantage that you had to run a huge number of cables to the head and that the stepsticks (TMC5160A) often caused problems. The better solution was, of course, to separate the main controller from the head controller using reliable data transmission (CAN-FD) - this meant that only very few cables were needed to the head.

Proven compact relay drivers (NUD3124) are used for local control of the small 10 mm vacuum/blow valves or for switching small loads. I can only recommend them, because after almost two reels there has not been a single failure.

Michael Anton

unread,
Oct 17, 2024, 4:56:48 PM10/17/24
to OpenPnP
There is nothing in the maximum ratings to indicate that the 20 mA spec is only a continuous rating.  The only hint we have is in the features section, and I'd generally ignore those in favor of the max ratings if they differ.  I guess if it were me, I wouldn't be relying on the latch-up rating, and I would also stay within half of the max rating.

Jarosław Karwik

unread,
Oct 18, 2024, 2:01:17 AM10/18/24
to OpenPnP
Hi

1) I have selected the 74AHC over combination of diodes/resistors as it is just more easier to handle then small diodes ( when assembled manually). My favorite diode pack is SOT363-6 and unfortunately it is time consuming when handled without pick&place machine. I have used it for analogs only :
Zrzut ekranu z 2024-10-18 07-25-31.png

The 5V signal from analog sensor goes to the 10k/22k divider and clamping circuit.
Hmm - extra 100R here between clamp and processor ? Yeah, that might help, but in really extreme cases. 

2)  These inputs on the board are not intended to be used with 3.3 nor 5V  - they are designed to be handles by mechanical switches or analog optocouplers.
The idea is to use ( via 1k resistors ) at least 8V - with possibility up to 24V
Zrzut ekranu z 2024-10-18 07-28-41.png
Zrzut ekranu z 2024-10-18 07-30-14.png

3) The VNN3NV04PTR-E switches - I think you are right here.
  The specs specifies Vinth, but it is for OFF state ( which I missed)


Zrzut ekranu z 2024-10-18 07-33-48.png

I will take different component - BSP78 with

Zrzut ekranu z 2024-10-18 07-39-10.png
However this one is quite slow ( 60uS turn on time), so this is still open
I might keep the previous component , but add voltage level converter.

4) My controller is 7 segment S shaped generator. (with both Ethernet and USB)  And I also considered using FDCAN with separate head controller.
But ... I have been this way with our Voron 3D printer ( we had to fix wires twice and then switched to FDCAN head).

This is nice feature, but in case of pick&place quite expensive . You need pretty powerful processor in the head as well. And quite many extra components. At this point you will not be able to easily assembly the electronics manually ( I could, but most people would lack both equipment and skills)

There is also middle ground - put differential lines to the head and only very small processor to handle i/o and motor controller configuration. I have calculated I could reuse 2x USB-C cables for that ( they are nice sets of 100W power plus several differential lines)

In the end I decided to to for simpler way - still cables, but with junction board in the head. So the controller and head uses 6x 4 wire cheap chainflex cables.
While not ideal ( I admit that), making 6 identical 1:1 cables with connectors is ugly, but relatively easy.
Zrzut ekranu z 2024-10-18 07-52-00.png

Zrzut ekranu z 2024-10-18 07-53-00.png

5) NUD3124 are nice, but I prefer to have at least 500mA ( these are 150mA)

Again - thanks for comments

Michael Anton

unread,
Oct 18, 2024, 4:27:08 PM10/18/24
to OpenPnP
The external diode package doesn't do more for you than the device's internal clamping diodes, UNLESS you put the extra resistor in series.  You need to limit the peak current into the device, so once the voltage is clamped to a known value, you then do that with the series resistor.  Otherwise, the part sees the 2kV from the HBM with a series resistor of 1500+10k ohms.  Peak current works out to about 170mA (though some would be carried by the 22k resistor as well), and is likely shared between your external diodes, and the device's internal diodes depending on the voltage drops of the parallel diodes.  So I guess you can decide if it is extreme or not  given that it only satisfies the lowest standard HBM voltage...

Jarosław Karwik

unread,
Oct 19, 2024, 4:34:31 AM10/19/24
to OpenPnP
Hi,

It stil does not explain what you meant as it mostly focused on straight ESD protections.
But some other sources explained it more -  in clamping configuration like mine the current load in ESD condition would be split between external diodes and internal ones ( this is the part I missed initially - they would be indeed in parallel). So adding resistor there will affect the split toward most of the current going to external diodes and protecting against chip failure.

Thanks again, hopefully now I will be able to make final version of the schematics ( with these extra resistors)

jdlv

unread,
Oct 19, 2024, 4:47:20 AM10/19/24
to ope...@googlegroups.com

Hi,

it's not clearly stated in datasheets but those switches are not really designed for 3.3V inputs. This one is but quite slow:

 https://www.mouser.fr/datasheet/2/196/Infineon_BTS3011TE_DataSheet_v01_00_EN-3361129.pdf

VNN3NV04PTR-E and a voltage converter looks a good solution, fast enough for PWM and reasonably low Rdson. Those kind of voltage converters have an output resistance in the range of 60Ω so the 220Ω serie resistor is required:

https://www.ti.com/lit/gpn/sn74lv1t08

Forget what I said about the schottky clamping diode, when PWM a large inductance the average current in the diode can become large and the low schottky Vf will limit losses and heat to dissipate.

joel

Jarosław Karwik

unread,
Oct 19, 2024, 4:50:35 AM10/19/24
to OpenPnP
I will most likely just duplicate this  74AHC for this purpose ( with with supply from 5V) 

jdlv

unread,
Oct 19, 2024, 5:05:06 AM10/19/24
to ope...@googlegroups.com

looks good!

joël

Jarosław Karwik

unread,
Oct 19, 2024, 7:03:26 AM10/19/24
to OpenPnP
Attached latest update
1) Modified analog circuit - fixed ESD protection

Zrzut ekranu z 2024-10-19 12-31-18.png

2) Fixed output control - transistor gate controlled from 5V signal

Zrzut ekranu z 2024-10-19 12-31-04.pngtion
3) Added extra outputs ( not assembled by default - copy of already existing design)
UniMixBase.pdf

tonyl...@gmail.com

unread,
Oct 19, 2024, 11:50:52 AM10/19/24
to OpenPnP
Maybe doesn't matter, but are the serial connections to U6 and U13 swapped? U6 has step and dir for the Z axis but is connected to the serial connections labeled **_uvw.

Tony

Michael Anton

unread,
Oct 19, 2024, 5:34:18 PM10/19/24
to OpenPnP
Yes, think of it this way.  Your external clamp limits the voltage swing to a defined value at that point.  In your case, a diode drop above and below the supply.  Then you pick a resistor with that clamp voltage in mind to limit the current into the device to keep within it's diode ratings.  Typically we'd be more conservative and shoot for half of the max input current to be well on the safe side of things.  If you end up with over and under shoot of 1V, then 100 ohms keeps the current to 10mA, which the internal diodes can happily handle.

On Saturday, October 19, 2024 at 2:34:31 a.m. UTC-6 jarosla...@gmail.com wrote:
Hi,

It stil does not explain what you meant as it mostly focused on straight ESD protections.
But some other sources explained it more -  in clamping configuration like mine the current load in ESD condition would be split between external diodes and internal ones ( this is the part I missed initially - they would be indeed in parallel). So adding resistor there will affect the split toward most of the current going to external diodes and protecting against chip failure.

Thanks again, hopefully now I will be able to make final version of the schematics ( with these extra resistors)






piątek, 18 października 2024 o 22:27:08 UTC+2 Michael Anton napisał(a):
The external diode package doesn't do more for you than the device's internal clamping diodes, UNLESS you put the extra resistor in series.  You need to limit the peak current into the device, so once the voltage is clamped to a known value, you then do that with the series resistor.  Otherwise, the part sees the 2kV from the HBM with a series resistor of 1500+10k ohms.  Peak current works out to about 170mA (though some would be carried by the 22k resistor as well), and is likely shared between your external diodes, and the device's internal diodes depending on the voltage drops of the parallel diodes.  So I guess you can decide if it is extreme or not  given that it only satisfies the lowest standard HBM voltage...

On Friday, October 18, 2024 at 12:01:17 a.m. UTC-6 jarosla...@gmail.com wrote:
Hi

1) I have selected the 74AHC over combination of diodes/resistors as it is just more easier to handle then small diodes ( when assembled manually). My favorite diode pack is SOT363-6 and unfortunately it is time consuming when handled without pick&place machine. I have used it for analogs only :
Zrzut ekranu z 2024-10-18 07-25-31.png

The 5V signal from analog sensor goes to the 10k/22k divider and clamping circuit.
Hmm - extra 100R here between clamp and processor ? Yeah, that might help, but in really extreme cases. 

Jarosław Karwik

unread,
Oct 21, 2024, 3:16:19 AM10/21/24
to OpenPnP
Hi,

I have fixed naming of the serial bus controlling TMC2209 - it would work, but could be misleading previously.
All files are here :
Zrzut ekranu z 2024-10-21 09-11-18.pngZrzut ekranu z 2024-10-21 09-11-42.png
Version without assembled optional outputs.

Before ordering I will fix firmware to be sure I/O mapping is correct ( there can be sometimes limitations on certain functionality like PWM/Timers not really seen before actually using these features).

I will also add later on  the head junction box and feeder controllers ( for Bing / 0816 feeders)
UniMixBase.pdf

Jarosław Karwik

unread,
Oct 21, 2024, 4:39:06 AM10/21/24
to OpenPnP
The Nucleo I use is this one:

I have limited myself to ZIO connectors only, so basically whole Nucleo-144 platform can be used (after some adaptation)
You can buy it in Mouser, Farnell, Digikey and even sometimes in local shops ( look for "NUCLEO-H755ZI-Q" )
Should be ~30EUR

Once I work a bit more on the firmware, I will add more info about compatibility - the way I use STM Cube allows sometimes to just to recompile without changes the whole firmware for new platform - only after some clicking on pin mapping GUI.

The PCB board itself is ~9EUR ( bought in JLPCB - with shipping in 5 pack)

Mike Menci

unread,
Oct 21, 2024, 5:35:35 AM10/21/24
to OpenPnP
Cool - ? ?? MHz Processor ?

Jarosław Karwik

unread,
Oct 22, 2024, 9:42:38 AM10/22/24
to OpenPnP
Reply all
Reply to author
Forward
0 new messages