Go Down

Topic: The motor runs at half the speed (Read 5080 times) previous topic - next topic


Now I understand the output drop after cascading in the darlington scheme, I know what you are talking about.

Yes a MOSFET H bridge would give me (almost?) 100% of power.

I'm not using the diodes as these motors are really "weak" and don't spike, but I will consider it.


Use diodes.  The motors might behave on light load and act resistive, but once
the brushes wear and spark and the motor is under stall conditions things may
be different - diodes are cheap.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


To post an attachment, use the "Additioanal Options " button below and then select the file.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter


Well, I am posting my dualmotordriver.ino file.

It has comments in Spanish but the code is simple, you will understand it. Feel free to ask any question.



There is a lot of code there and I haven't reviewed it in detail, but the logic to derive the PWM value passed to analogWrite() is complex and could easily be producing a value you don't expect.

To start with, I suggest you create a test sketch that does nothing but run the motor(s) at full speed and confirm the hardware is working correctly. Once you've done that, add some debug print statements to show what values you're actually passing to analogWrite() in your real sketch - I suspect you'll find they're wrong, pointing to bugs in your calibration logic.


I understand your guidelines, but, I added Serial.print lines after analogWrite, and the value that I send to the enable pin (in the L293) is 255, now, shouldn't that value make the motors run at full speed? I know there is a 1.5V drop in the L293, but I measured the voltage and it's 5V from a 7.5V battery, so the voltage drop is 2V!

AND the LEDS that I wired in parallel with those outputs bright dimly, so I guess 255 is not producing a 100% duty cycle. If I had an oscilloscope...


Where is the battery connected and where did you measure the voltage ? Also, what kind of battery ? (7.5V is an odd number (5) so it doesn't suggest 1.5V batteries. Is it a 2S lipo ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter


Sorry guys, I am the only one to blame: it is true that there is a voltage drop but the situation was aggravated by the battery's low charge.

I replaced it with another fully charged li-po and the motors now run fine, though a little slower than when directly connected to the batt.


Go Up