Test With Arduino
1 Preinstalled Cables
2 Prerequisites
Windows XP or later.
Arduino installation. It can be downloaded here.
01TM Supermodified Arduino library files. They can be downloaded here. After downloading the archive with the Supermodified Arduino library simply unzip it inside your Arduino libraries folder. This is usually C:/Program Files/Arduino/libraries.
3.1 Connections UART
The connections needed for UART operation are illustrated below:
Important Note: The Arduino must have the external power supply connected. Almost any motor can draw more than 500mA of current which is usually the USB maximum current.
3.2 Connections RS485
The connections needed for RS485 operation are illustrated below. An external RS485 transceiver is necessary in this case as can be seen on the schematic.
Important Note: The Arduino must have the external power supply connected. Almost any motor can draw more than 500mA of current which is usually the USB maximum current.
3.3 Connections I2C
The connections needed for I2C operation are illustrated below. Although the Arduino Wire library activates the MCU internal pull up resistors, it is recommended to connect two external ones of approx. 2KOhm each.
Important Note: The Arduino must have the external power supply connected. Almost any motor can draw more than 500mA of current which is usually the USB maximum current.
3.4 Connections legacy RC interface
The connections needed for legacy RC interface are illustrated below. Note that according to 01TM Supermodified firmware, standard PPM pulses can be interpreted in different manner, allowing e.g. for speed instead of position control. Also the angular range can be manipulated with different firmware. Please let us know your requirements and a custom firmware will be available as soon as you ask.
Important Note: The Arduino must have the external power supply connected. Almost any motor can draw more than 500mA of current which is usually the USB maximum current.
4 Testing with Arduino
After installing the library and making the necessary connections go ahead and try running the appropriate example.
From the Arduino menu go File > Examples > ZerooneSupermodified > test.
Compile and download the example. Then open the serial monitor and configure it at 57600 baud.
The motor now holds its position firmly. Type 3 and press enter. The motor moves with a velocity of 5000 ticks/sec. Type 4 and hit enter. The motor moves with a velocity of -5000 ticks/sec.
There are some strange characters on the serial monitor. They are the controller’s response to the command just received. Because they are in binary and not ASCII format they do not display correctly on Arduino’s serial monitor. You can monitor them on a terminal that displays bytes received from serial in hexadecimal representation.
The base unit for the 01TM Supermodified controller is the encoder tick. The MagEnc utilizes an absolute encoder that has 32768 ticks per revolution. So in order to instruct the controller to do a full turn you must tell the controller to move by 32768 ticks. All commands utilize the encoder tick as a base unit. Thus velocities are in ticks/sec and accelerations in ticks/sec2.
Testing with legacy RC-Interface: This is supported by the core Arduino library Servo.h
Â
5 Warnings and Errors
If you try to execute any command after that, it will fail with the same error code. This is because the Supermodified controller needs to be explicitly instructed to erase the error. There are many good reasons for this and some of them are related to safety.
So if you want to continue using the controller you must issue a RESET ERRORS command.
Hit 5 and enter and then 1 and enter and 3 and enter. You have now reset the error, started the controller and instructed the motor to move at 5000 ticks/sec.
Now disconnect the Rx and Tx wires and try hitting 2 and then enter.
The Arduino responds with Communication warning 105. Warnings with a code of 100+ are issued by Arduino itself. You can see what this means by referring to the library header file:
C:\Program Files\Arduino\libraries\ZerooneSupermodified\ ZerooneSupermodified.h
6 Arduino as an USB-UART or USB-RS485 bridge
With these connections you can use your Arduino board exactly as an USB<>UART / USB/RS485 bridge. Please refer to Testing with USB<>UART on how to easily send commands to the Supermodified controller.