2

To control my robot, I need to generate negative and positive voltage in a single line, because the motor I try to control is an industrial one.

Do you have any suggestion for it? How can I produce a negative voltage using an Arduino board and simple electrical elements?

Transistor
  • 629
  • 5
  • 14
  • wire a positive voltage in reverse? – BrettAM Jan 11 '16 at 06:22
  • 3
    It would help if you could be specific about the motor that you want to control. – dlu Jan 11 '16 at 06:26
  • The servo-pack takes the voltage in single line from -10v to +10v. Usually motors have two pins to control the direction and velocity. But, in our servo-pack, one pin is ground and the other one takes a voltage in the interval of [-10,+10]. I want to control this motor using an Arduino Uno. – Soheil Gharatappeh Jan 11 '16 at 06:57
  • @BrettAM I need to change the direction of motor with my control circuit and I just have the positive output of Arduino. Where should I put this single output line to inverse the direction? – Soheil Gharatappeh Jan 11 '16 at 07:16
  • Can you provide a link to a datasheet for the motor? How does the +/-10V relate to how the motor works? – Majenko Jan 11 '16 at 11:35
  • Can't you use an H-bridge for this? – Gerben Jan 11 '16 at 16:06
  • [link] https://www.yaskawa.com/pycprd/lookup/getdocument/jvgyvE5ZTUY_5CC1znzBoe-iyvC0118s_1GfGe382go7iz9ltcbQkMVMhVN8L5K3hXb6Zpv5R6zVrH-_NQ6U3hPPUoT2-nMfM5mD23cQKH7xVWeJTen95A this is a link to the catalogue. You can find the information in p160 for torque control for instance. It's impossible to use H-bridge for this servo-pack. Because one of the pins is ground. In H-bridge, we have access to two pins in motor to control the direction. Here we have just one pin. – Soheil Gharatappeh Jan 11 '16 at 16:28
  • @Gerben, no he can't. He's driving a _servo_ amplifier, not a motor. He needs to generate a control voltage ranging from -10 V to +10 V. See my answer. – Transistor Jan 11 '16 at 21:10

2 Answers2

3

Your question should read:

How do I scale a 0 to 5 V signal to -10 V to +10 V?

First write the conversion formula:

Vout = 4 * Vin - 10

Testing the formula gives the following:

  • Vin = 0.0 V ==> Vout = -10 V
  • Vin = 2.5 V ==> Vout = 0 V
  • Vin = 5.0 V ==> Vout = +10 V

You will need an op-amp circuit to create this function. In addition you will need a +12 and -12 V supply.

schematic

simulate this circuit – Schematic created using CircuitLab

How it works:

  • OA1 is an op-amp wired in an inverting summing amplifier configuration. We'll address the inversion later but for now all the answers will be "upside-down". The gain is set by -R2/R1 = -40k/10k = -4. If we feed 1 V in from the ADC we will get -4 V out.
  • R3 provides a negative input. The gain will be set by -R2/R3 = -40k/48k = -5/6. Since it's connected to -12 it will contribute +10 V to the output.
  • The actual output will be the sum of the two: in our example, +10 - 4 = 6 V.
  • C1 and C2 provide noise filtering for the op-amp. Place them close to the chip.

Now, what to do about the inversion? We have three choices:

  1. Fix it in the micro controller code. Set +5 V as maximum reverse speed / torque. Set 0 V as maximum forward speed / torque.
  2. Fix it in the servo amplifier and tell it to reverse its command signal.
  3. Fix it in the electronics. By adding another inverting op-amp we can turn the signal the right way up.

The TL082 opamp suggested has two op-amps in the one 8-pin package.

Ref: Inverting Summing Amplifier.


Servo Enable

schematic

simulate this circuit

Delay the servo enable until the micro controller has initialised and all other functions are ready. See manual Section 3.2.3, page 73.

Note that this is a simplified relay drive schematic. You need a transistor drive and a snubbing / flyback diode around the relay so one of the small 5V relay boards would be a good solution as they are already built in. An opto-isolator would be simpler.

