LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to control a dc motor using a pwm amplifier

I took over the assignment of a previous researcher. He used this pwm amplifier to precisely control the dc motor, and I would like to know what the role of this pwm amplifier is at that time. Is it a role to amplify the signal made by myrio? Before this, signal gnd, +ref in, -ref in pins were connected.

 

KakaoTalk_20210511_181403889.jpg

0 Kudos
Message 1 of 4
(880 Views)

Hi Kim,

 


@KimNaParkLee00 wrote:

I would like to know what the role of this pwm amplifier is at that time. Is it a role to amplify the signal made by myrio?


Yes.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(859 Views)

@KimNaParkLee00 wrote:

I took over the assignment of a previous researcher. He used this pwm amplifier to precisely control the dc motor, and I would like to know what the role of this pwm amplifier is at that time. Is it a role to amplify the signal made by myrio? Before this, signal gnd, +ref in, -ref in pins were connected.

 

 


Yes, the DC motor current draw is probably too high to be driven directly from the MyRIO. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(824 Views)

@PrepaidGiftBalance wrote:

I took over the assignment of a previous researcher. He used this pwm amplifier to precisely control the dc motor, and I would like to know what the role of this pwm amplifier is at that time. Is it a role to amplify the signal made by myrio? Before this, signal gnd, +ref in, -ref in pins were connected.

 

KakaoTalk_20210511_181403889.jpg


The solution for your problem (keep the motor running) is not PWM, but to set pin state in correct combination. Be aware that code you use is for all-NPN transistors H-Bridge. Your circuit is built with PNP - NPN combination, thus the control is different (NPN transistor is delivering current when saturated while PNP transistor is prohibiting current when saturated).

Try modify your code like this:

if (moveServo == 37)
{
    digitalWrite(resistor1, LOW);
    digitalWrite(resistor2, LOW);
    digitalWrite(resistor3, HIGH);
    digitalWrite(resistor4, HIGH);
}
else if (moveServo == 39)
{
    digitalWrite(resistor3, LOW);
    digitalWrite(resistor4, LOW);
    digitalWrite(resistor1, HIGH);
    digitalWrite(resistor2, HIGH);
}

Note that the order is important. Set one pair to LOW first before set the other to HIGH, otherwise you'll short the circuit between function calls.

Note: You can use PWM with analogWrite() function to control motor speed, but you need to slightly modify your circuit: put additional NPN transistor before ground (collector on H-Bridge, emitter on ground), connect it's base with PWM-capable Arduino pin via a limiting resistor.

0 Kudos
Message 4 of 4
(793 Views)