Project circuit guidance

Hello

Please see below a wiring diagram & parts list for my dancing robot. I was hoping that you knowledgeable folk could advise me whether
there are any improvements that I can make or good practices and circuit protection required. NOTE: The reason I have so many spare pins on the logic level converters is because some pins did not work so it was easier to add another unit.

My robot previously functioned well as anticipated, however since then I have added two more worm gear motors (with two BTS79060 drivers for each motor) and I changed two 2.8A Nema 23 stepper motors that were connected to a CNC shield with TMC2209's for two 4A Nema 23 stepper motors connected to two DM542T drivers. Since those changes it is clear that the robot is not happy about something, odd things happen intermittently like one 1.5A stepper motor moves by it self and judders, sometimes the 4A stepper does not move until the new worm gear motor stops moving, I have also had bootup issues where stepper motor coils energize before being enabled & I receive;
rst:0x10 (RTCWDT_RTC_RESEets Jul 29 2ets Jul 29 2019 12:21:46
rets Jul 29 2019 12:21:4ets Jul 29 2019 ets Jul 29 ets Jul 29 2019 12:21:46
rst:0x10 (RTCWDT_Rets Jul ets Jul 29 2019 1ets ets Jul 2ets Jul

The Esp32 is powered by my laptop usb and I have not uploaded the code because it is several thousand lines long and as I said the functionality was previously working fine with the same code that I have duplicated for the new components.

22AWG wire used through out apart from 24v power connection to motor drivers and power connection to the dc motors where 16 or 18 AWG cables are being used.

OAS in the schematic stands for Obstacle Avoidance Sensor.

Thanks in advance.

1 X Power supply 240v to 24v 20A
[https://www.amazon.co.uk/dp/B09YLFNJHM?ref=ppx_yo2ov_dt_b_product_details&th=1]

2 X 1A DC 24V 25RPM Worm Gear Motor
[sourcingmap DC 24V 25RPM Worm Gear Motor 20kg-cm Reversible High Torque Speed Reduce Turbine Electric Gearbox Motor 8mm Shaft : Amazon.co.uk: Business, Industry & Science]

2 X 1A DC 24V 470RPM Worm Gear Motor
[sourcingmap DC 24V 470RPM 4Kg.cm Self-Locking Worm Gear Motor With Encoder And Cable, High Torque Speed Reduction Motor : Amazon.co.uk: Business, Industry & Science]

4 X Hailege BTS7960 43A Dual H-Bridge Stepper Motor
[https://www.amazon.co.uk/gp/product/B07Y4TTK3Z/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1]

2 X KINGPRINT TMC2209 V1.3 Stepper Motor Driver 2.8A
[KINGPRINT TMC2209 V1.3 Stepper Motor Driver 2.8A Peak Driver 3D Printer Parts for SKR V1.3 SKR PRO V1.1 (TMC2209 V1.2 6pcs) : Amazon.co.uk: Business, Industry & Science]

1 X CNC Shield V3.0 Expansion Board
[AZDelivery CNC Shield V3.0 Expansion Board Bundle, 4PCS A4988 Stepper Motor Drivers with 4PCS Heatsink Kits compatible with Arduino, 3D Printer Including E-Book! : Amazon.co.uk: Business, Industry & Science]

2 X Nema 17 Stepper Motor 42 1.5A
[Usongshine Nema 17 Stepper Motor 42 Motor 1.5A (17HS4401) High Torque 42N.cm (60oz.in) 42BYGH 1.8 Degree 4-Lead with 1m Cable and Connector for DIY CNC 3D Printer (Pack of 5) : Amazon.co.uk: Business, Industry & Science]

2 X Stepper CNC Kit Nema 23 4A Stepper Motor & Driver
[1 Axis Stepper CNC Kit 2.4Nm(339.87oz.in) Nema 23 Stepper Motor & Driver - 1-DM542T-23HS32 | StepperOnline]

4 X MCP23017 IO Expansion Board
[https://www.amazon.co.uk/gp/product/B08DFNR2JW/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1]

3 X TXS0108E 8 Channel Logic Level Converter Bi-Directional High Speed Full Duplex Shifter 3.3V 5V
[GeeekPi 6Pack TXS0108E 8 Channel Logic Level Converter Bi-Directional High Speed Full Duplex Shifter 3.3V 5V for Arduino Raspberry Pi : Amazon.co.uk: Computers & Accessories]

2 X 3.3V-5V 4 Channels Logic Level Converter Bi-Directional Shifter Module (Pack of 10) CYT1076
[Gebildet 10Pcs 3.3V-5V 4 Channels Logic Level Converter Bi-Directional Shifter Module (Pack of 10) CYT1076 : Amazon.co.uk: Business, Industry & Science]

1 X HD44780 1602 16x2 Serial LCD White Character Blue Backlight Display Board IIC PCF8574T I2C Adapter
[https://www.amazon.co.uk/gp/product/B07CQG6CMT/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1]

1 X 3A Buck Converter DC to DC Converter High Efficiency Voltage Regulator 3.0-40V to 1.5-35V
[Yizhet 5 Pack Buck Converter DC to DC Converter High Efficiency Voltage Regulator 3.0-40V to 1.5-35V Buck Converter Adjustable Power Supply Module : Amazon.co.uk: Business, Industry & Science]

2 X 2A LM2596S DC-DC Power Supply Adapter Step Down Module
[https://www.amazon.co.uk/gp/product/B07DP3JX2X/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1]

4 X Power Distribution Board 2 Inputs 13 Pairs Outputs for DC AC Voltage PCB007
[https://www.amazon.co.uk/gp/product/B0814B5P5M/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1]

1 X ESP32-DevKitC NodeMCU WiFi WLAN CP2102 ESP32-WROOM-32D
[https://www.amazon.co.uk/gp/product/B074RG86SR/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1]

1 X ESP32 Breakout Board ESP32 Expansion Board 38Pin
[XTVTX 2 Pcs ESP32 Breakout Board ESP32 Expansion Board 38Pin Development Board with Wireless WiFi Bluetooth for ESP-WROOM-32 Microcontroller Development Board : Amazon.co.uk: Business, Industry & Science]

2 X Bourns 128 Pulse Absolute Mechanical Rotary Encoder with a 6.35 mm Plain with Slot Shaft (Not Indexed)
[https://uk.rs-online.com/web/p/mechanical-rotary-encoders/2632918?cm_mmc=UK-PLA-DS3A-_-bing-_-PLA_UK_EN_Catch+All-_-Electronic+Components,+Power+%26+Connectors-_-2632918&matchtype=e&pla-4574724306713135&cq_src=google_ads&cq_cmp=554644865&cq_term=&cq_plac=&cq_net=o&cq_plt=gp&gclsrc=ds]

8 X IR Infrared Module 3-Wire
[https://www.amazon.co.uk/gp/product/B08DR1W3BK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1]

AZDelivery 5 x KY-003 Digital Hall Effect Sensor
[https://www.amazon.co.uk/gp/product/B07V3S94HZ/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1]

2 X 3D Printer Limited Switch
[https://www.amazon.co.uk/gp/product/B07XDQ96FQ/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1]

16 X RGB LED 5050 Addressable WS2812B segments
[https://www.amazon.co.uk/gp/product/B0B39554LH/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1]

1 X Noctua NF-P12 redux-1300 PWM, Quiet Fan, 4-Pin, 1300 RPM
[Noctua NF-P12 redux-1300 PWM, Quiet Fan, 4-Pin, 1300 RPM (120mm, Grey) : Amazon.co.uk: Business, Industry & Science]

1 Like

Didn't work because you have a 1K resistor in the supply voltage Vcca
I also don't see a single bypass capacitor in the entire schematic.

2 Likes

Hi jim-p

From memory, I believe I previously used a 10k resistor until I read a thread sometime last year with a few contributors stating that they used a 1k resistor. What do you recommend I should use?

There is a 1000uf 16v capacitor between 5v & gnd for the LED's, it's stated at the bottom left of the schematic.

I know that there are 100uf 60v capacitors on the cnc boardvfor each TMC2209 driver. What other capacitors do you think I need to include?

Thanks in advance

https://learn.sparkfun.com/tutorials/capacitors/application-examples

Thanks LarryD, I now understand the concept for using bypass capacitors, so basically I need to put one or more on the motor drivers, the MCP23017 and even possibly the logic level converters, is that correct? What I don't understand the equation for calculating the size of capacitor to use. As per the link you provided it states "Usually 0.1µF is a good choice, or even add some 1µF or 10µF caps". What I don't want to do is cause more harm then good, can you advise a simplified method to correctly sizing the capacitors?

Thanks in advance

There should be NO resistor

Just to clarify, you suggest that I should tie vcca to OE without the resistor ?

I appreciate your advice but things can often get a bit confusing as different people on this forum have different opinions about the same thing, see below two of my bookmarks regarding the TXS0108E where different people suggest using a resistor. I am not knowledgeable enough in electronics to say who is right or wrong!

In addition to the decoupling issues mentioned earlier, contributing factors can be power supply inadequacies and in particular poor coding. You mention 1000s of lines of code that allegedly worked before, but the variety of inputs & outputs of the system makes it more than likely that you have at least several bugs in your code.

image
Is that a diode? It shouldn't be there if it is.

The schematic is virtually impossible to follow despite your commendable efforts to make it sort of readable.

image
Is there indeed no 5V applied to the HV connection of the logic level converter?
Why is it there anyway and why not just run the entire thing on 3.3V logic? Not that it matters a whole lot, but why include components if you don't need them.

You got an awful lot of those; why not use the unused channels? You could get by with just TX1 and drop TX2 + 3.
Overall this looks mostly like an exercise of how many logic level converters you can fit on a board while not really using them very effectively.

So figure out why they don't work. You evidently have a major problem if pins on devices somehow don't work. Fix that instead of sticking a band-aid on it.

No. You should tie Vcca directly to 3.3V and OE to 3.3V with a 1K resistor.
I think maybe you just drew your schematic wrong.

I assume you also drew this wrong
image

Thank you, I will try that now

Admittedly, I could have drawn it better. The 10k resistor is on the data line for the LED segments blocks, with a 1000uf 16v capacitor between 5v & gnd going to to the buck converter

If you show us a schematics with mistakes, they will be the first things everyone will point out to you as to why your device does not work.

It is the ground symbol on the software I am using www.circuit-diagram.org

It's best I could do with what I have available

Yes, there is 5v applied, admittedly that was an oversight not to add it in the diagram drawing. However, I am using logic converters because ESP32 uses 3.3v logic and most of the components use 5v

I stated in my first post the reason why, I have no intention of using components for the sake of it

That's the reason why I created this post, if the solution offered by jim-p works then hopefully that should resolve the issues (combined with adding bypass capacitors)

Thank you for your feedback

It was not something I done intentionally, I have never drawn a full schematic using software, it can get a bit disorientating laying out all of the connections, all I can do is try to do better

I'm sure you didn't but you understand what I'm saying.

OK; thanks, I suspected this.
Never draw lines/traces through symbols. It muddies the waters.

The freely available tools are capable of making more easily readable schematics.

Do they need to?
E.g. the motor drivers will accept 3.3V input just fine. You might want to check your limit switches etc. as well.

Fingers crossed, then!

Start by determining whether you really need those level translators. If you do, test with a single converter module and work with that until you get all of it to work. Then build on that experience to expand your system.

You're running several high-powered motors in a potentially noisy environment with complex code. The odds that something makes the whole setup unstable are massive. You need to break it down into manageable chunks, adhere to a couple of basic design principles and be alert to anything that's abnormal; band-aids tend to just mask the putrefying wounds underneath.

The 100 ohm pullup resistors are way too small, you will be exceeding the ESP32 current sinking capability.
You should not need the 100 ohm or the 330 ohm resistors.

I can't remember where I got the information to use these resistors because I started using the CYT1076 over a year ago. However, I will test it without resistors on my test rig before dismantling my circuit.

Can you recommend another free tool ?

I believe some of the components do, however the ESP32 has limited pins which is why I use a MCP23017 (5v). As for the motors, the cnc shield states 3.3/5v logic range but I can't remember why I am using 5v (it's been over a year) I believe it was not function properly with 3.3v. I think the same applied to the BTS7960, this data sheet was difficult to dissect . However, I will try again and test them using 3.3v to confirm I did not imagined an issue not to use it.

Infineon-BTS7960-DS-v01_01-en.pdf (468.4 KB)
CNC Shield V3 Bundle_EN.pdf (1.4 MB)