Arduino MKR (RS)485 error with Piezo Motor

I have a problem with my new project. The goal is to control my piezo motor with an Arduino MKR Wifi 1010 via RS485. For that reason I have these components:

Arduino MKR Wifi 1010 Arduino MKR 485 Shield Piezo Motordriver PM401 (Manual: https://piezomotor.com/wp-content/uploads/2019/03/150025_PMD401_Technical_Manual.pdf) Piezo LEGS motor

I tested the RS485 by using a USB adapter and the piezomotor software. That worked. But if it comes to code, I don't get any further.

The commands I want to send the piezodriver in ASCII Code is:
X1M2;
X1J200,0,100;

And I try to do it with this code:



#include <ArduinoRS485.h>

int counter = 0;

void setup() {
  RS485.begin(115200);
  Serial.begin(115200);
}

void loop() {
  RS485.beginTransmission();
  RS485.write('X1M2;');
  RS485.write(X1J200,0,100;);
  Serial.println(counter);
  RS485.endTransmission();
  counter ++;
  delay(2000);
}

It is more or less the example code for the RS485 libary.

My open questions are now. Do I need a adress? And if, how do I get it. Also is the Piezodriver Half or Full duplex? USB is Half, but the example code said it have to be Full Duplex.

Hope there are some tips out there :)



Read more here: https://stackoverflow.com/questions/65717053/arduino-mkr-rs485-error-with-piezo-motor

Content Attribution

This content was originally published by Apfelschnitzschneider at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: