Efficiency and CPU Consumption

Hi everyone,

I am currently programming the arduino mega to send signals to control three Sabertooth 2x12 motor controller. Each controller is capable of running two motors with PWM power control. The motor controller can accept three types of signals: Analog (Must be used with low pass filter with Arduino to filter out the PWM), Servo/RC style control, and Serial The question I am asking is that which one of these is the most efficient (meaning that it takes the least time to process and send the signals/data) and least CPU consuming (uses up the least CPU time).

All three types of signals will need an individual signal for each motor, meaning that for analog, 6 PWM pins will be used, and same goes for the Servo/RC style control. As for serial, each motor signal consists of four lines of single byte data using serial.write() for each line. This however will only take up one pin (serial tx) on the arduino.

Thank You

Please ask if you have any questions concerning my setup. I can explain it in more detail.

PWM.

All three types of signals will need an individual signal for each motor, meaning that for analog, 6 PWM pins will be used,

How do you figure that each motor will need two PWM pins?

PaulS:

All three types of signals will need an individual signal for each motor, meaning that for analog, 6 PWM pins will be used,

How do you figure that each motor will need two PWM pins?

to control three Sabertooth 2x12 motor controller. Each controller is capable of running two motors with PWM power control.

Each motor controller has two inputs, S1 and S2. S1 is for motor one signal, and S2 is for motor two signal. Therefore when using RC or Analog style controls, both inputs will be needed. So 2 inputs per controller x 3 controllers = 6 total inputs. Therefore, 6 pins are needed for Analog or RC control. Serial only needs one serial output because the three motor controllers can be daisy chained together.

Can someone explain to me why Servo/RC style control is CPU intensive? Is it due to the rapid digital on/off ?

PWM shouldn't be CPU intensive. The timer circuitry turns the bits on and off.

Can someone explain to me why Servo/RC style control is CPU intensive?

It isn't.

Obviously you have performance concerns. The problem is that, other than the motor controller, you have not described any part of your application. If you'd like more than terse answers you will have to provide more detail about the part that will be running on the Arduino.

I'm asking about why Servo/RC style control is CPU intensive. I'm not asking about PWM. As of my current understanding, Servo control basically emulates a PPM control by rapidly switching a digital out pin on and off with delays in between. Apparently, it is because of the delays that makes it CPU intensive. Is that correct?

My application is to build a ROV. It is basically a remotely operated underwater vehicle. I can go into more detail if you guys want to know more.

tincanman: As of my current understanding, Servo control basically emulates a PPM control by rapidly switching a digital out pin on and off with delays in between.

Correct.

Apparently, it is because of the delays that makes it CPU intensive. Is that correct?

Incorrect. The Servo library uses an interrupt and the 16 bit timer to "delay". It is reasonably efficient.