I am trying to use an Arduino Duemilnouve (Atmega 328) to control two large wheelchair motors (24v, 25A?), running concurrently from one signal (not differential drive), with a pair of SyRen 25 motor controllers. I understand from previous threads that I am limited to simplified serial communication mode, since the Arduino lacks a genuine (non PWM) analog output.
I wrote a sketch for simplified serial mode to try to produce values the SyRen is looking for. Dimension Engr says “Commands are sent as single bytes. Sending a value of 0 will cause the motor to drive full forward and sending a value of 255 will cause the motor to drive reverse.. A value of 127 will cause the motor to stop.”
So here is the sketch I tried. It compiles and uploads without errors:
int motorPin = 5;
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
pinMode(motorPin, OUTPUT);
}
void loop() {
digitalWrite(motorPin, 127); // set motor to stop
delay(10000);
digitalWrite(motorPin, 65); // set motor to 1/2 throttle forward
delay(10000);
digitalWrite(motorPin, 0); // set motor to full throttle forward
delay(10000);
digitalWrite(motorPin, 65); // set motor to half throttle forward
delay(10000);
digitalWrite(motorPin, 127); // set motor to stop
delay(10000);
digitalWrite(motorPin, 190); // set motor to half throttle reverse
delay(10000);
}
The result is that the motor (I'm testing with one motor running off one 35AH 12V battery) will start and run at full speed CW after a delay of about 22 seconds. If I decrease the delay period in the sketch, say from 10000 to 3000, the motor starts up after about 7 seconds. I presently have no other control over the motor. Dip switch on the SyRen is set according to manual. I have tried Arduino pins 1, 4 and 5; all with the same results.
I also tried running the the controller in R/C Input mode, where the controller is looking for pulses of 1000 mil Sec (Full Reverse), 1500 mil Sec (stop) or 2000 mil Sec (Full Forward), with this script:
int motorPin = 4;
void setup() {
pinMode(motorPin, OUTPUT);
}
void loop() {
digitalWrite(motorPin, HIGH ); // set motor to full reverse
delay(1000);
}
Result: no movement of motor.
As a newbie, I am beginning to realize that there are issues/problems that are presently beyond me. The conspicuous lack of projects combining Arduino boards with battlebots reinforces that feeling.
I am now at a dead end. If anyone can provide any advice on how to proceed (besides converting to the Basic Stamp II controller SyRen provides support for) I would be very grateful..
Rick :-/