Hello,
I am working on a project to control the speed of a DC motor. So, i have Arduino, 24V DC motor (https://a.co/d/8ODawym), and a motor driver (https://a.co/d/36YdswM). From what i found on the internet, i tried to build a setup based with above components. I followed this diagram:
The motor doesn't start up when i connect the system to a source but when i swap the motor and power source connection, i.e b and m, the system works.
I also have a code from the internet but i couldn't get it to vary the speed of the pump.
How can i get it to work?
What is your motor power source? A 9V smoke alarm battery will not run a motor. You need a battery or power source that will provide the motor rated voltage and motor stall current. Stall current should be listed on the motor data sheet or data plate.
The motor drivers must also be able to handle stall current as well.
I am using an AC/DC adapter which outputs 24V.
This library for your motor driver has examples, including PWM (speed).
BTS7960 Datasheet
https://www.mouser.com/datasheet/2/196/Infineon-BTN7960-DS-v01_01-en-785559.pdf
The link for the "motor" goes to a 24v brushless water pump with an "RCA" (tip and ring) power connection. Probably no PWM.
What's the motor voltage rating?
The webpage says 24V 2A.
Thank you for the library. This is quite similar to the one that i have.
This brushless pump's speed can't be varied?
It's 24V 2A.
I do not know. Can it? I see an RCA form power plug, that is all. What do you see? Maybe PWM will work at lowering the "on" time... or not.
I will look into that and get back to you, but as i mentioned above the motor doesn't even start when i connect it following the diagram. When I reverse the b connection to motor and m to power source, only then the motor starts working.
Post a datasheet for the motor.
Learn to not trust "Instructables" or any youtube video with obnoxious audio.
Hi, @bin1234
BRUSHLESS, PWM control will not necessarily speed control it, it is not designed for variable speed.
@bin1234 what is the application, do you need a variable speed pump?
Thanks.. Tom..
Yes , it will run if you connect it backwards but it is wrong. DO NOT connect it the wrong way, you may damage the motor driver!
The error is in your code.
I also tried this but datasheet for this motor was not available. There is not any manufacturing information, no guide or details on the delivery package also.
I am trying to increase/decrease the speed of the pump based on the pressure reading from a pressure sensor in a pipe.
Can you provide me some alternatives? I want a pump that can be speed controlled with a hydraulic head of 5m or more.
Connections are all as per the above diagram. only difference is I changed the L_EN, R_EN, L_PWM, R_PWM connection according to the code,
and the code is:
// PINOUT
// L_EN -> 8
// R_EN -> 8
// L_PWM -> 9
// R_PWM -> 10
#include "BTS7960.h"
const uint8_t EN = 8;
const uint8_t L_PWM = 9;
const uint8_t R_PWM = 10;
BTS7960 motorController( EN, L_PWM, R_PWM);
void setup()
{
}
void loop()
{
motorController.Enable();
for(int speed = 0 ; speed < 255; speed+=10)
{
motorController.TurnLeft(speed);
delay(100);
}
motorController.Stop();
for(int speed = 255 ; speed > 0; speed-=10)
{
motorController.TurnLeft(speed);
delay(100);
}
motorController.Stop();
motorController.Disable();
delay(5000);
}
Does TurnLeft apply the correct voltage polarity to the motor.
If not you may have damaged the motor.
Can you check with a voltmeter/DMM without the motor connected?
Don't connect/disconnect the motor while power is connected to the driver.
Disconnect or turn off the power.
the motor outlet (m+, m-) doesn't show any voltmeter readings.
Disconnect the motor.
Connect your voltmeter Positive lead(+) to M+ and the Negative lead to M-
Run this code
Does the voltmeter show positive +24V or negative -24V?
// PINOUT
// L_EN -> 8
// R_EN -> 8
// L_PWM -> 9
// R_PWM -> 10
const uint8_t EN = 8;
const uint8_t L_PWM = 9;
const uint8_t R_PWM = 10;
void setup()
{
pinMode (EN, OUTPUT);
pinMode (L_PWM, OUTPUT);
pinMode (R_PWM, OUTPUT);
digitalWrite (EN, LOW);
digitalWrite (L_PWM, LOW);
digitalWrite (R_PWM, LOW);
delay(1000);
}
void loop()
{
digitalWrite (EN, HIGH);
digitalWrite (L_PWM, HIGH);
delay (30000);
digitalWrite (EN, LOW);
digitalWrite (L_PWM, LOW);
digitalWrite (R_PWM, LOW);
}
//
it still shows no reading.