Hello,
I’m having issues with my Motoron M3S550: the motors are not moving, even though the connections appear to be correct and the device is detected on the I²C bus.
Hardware and Connections:**
- Base Board:
- I tested with two boards: Arduino Uno R4 WiFi and Arduino Uno R3. The results were the same on both.
- Motoron: M3S550 connected to:
- SDA (A4) and SCL (A5) on the Arduino Uno R3.
- SDA (Pin 20) and SCL (Pin 21) on the Arduino Uno R4 WiFi.
- Motoron Power Supply:
- VIN: 12V from an external power source.
- GND: Shared between the external power supply, the Motoron, and the Arduino.
- Motor: A DC motor connected to terminals M1A and M1B.
- The Motoron’s power LED is on, and there are no visible error indicators.
Diagnostics:
- The Motoron is detected on the I²C bus at address 0x10:
- I used an I²C scanner and confirmed that the device responds at the correct address.
- The program enters the
loop
cycle correctly:
- I can see the messages
"FORWARD"
and"STOP"
in the Serial Monitor, so it seems like the code is executing as expected.
Code Used:
Here’s the latest program I tested:
cpp
Copiar código
#include <Motoron.h>
#include <Wire.h>
// Initialize Motoron controller at I2C address 0x10
MotoronI2C mc(0x10);
void setup()
{
Serial.begin(9600);
Wire.begin();
Serial.println("Scanning I2C bus...");
// Scan I2C bus for devices
bool deviceFound = false;
for (byte address = 1; address < 127; ++address)
{
Wire.beginTransmission(address);
if (Wire.endTransmission() == 0)
{
Serial.print("Device found at address: 0x");
Serial.println(address, HEX);
if (address == 0x10)
{
deviceFound = true; // Motoron detected at the correct address
}
}
}
if (!deviceFound)
{
Serial.println("Motoron not detected at address 0x10. Check connections.");
while (1); // Stop the program if Motoron is not detected
}
else
{
Serial.println("Motoron detected. Starting configuration...");
}
// Reset the Motoron and configure motor 1
mc.reinitialize();
mc.disableCrc();
mc.disableCommandTimeout(); // Disable command timeout
mc.clearResetFlag(); // Clear reset flag to avoid errors
// Configure acceleration and deceleration for motor 1
mc.setMaxAcceleration(1, 255);
mc.setMaxDeceleration(1, 255);
Serial.println("Configuration completed. Moving motor...");
}
void loop()
{
// Move motor 1 forward
mc.setSpeed(1, 500); // Positive speed
delay(2000); // Wait for 2 seconds
// Stop the motor
mc.setSpeed(1, 0); // Zero speed (motor stopped)
delay(2000); // Wait for 2 seconds before repeating
}
What doesn’t work:
- Even though the code seems to run correctly and the Motoron is detected, the motors do not move.
What I’ve tried:
- I double-checked all physical connections and confirmed they are correct.
- I tested the DC motor directly with the power supply, and it works.
- I tested with both an Arduino Uno R4 WiFi and an Arduino Uno R3, with the same result.
- I used
mc.getErrorMask()
to check for errors, but I did not get any non-zero values.
I’d appreciate any help diagnosing and resolving this issue. Are there additional steps I should try or something I might be overlooking?
Thank you in advance!