Ensure that safety circuits (guarding and e-stops) are correctly wired using safety-rated components (and not only, for example, the micro).

Transistor
  • 629
  • 5
  • 14
  • Thank you so much for your complete answer. I am going to make the circuit and may ask more questions when I finish making it. One more time, thank you for the detailed answer. – Soheil Gharatappeh Jan 12 '16 at 03:07
  • This circuit seems to have an issue. When the Arduino is not fired yet, if the motor is turned on, it will rotate with the maximum torque in negative direction. Which may damage our system. One solution comes to my mind to solve this. We can use a 74HC4052 to scale the voltage to [-5,+5] and then use an op amp to gain this value. Am I right? – Soheil Gharatappeh Jan 12 '16 at 06:09
  • You should already be using _Servo Enable_ to inhibit the drive until the controller is ready. See update. – Transistor Jan 12 '16 at 07:38
  • I'm back after so long :). Actually the circuit works but not well. There is an offset in output. After lots of searches, I found that there are other solution for this problem. For instance, it is possible to use an IC which is called Digital to Analog converter. Do you know how can I handle the problem using that IC? Because the output of abovementioned circuit is not precise and reliable. – Soheil Gharatappeh Mar 25 '16 at 06:34
  • P.S.: my system has high band width and accepts pure analog voltage as input. That's why I came into the idea of using DAC. – Soheil Gharatappeh Mar 25 '16 at 06:43
  • The Arduion PWM output is a form a DAC. It is precise and reliable. You need to figure out _why_ it's not working. Post a schematic of your system. There's a schematic button on the editor toolbar. – Transistor Mar 25 '16 at 18:55
  • PWM output of Arduino has the strict frequency of 490 hz while my motor's bandwidth is 1.6 khz. Consequently, when I run the motor using the Arduino PWM it rattles. My circuit's problem is the voltage offset of the op-amps. Even when I simulate the circuit, it works well, but in practice, there is an offset voltage on the output pin of the op-amp. – Soheil Gharatappeh Mar 27 '16 at 03:30
  • (1) What offset voltage do you get? (Measurement, please.) (2) What is the -12 V actual voltage? (3) What are the measured values of R1, R2 and R3? – Transistor Mar 27 '16 at 12:14
  • The PWM signal alternates between +5 V and 0 V. Did you forget that you'd need to low-pass filter it? Start with an RC filter with a cut-off of half the PWM frequency. What is your last comment about? If it's a link it's broken. – Transistor Mar 30 '16 at 10:21
  • Sorry about my late reply. When I wanted to measure the required information, I realized that, mysteriously, my circuit, which had .3v offset, now works fine (with .03v offset). Actually the circuit I have implemented is different than yours. I used a 74HC4052 to make a bipolar differential line (similar to controlling a dc motor with an H-bridge). Then I used differential amplifier configuration for my op-amp. The output of the IC is two line and using differential amplifier, I combined them together. But, even if this problem has been solved, the frequency problem is still remained unsolved. – Soheil Gharatappeh Mar 30 '16 at 10:28
  • The current frequency of PWM (490hz) is unacceptable for my system. If I add a low pass filter to it, it will add a delay to it too. I should find a way to increase the frequency of PWMs. – Soheil Gharatappeh Mar 30 '16 at 10:31
  • What kind of motor and load are you actually driving that needs a 250 Hz response? – Transistor Mar 30 '16 at 10:47
  • I want to control the tension in a cable (actually in a cable-driven robot) and the band-width of the motor is more than 1Khz. But, at least I must reach to 1Khz. – Soheil Gharatappeh Mar 30 '16 at 10:57
2

"transistor" has walked you through what is necessary. Just an additional point of note: if you don't have a +/- power supply, you can easily generate the negative voltage using eg ICL7660 or even using a 555: https://www.ikalogic.com/555-based-voltage-inverter-schematic/

Just because I'm curious, could you add a link to the servo datasheet?

Tahmid
  • 151
  • 2