Australia
Asked
Resolved Resolved by DJ Sures!

Motor Controller

Do you know if ARC is compatible with a RoboClaw 2x30A Motor Controller? - see link: https://www.basicmicro.com/RoboClaw-2x30A-Motor-Controller_p_9.html



Related Hardware (view all EZB hardware)
EZ-B Iotiny by EZ-Robot
Control IoTiny with Synthiam ARC: 100MHz Cortex‑M4 Wi‑Fi IoT/robot controller-camera, servos, ADC, I2C and digital I/O for easy internet automation
Wi-Fi / USB
Servos 8
Camera
Audio
UART
I2C
ADC
Digital

ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

Author Avatar
PRO
USA
#17   — Edited

@DJ Can you take look to the outputs:

User-inserted image

Based on @Afcorson input:

Quote:

Motor 1 Reverse should be set as 1. Stop should be set as 64. Forward should be set as 127.

Motor 2 Reverse should be set as 128. Stop should be set as 192. Forward should be set as 255.

Sabertooth manual:

User-inserted image

At full speed:

User-inserted image

Forward should be 0x7F, 0xFF Right should be 0x7F, 0x80 Backward should be 0x01, 0x80 Left should be 0x01, 0xFF

The control output is slight off in some cases, if the values are not proportional a 2 wheel robot may turn more to one of the sides.

Author Avatar
PRO
Synthiam
#18  

Looks like I’m mapping to those values...


public void Forward(byte leftSpeed, byte rightSpeed) {

      leftSpeed = (byte)Functions.RemapScalar(leftSpeed, 0, 255, 64, 127);
      rightSpeed = (byte)Functions.RemapScalar(leftSpeed, 0, 255, 192, 255);

      sendData(new byte[] { leftSpeed, rightSpeed });
    }

    ///  
    ///  Move reverse.
    /// 
    public void Reverse(byte leftSpeed, byte rightSpeed) {

      leftSpeed = (byte)Functions.RemapScalar(leftSpeed, 0, 255, 64, 1);
      rightSpeed = (byte)Functions.RemapScalar(leftSpeed, 0, 255, 192, 128);

      sendData(new byte[] { leftSpeed, rightSpeed });
    }

    ///  
    ///  Right.
    /// 
    public void Right(byte leftSpeed, byte rightSpeed) {

      leftSpeed = (byte)Functions.RemapScalar(leftSpeed, 0, 255, 64, 127);
      rightSpeed = (byte)Functions.RemapScalar(leftSpeed, 0, 255, 192, 128);

      sendData(new byte[] { leftSpeed, rightSpeed });
    }

    ///  
    ///  Left.
    /// 
    public void Left(byte leftSpeed, byte rightSpeed) {

      leftSpeed = (byte)Functions.RemapScalar(leftSpeed, 0, 255, 64, 1);
      rightSpeed = (byte)Functions.RemapScalar(leftSpeed, 0, 255, 192, 255);

      sendData(new byte[] { leftSpeed, rightSpeed });
    }
Author Avatar
PRO
Australia
#20  

One more query. As soon as I disconnect the USB connection from the Roboclaw to my laptop, nothing works. Somehow I need to enable TTL serial mode as I don't want to be tethered to a laptop to use it. I seem to be missing something here, as I can't find a setting to get it working without the USB connection.

Author Avatar
PRO
USA
#22  

@afcorson: Keep the usb disconnected. I presume you have the main power source connected, do you see any lights on ?  Can you measure the voltage between the (+) and (-) ?

Author Avatar
PRO
Australia
#23  

Stat2 light is green indicating both motors are active. Voltage is 24.8 to the main battery connection. I'll install the ver3 plugin and see what happens.

Author Avatar
PRO
USA
#24   — Edited

Measure the voltage between + and - near the S5 contact. The idea is to troubleshoot if the controller DC/DC is still operational, you need to have 5v on those pins. be careful when using the multi-meter probes to avoid a short circuit while trying to measure.

My guess is: When you connected the S1 (+)  and (-) to the EZB you short-circuit the DC/DC output voltage with EZB Vin, sometimes is enough to damage the 5v regulator. The reason why it works with an USB cable is because the controller has a switching circuit to switch between the USB power (when you are configuring the controller) and the controller 5v regulator, in absence of DC/DC the switching circuit uses the USB voltage.