I am using the Industruino to read some analog output 0-10v from an industrial kuka robot. I am trying to use the Industruino to communicate with the motor control board from OdriveRobotics that has a library for use with arduino through serial communication (https://github.com/madcowswe/ODrive/tree/master/Arduino/ODriveArduino) . Unfortunatly it uses the SoftwareSerial library which I saw in a previous post on this forum is not supported by Industruino. I wonder if there is a way to use hardwareserial from Industruino to communicate with the Odrive board (by modifying the library or ino file for serial initializing)?
Thanks in advance for your help,
The library is actually not specifically written for SoftwareSerial, but the example is.
You can modify it as follows:
- comment out line 2 (#include ss)
- comment out line 10 (initialise ss)
- find/replace 'Serial' with 'SerialUSB' (case sensitive -- to use Serial Monitor with Industruino)
- add a line before line 15: #define odrive_serial Serial1
Now the library will use the hardware 'Serial1' which is available on D10/D5
If you prefer to use 'Serial' on D0/D1 then you need to disconnect it from the RS485 port by moving the switch on the baseboard away from the RS485 terminals.
With the above modifications, the library example compiles, please let me know if it works.
Thank you for your answer. Your suggestions worked to be able to upload the sketch on the Industruino and get the serial monitor to work.
However I did not manage to control the motor, Ive had the problem before with a regular arduino which was solved by connecting the Odrive ground to the arduino ground. I did that on the Industruino by connecting the ISO2 pin ground from the IDC to the Odrive GND but the problem remains. Somehow the serial communication between the Industruino and the Odrive is not happening (made sure to connect D10 to Odrive TX and D5 to Odrive RX). Do I have to connect a 24V power supply to the Industruino to be able to use the Serial communication? So far I have only connected the Odrive by USB to the computer.
I will do more testing on my side to try to narrow down the issue.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!