Using Arduino to send commands to Ultra3000

Hello everyone,

Has anyone had experience with using an Arduino microcontroller (or similar) to send commands to the Allen Bradley Ultra3000 servo controller? I currently am just trying to get the servomotor to move, nothing fancy, and it isn’t. This is the basic idea of the code that I have:

// Sets basic commands

void enableDrive(){
Serial1.print(":0006B10166");
}

void disableDrive(){
Serial1.print(":0006B10167");
}

void enableVelocityControl() {
Serial1.print(":0006110177");
}

void setForward() {
Serial1.print(":000AB1005C");
}

void stopTrack() {
Serial1.print(":0006D100000000");
}

 

// Defines constants
char* velocity[]={
":0006D100142404", ":0006D100284808", ":0006D1003C6C0C", ":0006D100509010", ":0006D10064B414"};
int delayTime = 5000;

 

// Runs treadmill
void setup() {
Serial1.begin(38400);

enableVelocityControl();

setForward();
stopTrack();
enableDrive();
delayMicroseconds(delayTime);

int i;
for (i = 0; i < 10; i++)
{
Serial1.print(velocity[i]);
delayMicroseconds(delayTime);
}

disableDrive();
Serial1.end();
}

Any words of advice would be much appreciated.

Best Regards,

Lisa

I've not used that device, however from page 1-1 of the manual at http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/2098-rm003_-en-p.pdf I think you need to add \r at the end of the command strings you are sending.

Hm, yes, that would seem to be one vital aspect that I've left out. I'm not in the lab to test it out today, but I'll give it a try the next time I am. Thank you!

It seems that the addition of the carriage return did not help. With the Serial Window open, the commands print out exactly as expected, so I'm a bit stumped. Any other thoughts on why this may not be working?

How do you have the Arduino connected to the controller? If the controller has a true RS232 interface then you’ll need to convert the 5v Arduino signal levels to RS232 signal levels.

I'm using an RS232 shield provided by CuteDigi: http://www.cutedigi.com/product_info.php?products_id=4329

Are you using a straight through RS232 cable or a crossover (null modem) cable? Maybe you need the other sort?

I am using a straight through RS232 cable provided by the Ultra3000 manufacturer. It works when being sent the same commands by a PBASIC controller, so I wonder if there is some inherent property of Serial in Arduino that I might be missing?

I suggest you disconnect the cable and measure the voltage on pin 2 and on 3 of the RS232 connector on the the Arduino with respect to ground (pin 5). Then do the same for the PBASIC controller. One of pins 2 and 3 will show around 10v, the other will show 0v. If the pin with 10v is different between the Arduino and the PBASIC controller, then you need a different cable.

The difference arises because RS232 ports can be designed as either DCE or DTE, and for a device other than a modem or a terminal, there is no standardisation on which choice is made.