The wires are 22AWG, the furthest MCP23017 from the power rail is 20cm.
The next/maximum setting is 4.50A peak/3.20A RMS, which I did not choose because the motor is 4A, I thought that it was not permitted to set a peak greater than the motors rating. As far as I understand the RMS is the normal operating amps used but what I was concerned about is it drawing more than 4A and destroying the motor. Would it be safe to se it to 4.50A peak/3.20A RMS?
Yes it is
I did not have enough room to draw all of the motor connections to the MCP23017's, that's why I add a label on each motor to indicate this, sorry if it wasn't clear enough.
The I2C wires on the CYT1076 are about 10cm away from the ESP32, I will move things around to try and get it closer. There is some slack on the 3.3v & gnd wires that definitely can be shortened. The I2C wire from the CYT1076 to the first MCP23017 are 22cm long, so I will move things around to make it shorter.
I only have INPUT_PULLUP for declaration of the absolute encoder on one MCP23017 in the code (which is not share by anything else) because the output data was not reading correct results without it, no physical pull ups are present anywhere else on the circuit, I'm not sure what you suggest I should remove?
I did not have enough room to draw all of the motor connections sorry if it wasn't clear enough.
It's quite unconventional
10cm + 22cm long
You are lucky it works at all. I2C was not designed to drive long wires and when you you do it should be a flat cable with extra ground wires as shields
Right now I'm focusing on the I2C bus. As I said before there should be only one set of pull-ups on the bus but all your MCP boards have them, the CYT board has them and probably the LCD display.
The long wires and multiple pull-ups will make I2C functionality quite unpredictable.
I forgot that I have one 100 & 330 ohm resistor is on the data line for the LED's going into the CYT board to ESP32 but the LED's are not currently connected.
The I2C wire for LCD is the last connection on the I2C line, it is about 30cm long but the LCD is not currently connected either.
Can you please provide a link to the type of wire I should use?
I need the MCP boards as I need extra pins, so I don't know what alternative there is and I don't know how I could remove the pull-ups from the MCP and CTY board?
I am going to purchase this 30A power supply just in case the 25A power supply I have does not provide enough juice.
I hope this will be ok because the amazon page for the buck convertors say " The input current needs to be kept below 2.5A." but surely that must be incorrect!
Probably not.
They specify a max input current because you will probably exceed the power dissipation of certain components.
For a buck and boost, the input current will depend on the output current, not on the current capability of the power supply. If you know the output current and voltage you can calculate the input current. Since the input power to a buck/boost is approximatly equal the the output power, you can easily estimate either current if you know the input and output voltages.
Power in = Power out
Power = current x voltage (P = I x E)
Output voltage = 5V
Output current = 3A max
Input voltage = 24V
Input current = unknown
So we have:
24V x I = 5V x 3V
24 x I = 15W
I = 15W/24V
I = 0.625A
No problem for your buck
1: I changed the power supply to 30A but the only difference it made was to irritate me with the ridiculously loud fan noise
2: I put the circuit on a diet and reduced the length of every data and power cable as much as possible
3: I changed the DM542T steppers to RMS/3.20 peak 4.50
4: I moved the DM542T steppers enable pin from MCP23017 to connect directly to the ESP32 via the CD74ACT541E
5: I changed the 24v power cables (for the motors) from the power supply to 16 AWG wire that is suitable for current up to 30A
6: I moved the CYT1076 right next to the ESP32
All of the above changes have not resolved the issues.
The only other thing I could do is reduce the length of the I2C cables from the CYT1076 to the first MCP23017 in the daisy chain (currently about 13cm long), if I reconfigure the board I should be able to reduce the length to around 5cm long but I don't know how much of a different it will make, however I will do it tomorrow.
Additionally, I done some research and found a I2C extender (Adafruit LTC4311 I2C Extender / Active Terminator - STEMMA QT / Qwiic) which I have ordered and should hopefully arrive on Monday.
This is my circuit, the only thing I removed was the 120mm fan because you would not be able to see the circuit with it attached.
Nothing personal but what a rats nest. With motors and servos, it's a breeding ground for EMI (Electro Magnetic Interference).
I2C is very susceptible to EMI. Debugging the problem can be very difficult since the interference is transitory and intermittent. Move a wire it works, move another it doesn't. Send a particular command it works, send another it doesn't. It work one day and not the next.
The ESP itself is also somewhat susceptible. I would spend some time trying to make the wiring a little neater. Keep all the high current motor related wiring away from any signal wire.
I previously mentioned that I tried to shorten every wire as much as possible, running every wire to its shortest path. I could obviously make it look as neat as possible but then the wires would have to be much longer.
The 24v wires are grouped together on the right hand side of the board and I tried not to put them near any data cables but it is impossible to move them more than a couple of cm of a data cable as they are part of the same circuit.
I recently moved the first daisy chain MCP23017 right next to the CYT1076 , removing 10cm of I2c wires but the issue persist.
I am in the process of converting the DM542t and BTS7960 data wires to shielded cat5. I am also going to try and tie SCL to ground as I read in an article about that making an improvement to I2c communication.
I've never seen an I2C bus configuration with anything connected to ground. Doesn't quite make sense and probably violates the I2C bus spec.
I'm sure if I was there with my DMM and scope, I could figure out what is wrong but I think I have reached my limit as to what I can do via messaging on the forum
It mentioned the type of wave forms from a I2c signal.
I've measured voltage across different components and didn't see anything abnormal. I could purchase an oscilloscope but I'm not sure where would be the best parts of the circuit to measure.
Well, all I can do is point out all the obvious issues that may be causing problems and I think you fixed all of them.
As I said, I think I've done all the possible debugging help I could possibly do over the internet.
Sorry that nothing helped but I have no further suggestions.