Welcome, Guest
Messages posted to this category need to be reviewed by the moderator before it gets posted.

TOPIC: Smart Motor with Arduino, can't receive reports

Smart Motor with Arduino, can't receive reports 6 years 4 months ago #662

I am working on a research project, and haven't had any significant problems with getting an Arduino to talk to a Smart Motor over RS232, but I can't get reports back. When I send a request for a report, all I get back is gibberish. I'm not really sure what is going on.

Do I need to send a "PRINT(RP)", or can I just send "RP"? I get something back for each one, but they don't make sense. What should the information I get back look like?

Also, the gibberish doesn't seem consistent, and it seems like if it was a translation problem it should be. For example, if I send "RA" to the motor, I don't always get the same nonsense back. Here are some real examples:


RA
Sent
Status:


RA
Sent
Status:
ƒ‚jþ

RA
Sent
Status:
Áƒjþ

RA
Sent
Status:
‚®ø

RA
Sent
Status:


RA
Sent
Status:
‚®ø

RA
Sent
Status:


So, I can control it just fine, but I can't get the motor's status back in a way that makes sense. Any ideas?
The administrator has disabled public write access.

Re: Smart Motor with Arduino, can't receive reports 6 years 4 months ago #664

  • csearcy
  • csearcy's Avatar
  • OFFLINE
  • Moderator
  • Posts: 459
  • Thank you received: 77
  • Karma: 23
The response to an RA command may change... depending on commands sent to the motor.
It would be best to monitor the RS232 communications to determine the problem.

Try using the Serial Data Analyzer in the SMI2 software. It will show all printable and non-printable characters. You may need to use a null modem cable.
Last Edit: 6 years 4 months ago by csearcy.
The administrator has disabled public write access.

Re: Smart Motor with Arduino, can't receive reports 6 years 4 months ago #665

The list that I posted is a complete list of the commands being sent. There were no commands sent between them, and so no way that the acceleration was changed between the different report requests. And they were all sent within seconds of each other. (I am basically using the Arduino as a serial bridge until I can get it working well enough to work on its own.)

I'll try and find a computer that I can use the software on, but computers with RS232 are becoming hard to find.
Last Edit: 6 years 4 months ago by Fredjikrang.
The administrator has disabled public write access.

Re: Smart Motor with Arduino, can't receive reports 6 years 4 months ago #667

Well, I've spent the last few hours working on this, and I still don't know what is going on.

I tried to connect the motor to the computer, but I can't get it to recognize the motor at all. I tried with two different motors without luck. I also tried through a normal serial port, and a USB to serial converter, and on two different computers. Could this depend on the model of motor? I downloaded the latest version of SMI, but the motors that I am using are older (SM2340SQ and SM1720). Do I need to download a different version of SMI?

I also connected my Arduino to the USB to serial converter to confirm that the converter works, and I am able to send messages from one computer, through the Arduino, through the USB converter, to the SMI sniffer on a different computer, but messages sent with the SMI program don't arrive at the other computer. I'm not sure what exactly is going on with this part.

Also, I noticed some unusual behavior. In the sniffer, the commands that I send out from SMI are normal ASCII decimal, but the ones that it receives from the Arduino look like the are in Hex. Is this normal? From my understanding, the Arduino sends ASCII decimal standard.

Also, I have a spare character that I can't account for, "0A", that gets sent after each new line. It looks like this is a "line feed" character. It doesn't seem to affect anything though, as the motor responds as expected when commands are sent to it.

Any ideas?
The administrator has disabled public write access.

Re: Smart Motor with Arduino, can't receive reports 6 years 4 months ago #668

  • csearcy
  • csearcy's Avatar
  • OFFLINE
  • Moderator
  • Posts: 459
  • Thank you received: 77
  • Karma: 23
The 0A is an ASCII Linefeed. That isn't a valid delimeter for the SmartMotor. The only allowed delimeters are a CR (0x0D) or a SPACE (0x20).
Last Edit: 6 years 4 months ago by csearcy.
The administrator has disabled public write access.

Re: Smart Motor with Arduino, can't receive reports 6 years 4 months ago #670

Okay, I'll try and delimit the commands with spaces or only CR, and see if that fixes the strange receive behavior.

Any ideas on why the SMI couldn't find the motor?
The administrator has disabled public write access.
Time to create page: 0.273 seconds
Powered by Kunena Forum