I have been trying to control a motor (https://www.sparkfun.com/products/13302) with the Ardumoto, Snowbord and a Spectrum RC DX6i with an AR410 receiver. When I run the code https://github.com/InventerBots/Arduino the values calculated are correct, but the motor runs in a very unpredictable manner. I don’t have much experience with arduion programming so any help would be appreciated.
Hello Coding in 3D,
Can you try writing a simple sketch that increases the motor speed and then decreases it? This will help us figure out if it is Arduino code or the Ardumoto Shield.
TS-Brandon:
Hello Coding in 3D,Can you try writing a simple sketch that increases the motor speed and then decreases it? This will help us figure out if it is Arduino code or the Ardumoto Shield.
I wrote a test program that increments the motor power by 4 every 100 milliseconds, but the motor speed does not ramp linearly. The motor starts to turn fairly fast at 45 and ramps down fairly linearly until about 210 when it stops, but still has power then It jumps to full power at 250.
Just tried changing the increment value to 2 and delay to 250 and it seems to work.
EDIT: if the delay is 250, it works but if its 500 it does not
Is there a “refresh rate” on the ardumoto?
The Ardumoto uses a common L298 H-Bridge IC, which is a simple motor controller. There’s no refresh rate. The largest reason for this behavior would likely be the motor or how the Arduino PWM behaves. If you want to look more into PWM on the Arduino, you can find it [here.
Out of curiosity are you using 3.3V or 5V? You would choose this with the jumper on the bottom of the board (see below photo). It is 5V by default.
](https://www.arduino.cc/en/tutorial/PWM)I am using 5v