Quantcast
Channel: Motion Control and Motor Drives topics
Viewing all articles
Browse latest Browse all 1315

My motor receives data via a serial connection, but it won't move. What am I doing wrong?

$
0
0

Hello everyone,

 

as the title says, I am trying to use a motor called "MP285" by Sutter Instruments via LabView. The control unit of this motor only has a RS232-output, but I use a Serial-to-Usb-Adapter to connect the device to the PC.

 

My problem is the following:

I tried to perform a basic Input/Output test by using the Ni MAX an sending ASCII strings to the control unit (after configuring it according to the reference manual), which worked fine. I also used the "jabber"-function of the control unit to send an output string to the PC and was also able to read that string from the buffer. Besides, when I used a LabView-VI to send a command via VISA Write, it also appears on the display of the control (at least the ASCII letters).

 Accordingly, I assume that the Serial-to-USB-adapter does work. Is that for sure, or can the adapter evoke any other problems?

 

However, when I try to use the shipped controlling software, the motor won't work. Furthermore, I contacted the customer support and they sent me some VIs and a LabView-Project, which was tested by the company. Unfortunately, it did not work for me. The motor wouldn't move, when I sent the command, although the LabView-interface indicates that there the connection between PC and controller has been established. As the program has many features and I only need a command to move the motor, read the position and set the origin, I tried to build my own VI. I had a look at some basic VIs for motor control and referred to the manual.

 

As it seems, the controller uses data streams of full bytes (8 bits, not ASCII) in Big Endian for its strings (I copied the information at the bottom of this text). Thus, I tried to concatenate particular strings to send it via VISA in the correct form (see attached). Do I have to convert the "m" into hexadecimal explcitly? I looked up "Convert ASCII to Hexadecimal", but when I try this, the output string does not change.

However, when I send this string to the controller in normal mode, nothing happens . When I activate the Input/Ouput test (see above), there is a m displayed on the controller unit. So I guess, I am messing up the command structure. Can anybody help me please?

 

Kind regards

 

 

PS: Sorry for cleaning up the diagramm..

 

PPS: For some reason, I could not attach the VI because " The contents of the attachment doesn't match its file type". So, I changed the name in "-vi" instead of ".vi" as suggested by a forum user. Hope this works for you!

 

 

Excerpt form the reference manual:

General Information:

"Command requests are single bytes followed by optional parameters and terminated by a
carriage return (CR, 0Dh). The data stream consists of full bytes (all 8 bits — not ASCII.
The lowest order byte (for example, of the four bytes encoding the X coordinate) is the first
into the controller and is the first out. The default Baud rate is 9600. Commands are
processed bytewise by interrupt and executed only after the terminating CR is received.
There are no delimiters within command strings. The controller will reply with carriage
return (CR, 0Dh) at the completion of normal command processing."

 

Command structure:

 

Get Current Position      command ‘c’CR 063h + 0Dh
                                           returns xxxxyyyyzzzzCR three signed long (32-bit) integers + 0Dh

 

Go To Position                 command ‘m’xxxxyyyyzzzzCR 06Dh + three signed long (32-bit) integers + 0Dh    
                                            returns CR 0Dh

 

 

Setting up for Serial Communication:

 

First, use the 9-pin serial port cable provided with the MP-285 to connect the “serial port” of
your computer to that of the MP-285 controller. Next configure your terminal emulator (e.g.,
HyperTerminal in Microsoft Windows (9X and above) to the following settings (or their
equivalent):
• TTY mode
• Echo typed characters locally only (do not echo input to the computer serial port back to
the controller)
• Baud rate to 9600
• 8 data bits, no parity, 1 stop bit
• COM port - set to the port to which you have connected the MP-285 controller

 

"


Viewing all articles
Browse latest Browse all 1315

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>