Jump to content

Serial Servo Controller communication problem


ikd

Recommended Posts

Hello,<br /><br />I am trying to implement simple control of a Pololu serial controller: <a href="http://www.pololu.com/catalog/product/727/resources" target="_blank">http://www.pololu.com/catalog/product/727/resources</a><br /><br />There are two commands that I am interested in:<br />1. Set speed is achieved by sending a sequence of 5 bytes: 0x80 0x01 0x01 0x00 speed_byte<br />2. Set absolute position is achieved by sending the following sequence: 0x80 0x01 0x04 0x00 pos_byte1 pos_byte2<br /><br />For example speed_byte = 0x10, pos_byte1 = 0x10, pos_byte2 = 0x00.<br /><br />I have attached a sreenshot of my VI.<br /><br />The problem is with first byte sequence write (setting velocity). It fails, but then the second command is executed well (with default speed parameter).<br />When I try to run only the set absolute position command (right after setting properties of port) it also fails. Looks like some portions of the sequence are corrupted.<br /><br />I am using the latest version of NI VISA.<br /><br />Could anyone give a clue of what is happening?<br /><br />

post-13686-1224579241.png?width=400

<b>Upd: I have tried to used a serial port debugger, and checked that two programs (Pololu serial transmitter which works correctly and my program) give exactly the same output to the COM-port.<b />

Link to comment

QUOTE (ikd @ Oct 21 2008, 10:59 AM)

...The problem is with first byte sequence write (setting velocity). It fails, but then the second command is executed well (with default speed parameter).

When I try to run only the set absolute position command (right after setting properties of port) it also fails...

Sounds like a timing issue.

Try to put a msWait node after you have configured the serial port, i.e. don't send your commands directly after the config.

/J

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.