Go Down

Topic: Advise for circuit, and pcb layout (Read 15942 times) previous topic - next topic

graynomad

#30
Feb 16, 2014, 11:56 pm Last Edit: Feb 17, 2014, 01:13 am by Graynomad Reason: 1
The schem is looking ok, no designators or chip types for the drivers though.

There are a few GND symbols with no dot where they are supposed to connected with the decoupling caps, technically that's not a connection so if you were relying on the rats nest when doing the layout that may be a problem.

No pullups on either of the I2C signals.

So tell me again why there are two Arduinos, is it just because the IR sensors cannot share the same I2C channel.

I'll look at the PCB soon.

EDIT:

Quote
However, wouldn't that cause a delay with the sensors response time?

None worth worrying about, there are several special I2C MUX chips around.

Quote
And also I am think of using the extra analog pins on the mini as I need more than 16 analog inputs.

Well that's a different story, once again there are ADC chips you can use. But no point talking about stuff that's a "maybe".


______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

graynomad

Re the PCB.

The holes for the Mega look too small, and how will you mount it, underneath your board?

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Jak24


The schem is looking ok, no designators or chip types for the drivers though.

There are a few GND symbols with no dot where they are supposed to connected with the decoupling caps, technically that's not a connection so if you were relying on the rats nest when doing the layout that may be a problem.

No pullups on either of the I2C signals.

So tell me again why there are two Arduinos, is it just because the IR sensors cannot share the same I2C channel.

I'll look at the PCB soon.

EDIT:

Quote
However, wouldn't that cause a delay with the sensors response time?

None worth worrying about, there are several special I2C MUX chips around.

Quote
And also I am think of using the extra analog pins on the mini as I need more than 16 analog inputs.

Well that's a different story, once again there are ADC chips you can use. But no point talking about stuff that's a "maybe".


______
Rob

I'll work on the things you mentioned, new one tomorrow.

Re the PCB.

The holes for the Mega look too small, and how will you mount it, underneath your board?

______
Rob

thanks for pointing that out, I will switch them for 1mm holes, also coming in new version .
I plan on mounting it on top on the board.
Aside that Is there anything else you would advise I use. Like any extra circuitry for safety/backup.?
Sorry for all the questions/  issues, I am still pretty new to electronics.

Thanks

CrossRoads

Why not go with SPI interfaced 8-channel 12-but ADCs?
http://www.digikey.com/product-detail/en/MCP3208-CI%2FP/MCP3208-CI%2FP-ND/305928
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

graynomad

Quote
I plan on mounting it on top on the board.

It will be upside down then, it that the plan?

Quote
any extra circuitry for safety/backup.?

What happens when you set both inputs to two drivers high at the same time? If that's a problem you should address that.


One question, why the optos, they don't really seem to do anything useful.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Jak24


Quote
I plan on mounting it on top on the board.

It will be upside down then, it that the plan?

Quote
any extra circuitry for safety/backup.?

What happens when you set both inputs to two drivers high at the same time? If that's a problem you should address that.


One question, why the optos, they don't really seem to do anything useful.

______
Rob


Yeah, I guess I didn't account for the both inputs thing, could you advise any chips/ circuitry that can solve that issue.
And I didn't choose the opto's , 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
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.

Why not go with SPI interfaced 8-channel 12-but ADCs?
http://www.digikey.com/product-detail/en/MCP3208-CI%2FP/MCP3208-CI%2FP-ND/305928


Yeah I guess I could do that too, but most importantly it's the I2C multiplexing that worries me, as I cant afford to have any delay
with the sensor readings
would something like this work:
http://dsscircuits.com/index.php/i2c-multiplexer ?

CrossRoads

SPI is very fast for interfacing with ADC, just takes 3 SPI.transfer()s at 2 MHz SPI clock (SPI divisor set to 8) to get a reading:
1/2,000,000 * 24 = 12uS

Say PORTD bit 2 was used for CS:
Code: [Select]

PORTD = PORTD & 0b11111011; // clear bit 2
dummyByte = SPI.transfer(upperCode); // send out command
upperByte = SPI.transfer(lowerCode); // send out address, read in upper 4 bits
lowerByte = SPI.transfer(0); // send out null data, read in lower 4 bits
PORTD = PORTD | 0b00000100; // set bit 2
int dataOut = (upperByte<<8) | lowerByte;  // maniputation will be similar, need to look what worked for me

12uS plus a couple of clock cycles for cs and the datac combining.

I can't open your other stuff (network issue here), so no comment on the rest.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Jak24


SPI is very fast for interfacing with ADC, just takes 3 SPI.transfer()s at 2 MHz SPI clock (SPI divisor set to 8) to get a reading:
1/2,000,000 * 24 = 12uS

Say PORTD bit 2 was used for CS:
Code: [Select]

PORTD = PORTD & 0b11111011; // clear bit 2
dummyByte = SPI.transfer(upperCode); // send out command
upperByte = SPI.transfer(lowerCode); // send out address, read in upper 4 bits
lowerByte = SPI.transfer(0); // send out null data, read in lower 4 bits
PORTD = PORTD | 0b00000100; // set bit 2
int dataOut = (upperByte<<8) | lowerByte;  // maniputation will be similar, need to look what worked for me

