Hi guys--
We're having some issues with controlling the speed of our motor using a Critical Velocity Motor Controller.
Parts:
- Arduino duemilanove
- Critical Velocity Motor Controller - 5.5-36V and 15A
- A PMDC 36V, 12.8A motor (350W)
The manual for the controllers say that in order to control the motor speed, we can just pulse the Up and Down lines on the controller:
http://www.robotshop.ca/content/PDF/datasheet-SPD-2115B-EDS.pdfBut by using this code, we can't achieve that. The motor either runs at full speed or at zero speed when the up and down lines are pulsed respectively.
Code:
int RUp = 3; //Right Motor Speed Up
int RDown = 5; //Right Motor Speed Down
int REnable = 7; //Right Motor Disable
void setup()
{
pinMode(REnable, OUTPUT); // sets the digital pin as output
pinMode(RUp, OUTPUT); // sets the digital pin as output
pinMode(RDown, OUTPUT); // sets the digital pin as output
digitalWrite(REnable, HIGH); // Raise Right Motor speed by 0.4%
analogWrite(RUp,10);
}
void loop()
{
}
So at this point, we have no control of the motor speed. It either goes max speed or zero speed with this code.
I think the frequency of the Arduino is too high for the controller. The controller is at about 200Hz. And the Arduino at about ~400Hz. So the arduino is sending pulses so many times that the controller just ends up running the motor at max speed and at min speed.
How can we change the frequency the arduino outputs at? Can someone help please?
Thanks.