High Power 18v15 and Speed

Hello,
I have purchased the High Power 18v15 motor contorller from your site (Item 755).
I am currently having an issue with the speed control.
I have the ground and (V+) power coming from the controller (Through a 5V Regulator) to an arduino Uno R3.
I have PWM at Pin A0 and Direction as Pin 4.
My issue is with the speed control.
Currently the motor will only turn if the cycle is between 150 and 255.
However, the speed does not change in between these values.
Any assistance would be greatly appreciated.

/****************************************************************************** 
Motor Testing With Pololu High Power Motor Driver 18v15
******************************************************************************/
//DC Motor
const int Direction = 4;		//Sets Motor Direction Pin to 4
const int Control = A0;			//Sets Motor Control Pin to A0
char user_input;				//Stores the Input of the User into the Serial Monitor
int x;							//Upward Movment Step Variable
int y;							//Downward Movement Setp Variable

//###############################################################
//############################ SETUP ############################
//###############################################################
void setup(){						//Setup Function
	Serial.begin(115200);			//Open Serial connection for debugging
	pinMode(Direction, OUTPUT);		//Initializes Direction Pin to Output
//Print function list
	Serial.println("1. Up");		//Prints User Selection 1 as Up in Serial Monitor
	Serial.println("2. Down");		//Prints User Selection 2 as Down in Serial Monitor
	Serial.println();				//Prints Blank Line
}

//###############################################################
//############################ LOOP #############################
//###############################################################
void loop(){						//Main Loop Function
	user_input = Serial.read();		//Read User Input and Enter Selected Mode
	if (user_input =='1'){			//Run Move Up Cycle
		MoveUp();}					//Goto Move Up Function
	 else if(user_input =='2'){		//Run Move Dowm Cycling
  		MoveDown();}				//Goto Move Down Function
}

//###############################################################
//########################## Upward #############################
//###############################################################
void MoveUp(){							//Upward Mode Function					
	Serial.println("Moving Upward");	//Print Moving Upward in Serial Monitor
	for(x= 1; x<100000; x++){				//Loop the Upward Motion
		digitalWrite(Direction,LOW);	//Sets Direction to Up
		analogWrite(Control, 255);}		//Motor Movement at PWM Duty Cycle
	Serial.println("Finished");			//Print Finished in Serial Monitor
	analogWrite(Control, 10);			//Stops Movement
	Serial.println("Enter New Option");	//Print Enter New Option in Serial Monitor
	Serial.println();					//Print Blank Line in Serial Monitor
}

//###############################################################
//########################## Downward ###########################
//###############################################################
void MoveDown(){						//Downward Mode Function
	Serial.println("Moving Downward");	//Print Moving Upward in Serial Monitor
	for(y= 1; y<100000; y++){				//Loop the Upward Motion
		digitalWrite(Direction,HIGH);	//Sets Direction to Down
		analogWrite(Control, 255);}		//Motor Movement at PWM Duty Cycle
	Serial.println("Finished");			//Ptint Finished in Serial Monitor
	analogWrite(Control, 10);			//Stops Movement
	Serial.println("Enter New Option");	//Print Enter New Option in Serial Monitor
	Serial.println();					//Print Blank Line in Serial Monito
}

Regards,
Ditch

Hi, Ditch.

The A0 pin on the Arduino Uno does not support PWM. As stated on the Arduino Uno’s overview page, pins 3,5,6,9,10, and 11 are the only pins that analogWrite can be used with.

-Claire

I just saw that in a forum post on the arduino website.
Sorry for wasting your time.

Thanks!

Working Code HERE:

/****************************************************************************** 
Motor Testing With Pololu High Power Motor Driver 18v15 and Arduino Uno
******************************************************************************/
//DC Motor
const int Direction = 4;		//Sets Motor Direction Pin to 4
const int Control = 9;			//Sets Motor Control Pin to 9
char user_input;			//Stores the Input of the User into the Serial Monitor
int x;						//Upward Movment Step Variable
int y;						//Downward Movement Setp Variable

//###############################################################
//############################ SETUP ############################
//###############################################################
void setup(){					//Setup Function
	Serial.begin(115200);			//Open Serial connection for debugging
	pinMode(Direction, OUTPUT);	//Initializes Direction Pin to Output
	pinMode(Control, OUTPUT);	//Initializes Direction Pin to Output
//Print function list
	Serial.println("1. Up");		//Prints User Selection 1 as Up in Serial Monitor
	Serial.println("2. Down");		//Prints User Selection 2 as Down in Serial Monitor
	Serial.println();				//Prints Blank Line
}

//###############################################################
//############################ LOOP #############################
//###############################################################
void loop(){					//Main Loop Function
	user_input = Serial.read();		//Read User Input and Enter Selected Mode
	if (user_input =='1'){			//Run Move Up Cycle
		MoveUp();}			//Goto Move Up Function
	 else if(user_input =='2'){		//Run Move Dowm Cycling
  		MoveDown();}		       //Goto Move Down Function
}

//###############################################################
//########################## Upward #############################
//###############################################################
void MoveUp(){						//Upward Mode Function
	digitalWrite(Direction,LOW);	        //Sets Direction to Up			
	Serial.println("Moving Upward");	        //Print Moving Upward in Serial Monitor
	for(x= 1; x<10000; x++){			//Loop the Upward Motion
		analogWrite(Control, 100);}	//Motor Movement at PWM Duty Cycle
	Serial.println("Finished");			//Print Finished in Serial Monitor
	analogWrite(Control, 0);			//Stops Movement
	Serial.println("Enter New Option");	//Print Enter New Option in Serial Monitor
	Serial.println();					//Print Blank Line in Serial Monitor
}

//###############################################################
//########################## Downward ###########################
//###############################################################
void MoveDown(){					//Downward Mode Function
	digitalWrite(Direction,HIGH);	        //Sets Direction to Down
	Serial.println("Moving Downward");	//Print Moving Upward in Serial Monitor
	for(y= 1; y<10000; y++){			//Loop the Upward Motion
		analogWrite(Control, 100);}	//Motor Movement at PWM Duty Cycle
	Serial.println("Finished");			//Print Finished in Serial Monitor
	analogWrite(Control, 0);			//Stops Movement
	Serial.println("Enter New Option");	//Print Enter New Option in Serial Monitor
	Serial.println();					//Print Blank Line in Serial Monitor
}

Glad that got it working. Thanks for posting your final code!

-Claire