Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Jak24 on February 16, 2014, 04:44:46 AM

Title: Advise for circuit, and pcb layout
Post by: Jak24 on February 16, 2014, 04:44:46 AM
Hi!

So I am designing a pcb for my robot, and I would greatly appreciate some constructive criticism.
I have attached the eagle schematic and board file.
I use 2 arduino's because I have 2 I2C devices and their address cant be changed for some reason...
and I am using BTN7971B For my motor controller as I will be controlling 4 fairly high power motors
I have attached the circuit which I based the design on for the motor controller, and also I am using a  lm2576 for 5v regulation for which
here is the original circuit: http://www.hobby-hour.com/electronics/lm2576-step-down-switching-regulator.php (http://www.hobby-hour.com/electronics/lm2576-step-down-switching-regulator.php)
basically If you wold have any advise/ tips on the layout/circuit please advise.
It's not finished, things like the pin outs to my sensor, but most of the main circuitry is there.
One thing I am sure I will need to change is all the small capacitors being replaced for a larger one, any suggestions on a
suitable value for those capacitors would be great.
So any advise or suggestions would be much appreciated

Thanks
Title: Re: Advise for circuit, and pcb layout
Post by: knossos on February 16, 2014, 05:54:49 AM
Have you looked at setting up a second software I2C to avoid having to use a second Arduino?  Take a look at this (http://playground.arduino.cc/Main/SoftwareI2CLibrary) and this (http://forum.arduino.cc/index.php/topic,18400.0.html) for example.
Title: Re: Advise for circuit, and pcb layout
Post by: waltr on February 16, 2014, 07:57:53 AM
I do not see de-coupling caps on the atmega or sensors. 100nF caps very close to the Vcc & ground pin of each chip is important.

I do not see any pull-ups on the I2C lines.
Title: Re: Advise for circuit, and pcb layout
Post by: jwatte on February 16, 2014, 01:41:15 PM
Could you explain how you think the optocouplers help in this case?
How did you choose the value for the pull-up for the opto-coupler outputs?
Title: Re: Advise for circuit, and pcb layout
Post by: jwatte on February 16, 2014, 01:42:52 PM
Also, the trace loop around D1 from the inductor sense is very bad for a switching regulator. The switching node to feedback input pin should be as short and straight as possible to avoid parasitic inductance and oscillation.
Title: Re: Advise for circuit, and pcb layout
Post by: jwatte on February 16, 2014, 01:45:25 PM
And it looks like you're drawing main power from the Arduino voltage pin. That is unlikely to work for any significant amperage.
Title: Re: Advise for circuit, and pcb layout
Post by: Jak24 on February 17, 2014, 02:01:22 PM
Hi

Thanks for the replies!
And it looks like you're drawing main power from the Arduino voltage pin. That is unlikely to work for any significant amperage.
I am powering the arduino from the 5 reg circuit (through the 5v and gnd pin), that and every other chip that needs 5v.

Also, the trace loop around D1 from the inductor sense is very bad for a switching regulator. The switching node to feedback input pin should be as short and straight as possible to avoid parasitic inductance and oscillation.


fixed attached a new version
Could you explain how you think the optocouplers help in this case?
How did you choose the value for the pull-up for the opto-coupler outputs?

I didn't choose it, I based my design entirely on a prebuilt btn7971b controller from ebay:
http://www.ebay.com/itm/BTS7971B-BTN7971B-70A-High-power-motor-drive-module-with-Optocoupler-MO03010-D75-/281236241549?pt=LH_DefaultDomain_77&hash=item417afc7c8d (http://www.ebay.com/itm/BTS7971B-BTN7971B-70A-High-power-motor-drive-module-with-Optocoupler-MO03010-D75-/281236241549?pt=LH_DefaultDomain_77&hash=item417afc7c8d)
And it's circuit is attached!
I simply chose it because I figured it would work, and since I am still an amateur in electronics I would not want to mess with it.
I do not see de-coupling caps on the atmega or sensors. 100nF caps very close to the Vcc & ground pin of each chip is important.

I do not see any pull-ups on the I2C lines.

So I should just put a 100nf 15V cap on the power for each sensor/ Mcu?
Pull-ups I believe are on the sensor, otherwise should I add 2 x 2.2 k resistors?

Thanks
Title: Re: Advise for circuit, and pcb layout
Post by: Jak24 on February 22, 2014, 02:18:45 PM
Just bumping this thread, perhaps someone has further advise to give, also it recently dawned on me that I
have not accounted that I could accidentally turn both PWM inputs on the h-bridges to high.
If someone could advise some sort of circuitry with which this can be solved, It would be greatly appreciated.
Also
I do not see de-coupling caps on the atmega or sensors. 100nF caps very close to the Vcc & ground pin of each chip is important.

I do not see any pull-ups on the I2C lines.

So 1 100nf cap for each sensor and mcu?
Thanks
Title: Re: Advise for circuit, and pcb layout
Post by: waltr on February 22, 2014, 06:33:00 PM
Here is a schematic for an H-bridge with logic to prevent any accidental 'smoke states'.
The OUT A and OUT B from the logic in the lower left connect to the INPUT A and INPUT B to the transistors.
Title: Re: Advise for circuit, and pcb layout
Post by: Jak24 on February 23, 2014, 02:05:14 PM
Here is a schematic for an H-bridge with logic to prevent any accidental 'smoke states'.
The OUT A and OUT B from the logic in the lower left connect to the INPUT A and INPUT B to the transistors.
added what you mentioned to the circuit, new schematic attached.
Is it an issue if its a pwm signal and not a digital out?
Lastly could you perhaps link where you got that circuit you attached?
Thanks
Title: Re: Advise for circuit, and pcb layout
Post by: waltr on February 23, 2014, 05:20:16 PM
I designed that circuit from scratch.
Study the truth table and work out the logic on paper to see how it works.
The circuit has two inputs, a direction and a PWM for speed (PWM is a digital signal).

I just saw that the resolution is pretty bad so the signal names are:
On the two inputs in the bottom left corner:
top input is: ENABLE which is what the PWM speed control signal goes to. A logic low turns the H-Bridge OFF.
Bottom inputs is: PHASE which controls the motor direction.

The top output of the logic is: OUT_A and the bottom output is OUT_B.
OUT_A feeds the left side of the H-bridge (INPUT A) into R1. OUT_B feeds the right side of the H-bridge (INPUT B) into R2.
Title: Re: Advise for circuit, and pcb layout
Post by: jwatte on February 24, 2014, 11:28:50 AM
An alternative is to use a half-bridge driver with cross-conduction prevention. As a bonus, it will drive N-channel MOSFETs even on the high side.
I like the IR2183, for example.