domingo, 21 de abril de 2013

Arduino Motor Shield R3

I purchased an arduino motor shield to use it with the pirate4wd car chasis, but at the end I was able to design my own board (previous post) including atmega328p and L298 circuit. So just for justifying the money spent I wanted to try it, and here I show what came out of that test.

Firstsable I was a bit dissapointed with the board, with 6 output connectors I thought I could control lots of things, perhaps both dc motors and servos, but:

- outputs TWI IN and TWI OUT were unusable, as I had an Arduino UNO R2, and this board is designed  for Arduino UNO R3, which has a couple of extra connectors on each side. Two of them are SDA and SCL, used for TWI connectors. Apart from that, you can use it with Arduino UNO R2 without problems.

- outputs OUT 5 and OUT 6 (Orange ones), connected to two arduino digital pins, are powered with 5V from arduino, and I expected them to be powered from motor shield Vin, to separate motor power from arduino and avoiding unstabilities on Arduino. If don't know why you can read this excellent web. Anyway 5V from Arduino could be enough for small hobby servos..

That's the bad part, the rest went quite as expected. First thing was to cut Vin connect jumper that connects shield power and arduino power (just cut the small connection with a cutter or little screwdriver)

I could use the same code as with my homemade board, just changing inputs and pwm pins adequated to the motor shield pins and considering that IN2 is IN1 inverted if brake jumper is connected (and IN4 is IN3 inverted).

One interesting thing I found useful was the treatment of sense signals, with and opamp to set up the range [0-3.3V] (been 3.3V max current: 2A), and impedance to arduino ADC inputs.

I had some measurements to test the current drawn by the motors in several conditions

Car hold on air. There are two motors connected in parallel, so supposing half of the current for each, at the beginning it sources 450mA and after that it reduce to 300mA average

Car fixed, no movement (Stall current). Much more that on air as expected, motor 600mA per motor at the very first and 500mA after first spike. But 1200mA total, not reaching the 2A limit of L298 but justifying using one channel for two motors, other option coould be a couple of L293, one for each two motors as it has 600mA per channel, and a peak current of 1200mA (it can be interesting to test forcing one L293 for the two motors)

Car free running on floor. First spike simillar to stall current: 600mA per motor, but after that it decays to 250mA per motor. That first spike is on of the reasons why motor power should be separated from microcontroller supply.

Finally a photo of the car using the motor shield.

No hay comentarios:

Publicar un comentario