Welcome, Guest

TOPIC: Arduino Controlling Smart Motor

Arduino Controlling Smart Motor 6 years 6 months ago #454

  • Tetsuya
  • Tetsuya's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
Hello,
I have a question though about controlling Animatics Smart Motors.

I normally use SMI program's macro function to send:
"
MP
A=10
V=180384
D=-40320000
G
"
Now I'm trying to use an Arduino board to send the same command so I can eliminate the need for the computer.

Setup is:
I'm sending simple ascii commands on the P4 RS232 board from moderndevice.com to a single smart motor with no program currently loaded on the motor.

Problem:
In the smart motor program I can see in the serial analyzer HEX view that it sends an 80 immediately one time before it sends the rest of my ascii commands.
I think that the 80 is to address the motor or tell it to listen to the following commands. (I see CH0,N,8,1 at the top of the terminal).
When sending commands from the terminal in the smart motor program it does not have the 0A or 0D line feed/Carriage return which shows up in HEX view when I hook up my arduino to the computer.

I'm not sure if I have an issue with slave/host modes in RS232.


My code I'm sending is:

void prerun(){
digitalWrite(5, HIGH);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
Serial.println("0ECHO_OFF");
Serial.println("0SADDR1");
Serial.println("1ECHO");
Serial.println("1SLEEP");
Serial.println("0SADDR2");
Serial.println("2ECHO");
Serial.println("2SLEEP");
Serial.println("0SADRR3");
Serial.println("3ECHO");
Serial.println("0WAKE");
Serial.println("MP ");
Serial.println("A=30 ");
Serial.println("V=330000 ");
Serial.println("D=-6000000 ");
Serial.println("G ");
changeTime = millis();

delay(300000);{
mainrun();
}
}
It looks the same as the macros I typically send with SMI when viewed in an ascii terminal like PUTTY
Thanks for any advice

At the moment the motor shows no response at all.

I can send a screenshot of the output if needed.
Last Edit: 6 years 6 months ago by Tetsuya.
The administrator has disabled public write access.

Re: Arduino Controlling Smart Motor 6 years 6 months ago #456

  • Tetsuya
  • Tetsuya's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
I have found the problem and everything is functioning properly now.
there was difference in wiring callouts between the motor and serial board.
The administrator has disabled public write access.
Moderators: hsummer, csearcy, swalters, mmeyers
Time to create page: 0.222 seconds
Powered by Kunena Forum