0
\$\begingroup\$

This is a follow from my previous question about the Sabertooth 2X12 motor controller.

I aim to control DaNi Robot’s motor using the sabretooth 2X12 controller. After reading the datasheet, a few methods were attempted : PWM and UART. This did not work; therefore, a new sabretooth controller was used just in case it the previous one was faulty.

Attempt#: 1- PWM was connected to a RC filter going into sabretooth(as shown in the datasheet). This did not work. 2- PWM was inserted straight into the sabretooth. This results in uncontrolled movement of the DC motors. 3- 1 byte-serial protocol method was attempted. Numbers specified from the datasheet were written into UART.Tx pin of the microcontroller. This again resulted in uncontrolled behaviour of the DC motor. (This method does not require any delays on the pin.) According to the datasheet the PWM frequency of over 1kHz was required. PWM of frequencies of 2kHz all the way up to the 10khz attempted and checked on the oscilloscope. The DC power supply and PWM were both checked on the oscilloscope.

Firstly, I tried the sabretooth controller which was already fitted inside the Dani Robot. I speculated it might have been broken/faulty so another one was tried. That did not work.

The datasheet tells us to filter the PWM with a RC filter and then input it to the sabretooth. But that did not work either. The motors seem to be operating but is uncontrolled. For example, sometimes it starts running very fast and then stops while others times it does not even start.

RC filter values I used were: 10kohms resistor + 1uF capacitor.

Can you please give advice as to how the DC motors can be controlled?

Datasheet: https://www.dimensionengineering.com/datasheets/Sabertooth2x12.pdf

Connections images: https://i.stack.imgur.com/wAG9v.jpg

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

This does not seem right. I have given you precise instructions on the old question for PWM, UART and analog control with potentiometer. All three methods work perfectly with these controllers. Using RC filter is the worth possible option and I did not recommend it, although it should work too.

So, the problem must be somewhere in either a) wiring, b) configuration, or c) programming.

Let's start with simplest - potentiometer. Connect 5-10k potentiometer ends to terminals 0V and 5V, connect wiper to S1 (see figure 2.1 in datasheet). Configure DIP as shown on picture "Switch 4: Mixed or independent":

1,2 - UP for analog control;
3 - UP for no auto cut-off;
4 - DOWN for independent mode;
5 - UP for linear response;
6 - UP for 0-5V input range;

You should be able to control motor 1 now. Please, try this and if it works you can try other methods.

Method 2 - PWM. Connect MCU ground to 0V terminal, connect PWM output pin to S1 input (see figure 5.1). You can also use 5V terminal to power up your MCU, if you wish. Or use separate power supply for MCU and do not connect 5V. Configure DIP as follows:

1 - DOWN, 2 - UP for R/C control;
3 - UP for no auto cut-off;
4 - DOWN for independent mode;
5 - UP for linear response;
6 - DOWN for microcontroller mode;

Program your PWM channel for 50 Hz frequency, 1.5 ms duty cycle. At this point you can switch on power and motor 1 should stay still. If you change duty cycle between 1 and 2 ms the motor should rotate from maximum speed in reverse to maximum speed forward accordingly.

Try this too and if it works I'll tell you how to use UART.

\$\endgroup\$
9
  • \$\begingroup\$ Ok I'll try this and get back to you \$\endgroup\$ Dec 18, 2021 at 7:04
  • \$\begingroup\$ how can I connect up the 5v and 0V terminals, my sabertooth 2X12 does not look like the one in datasheet, see imgur.com/a/7pTC7gO . What should be done with the three wires coming out? \$\endgroup\$ Dec 20, 2021 at 14:43
  • \$\begingroup\$ It looks like they changed PCB to accommodate either 4 position screw terminals or servo-style pin headers. I don't know who installed those wires, but you still have an access to 4 large oval pads marked 0V, 5V, S1, S2. You can use those. Alternatively you can check pinout of those tri-wire cables that look like standard servo leads. Usually these have brown-0V, red-5V and orange for signal. So you can use them as well. \$\endgroup\$
    – Maple
    Dec 20, 2021 at 15:00
  • \$\begingroup\$ I checked the pinout of the tri-wire cable. The red is 5V, the brown is ground. I connected the 5v and ground from the potentiometer to the red and brown of the tri-wire cable and orange to the wiper but does absolutely nothing. The motor stopped and does not matter how much you spin the potentiometer it does not even move. Any ideas on this?(Meanwhile I will try the oval connections) \$\endgroup\$ Dec 20, 2021 at 15:17
  • \$\begingroup\$ Can you make a photo of your setup and add to the original question? The photo clearly showing wiring of the potentiometer and DIP switch. Also check the voltage on orange wire - does it change between 0 and 5V when you move the viper? What is the resistance of your potentiometer? \$\endgroup\$
    – Maple
    Dec 20, 2021 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.