any one help me

hi, everyone.
my name Raja.
I need to know its possible to control the dc motor like servo motor using Arduino and pot
\

example
when I rotate the pot in clockwise means the motor will rotate clock wish
and then
when I rotate in anti-clock wish mean the motor start rotating in the anti-clock wish

when I stop the rotating the pot mean motor also stop…
it is possible to mean

can anyone write for code.
simple say mean…
the example of servo motor control using pot

15-seconds on Google gives this.

SteveMann:
15-seconds on Google gives this.

OP doesn't have a servo though....

SteveMann:
15-seconds on Google gives this.

same thing can I do in dc motor without any feed back

What exactly does "DC motor like servo motor" mean? Is it a servo (standard or continuous) or is it a standard DC motor? Please post a link to the actual thing you are talking about.

Does it need control of speed or just direction?

Steve

Rajapalani:
I need to know its possible to control the dc motor like servo motor using Arduino and pot

example
when I rotate the pot in clockwise means the motor will rotate clock wish
and then
when I rotate in anti-clock wish mean the motor start rotating in the anti-clock wish

Yes, you can do what you want but, like a servo, you will need position feedback from the DC motor. You would read the pot, compare it to the feedback from the DC motor, and drive the motor forward or back until the feedback matches the pot position.
If you only need the motor to rotate about 180 degrees (like a servo) you can use a second pot on the output shaft (just like a servo) and connect it to the Arduino just like the control pot. Then you can read both with analogRead().

i have (dc motor liner actuator)the spec was 12volt and 19 amps
so i need control the actuator..

when the actuator ball screw type the dc motor connect to the ball screw

the motor run clock wise mean the shaft will come out
the motor run anti clock wise mean the shaft will go inside

when i rotate the pot as clockwise mean the dc motor also rotate clockwise.
when i rotate opposite dir mean motor also rotate anti clockwise.
when i stop rotate the pot mean motor also stop
i using arduino mega..

That’s clearer but still not 100%…

You will need to have a variable holding the currentPotValue and compare that to previousPotValue so you know which way it’s being turned. Depending which one is bigger, run one function or another to set the motor polarity through an h-bridge to give the direction.

I’d just use an on-off-on switch for direction myself, with limit switches at the ends of the travel. Or, swap the actuator for one which actually acts like a servo, such as the Firgelli “-R” series.

i have 19amp h-bridge driver controller have pin off (ground, pwm, dir)
can you write the code for me plzz

i have basics level knowledge in programming

It's still not 100% clear what you want to do. What does the actual position of the pot mean?- why are you using a pot not a switch?

Are you expecting the actual position of the pot to be the actual position of the arm, and the direction of turn to mean the direction of the arm going in or out?

Not clear to me why you need a pot in the first place....

You show us your schematic.
You show us your wiring.
You show us your sketch.
You tell us what is not working the way you want it to.

We comment on your work.

We offer you suggestions and corrections.

see this video i need this exactly

Rajapalani:
see this video i need this exactly

from the youtube:
A servo made from a dc motor and a potentiometer. It is controlled by another potentiometer through a arduino

The phrase "another potentiometer" says to me that there are two....

Seems to me that guy actually made a servo by attaching a pot to the motor (or perhaps it has one built in?), so this is not a simple matter of:

Rajapalani:
can you write the code for me plzz

Email ID -avadhut.deshmukh@gmail.com

Contact them....

Or get a Firgelli -R actuator which already behaves like a servo.

i have contact through email… thy not responsible

the guy doing video nhaa same think i need

can you code for me i have very basic lever programming language

Rajapalani:
can you code for me i have very basic lever programming language

Let's clarify this first: Do you agree that the youtube solution has TWO pots?- Seems there's one on the motor to make it into a servo, and the other one is to control it.

IF you accept that as fact (your call) AND you can create the same hardware, then perhaps someone will help you with the code. Right now it's not clear (not to me anyway) if you have the hardware that can mimic that guy's.

(And if you do have it, and it's essentially a servo, then you can probably use Knob as SteveMann suggested.)

edit: actually that's not true, there's more to it than that, to handle the polarity of the motor to the h-bridge.

No that guy use only one pot to controller the dc motor.

i have different hardware and perhaps but concept same

i need code as same concept

Rajapalani:
No that guy use only one pot to controller the dc motor.

Well he talks of "a potentiometer" and "another potentiometer" which reads to me like there are two.

motor as servo.GIF

(Although that said it does seem there are only two wires from the motor. So he probably perhaps just compares the current pot value to the previous, to determine direction, and then set the polarity accordingly.)

motor as servo.GIF

Rajapalani:
can you write the code for me plzz

There is a forum section named Gigs and Collaborations where you either team up with or pay others to make a project.

Where you are now is about teaching so that you can go on to make more and help teach.

If you can form a local group to cover talents needed, work on different projects to get coordinated and have things to show then look for paying work.

OTOH Nishant found his way up, I think through Uni in New Delhi. He has traveled far doing different jobs, he likes California a lot! He had interesting devices working before going pro, one a hand gesture interface, Nish went beginner to pro in maybe 4 years or less but he can code and solder surface mount hardware.

those the component i use my project

Cytron-20Amp-6V-30V-DC-Motor-Driver-MD20A-3.jpg

Cytron-20Amp-6V-30V-DC-Motor-Driver-MD20A-4.jpg

thomson-electrak-la14-linear-actuators-500x500.jpg

This code might get you started…

It turns on one or other led to indicate direction, both off for not moving.

Set the variable “slack” to suit your pot: my crappy one sends different values even when not moving.

// https://forum.arduino.cc/index.php?topic=631081
//  meltDown 13 august 2019
//  dc motor as a servo but with no feedback pot?, only a pot to control?

byte potPin = 0;
int potVal;
int potValPrev;
byte slack = 4; //some pots change value slightly even when not being moved

// these leds could be the polarity of the motor
byte leftLed = 2;
byte rightLed = 3;

void setup()
{
  Serial.begin(9600);
  Serial.println(".... dc motor as pot ....");
  Serial.print("Compiler: ");
  Serial.print(__VERSION__);
  Serial.print(", Arduino IDE: ");
  Serial.println(ARDUINO);
  Serial.print("Created: ");
  Serial.print(__TIME__);
  Serial.print(", ");
  Serial.println(__DATE__);
  Serial.println(__FILE__);

  //turn off L13
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);

  potVal = analogRead(potPin);
  potValPrev = potVal;

  pinMode(leftLed, OUTPUT);
  pinMode(rightLed, OUTPUT);

  Serial.println("turn the pot");

} //setup

void loop()
{
  potVal = analogRead(potPin);
  Serial.print(potValPrev);
  Serial.print(" ");
  Serial.print(potVal);
  Serial.print(" ");
  Serial.print(potValPrev - potVal);

  if (potValPrev < (potVal - slack))
  {
    Serial.println(" going one way");
    digitalWrite(leftLed, HIGH);
    digitalWrite(rightLed, LOW);
  }
  else if (potValPrev > (potVal + slack))
  {
    Serial.println("                                       going other way");
    digitalWrite(leftLed, LOW);
    digitalWrite(rightLed, HIGH);
  }
  else
  {
    Serial.println("            not moving");
    digitalWrite(leftLed, LOW);
    digitalWrite(rightLed, LOW);
  }
  potValPrev = potVal;

} //loop

I also have to add here, speaking as an engineer, that (with the greatest respect) someone who doesn’t know what they’re doing when configuring and programming what I assume is some kind of industrial plant, is potentially very dangerous