12uS plus a couple of clock cycles for cs and the datac combining.

I can't open your other stuff (network issue here), so no comment on the rest.

Thanks for the advise regarding the ADC multiplexing, however that is not as important right now for me, rather the I2C multiplexing.
Could advise a possible solution/chip?
Would some thing like this work:
http://dsscircuits.com/index.php/i2c-multiplexer
And most important of all, I need to figure about some sort of protection circuit for the motor driver

What happens when you set both inputs to two drivers high at the same time? If that's a problem you should address that.

If someone could advise some sort of circuitry with which this can be solved, It would be greatly appreciated.
Thanks

graynomad

The only fail-safe way to ensure both drivers are not on at the same time it to use a single Arduino output and an inverter. That way it's only possible to drive one at a time but you can never have both of them off at the same time.

To do that you can add two AND gates and drive them with another Arduino pin.

You still use two pins, but instead of left on/off and right on/off you have left/right and on/off.

I can draw a schematic if you can't follow my verbiage.

_______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Jak24

#39
Feb 23, 2014, 09:00 pm Last Edit: Feb 23, 2014, 09:05 pm by Jak24 Reason: 1

The only fail-safe way to ensure both drivers are not on at the same time it to use a single Arduino output and an inverter. That way it's only possible to drive one at a time but you can never have both of them off at the same time.

To do that you can add two AND gates and drive them with another Arduino pin.

You still use two pins, but instead of left on/off and right on/off you have left/right and on/off.

I can draw a schematic if you can't follow my verbiage.

_______
Rob

Yes, a circuit would be helpful.
However I did find another circuit, that can apparently prevent the "smoke state".
I added to my latest schematic, attached.
Any thoughts whether it would work or not?
Lastly you mentioned earlier that the opto's could be unnecessary, and you didn't bring it up again.
Should I keep them or toss them?
Any other advise is again much appreciated.

Edit: Never really mentioned it but, If you have a better idea/ solution for the motor controller circuit using a different IC,
please let me know, as the only reason I am sticking to the BTN7971B is I got them on a sale. And they - at the time- seemed to be
satisfactory.

graynomad

Close, but you have some of the inverters with nothing driving their inputs. The attached is what I had in mind.

One of your circuits (IC1D, IC4A, IC4B)  is correct.

Personally I would dump the optos, but I'm loath to suggest that as I gather you got this from a working circuit and there may be something involved I haven't realised.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

TomGeorge

Hi, just as a quick note, if in the end you do have gates and inverters in chips not used, the practice is to gnd their inputs, this way they will not oscillate on any signal that may capacitively get coupled to them.

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

Jak24

Hi!


Close, but you have some of the inverters with nothing driving their inputs. The attached is what I had in mind.

One of your circuits (IC1D, IC4A, IC4B)  is correct.

Personally I would dump the optos, but I'm loath to suggest that as I gather you got this from a working circuit and there may be something involved I haven't realised.

______
Rob


fixed

Hi, just as a quick note, if in the end you do have gates and inverters in chips not used, the practice is to gnd their inputs, this way they will not oscillate on any signal that may capacitively get coupled to them.

Tom.... :)

also fixed,
I attached a new version, I had to redo the whole board, as the layout wouldn't have worked.
I also got rid of all the 470uf and 0.47 uf caps and I plan on just adding 1 large 2500uf cap. Would this cause problems?
Also, should I put in any de-coupling caps? I heard that is a good idea.
Only a couple things I still didn't add, like lcd connector and battery connector, but besides that nothing that I noticed.
(Hopefully) final versions or board/ circuit attached.
Any other tips/advise is again much appreciated.

TomGeorge

Quote
I also got rid of all the 470uf and 0.47 uf caps and I plan on just adding 1 large 2500uF cap. Would this cause problems?
Also, should I put in any de-coupling caps? I heard that is a good idea.


In removing those caps you have removed the de-coupling and by-passing that was needed on such a  crowded board.

Do not use one large cap unless its for dc filtering, spreading the caps around the board, keeping them as close to the power supply pins of the IC's as possible.

Tom....... :)
Everything runs on smoke, let the smoke out, it stops running....

Jak24


Quote
I also got rid of all the 470uf and 0.47 uf caps and I plan on just adding 1 large 2500uF cap. Would this cause problems?
Also, should I put in any de-coupling caps? I heard that is a good idea.


In removing those caps you have removed the de-coupling and by-passing that was needed on such a  crowded board.

Do not use one large cap unless its for dc filtering, spreading the caps around the board, keeping them as close to the power supply pins of the IC's as possible.

Tom....... :)


Fixed.
I had a couple of other issue that I noticed, so I essentially reorganized the board.
I really hope there aren't many more issues, as I want to order this board as soon as I can.
However if there is any other thing you would recommend I add/change please advise.
And also I am not sure, will a 1.8mm trace be able to handle 5 Amps, should I be worried about that?
I double checked the overlapping, and I made sure everything is connected.
As always advise is much appreciated.

Go Up