Controlling motor speed digitally

  • Thread starter kolleamm
  • Start date
  • #1
412
36
I'm trying to turn my milling machine into a CNC so I bought this motor driver on ebay.

https://www.ebay.com/itm/DC-40A-DC-...e=STRK:MEBIDX:IT&_trksid=p2060353.m1438.l2649

The only problem is I can't seem to find any device that can regulate the resistance across 9.7v at 100KOhms which would allow me to control the motor speed from my program. I was recommended to use digital pots but after a long search most are only capable of handling 5v.

Any ideas on how I can solve this? I just want to be able to control the motor speed from my pc.

The motors I'm using run at 48v (continuous 5.8A, peak 30A)
 

Answers and Replies

  • #2
berkeman
Mentor
58,763
8,883
It seems like a current-output DAC would be a good fit for your application. What kind of external interface devices have you used with your PC programs? Would you need a USB dongle that can do this, or can you build your own interface circuit based on a few ICs?
 
  • #3
Baluncore
Science Advisor
8,469
3,187
I'm trying to turn my milling machine into a CNC so I bought this motor driver on ebay.
How do you sense the position of the x, y and z axes ?
Do you have a tacho on the motors ?
What are the input specifications to the PWM controller, is it a fixed range voltage input such as ±5 V ?
 
  • #4
412
36
The program will be run by an Arduino, at least that's what I believe so far.

The milling machine has encoders for each axis so we can read the position through those.

I'm not real sure what the specifications are of the controller, I just know that a pot adjusts the speed.
The voltage across the power and ground slots for the pot seems to be 9.7v.

I had another idea where I could use a mofset transistor to control the speed, instead of this board but it seems I would also need a diode to prevent a voltage spike in the transistor when it turns off, and I have yet to find one that can handle up to 30A at 48v.
 
  • #5
1,390
362
There are drivers that are more directly compatible with Arduino - considering the libraries for the control I would still steer you that direction.

To continue with this controller what is the Range of the Pot?.

Is the Pot on/off AND the speed control, and then the rocker sw is the directional control?
 
  • #6
412
36
There are drivers that are more directly compatible with Arduino - considering the libraries for the control I would still steer you that direction.

To continue with this controller what is the Range of the Pot?.

Is the Pot on/off AND the speed control, and then the rocker sw is the directional control?
The pot has a max voltage of about 9.7v and has a 100k resistance.
When turned beyond a certain point it clicks and turns off the motor.
Yes, the rocker switch has three different positions : the two different directions and off.

If you disconnect the cables from the pot you can speed up the motor by touching the positive and signal together, and slow it down by touching the positive and ground wire.
 
  • #7
Svein
Science Advisor
Insights Author
2,125
679
Your link sent me directly to the solution - a P(ulse) W(idth) M(odulation) controller.
 
  • #8
412
36
Your link sent me directly to the solution - a P(ulse) W(idth) M(odulation) controller.
Yes but the goal is to control the speed from my software, these controllers all seem to have pots as a way of changing the speed.
 
  • #9
Svein
Science Advisor
Insights Author
2,125
679
You can implement a PWM in software though. Turn an output ON at regular intervals, turn it OFF at an interval proportional to the wanted speed.

 
  • #10
412
36
You can implement a PWM in software though. Turn an output ON at regular intervals, turn it OFF at an interval proportional to the wanted speed.

With or without the driver board? And PWM on the motor leads or the pot?
 
  • #11
29
11
Apologies if you already know this but here's my 2p.

An Arduino has pwm outputs on pins 3, 5, 6, 9, 10 and 11.
You could use a pot connected between 5V and ground from the Arduino with the wiper connected to an analogue input pin (A0 to A5 but stay away from A4 and A5 unless you really have to use them) which can be read using analogRead.
The pot will return a value of 0 to 1023 depending on position of the wiper. Use the map function to convert it to the 0 to 255 which the Arduino needs.
AnalogWrite this value to one of the pwm pins and you have your pwm signal for use with a suitable H-Bridge driver to control your motor speed and direction.
 
  • #12
Svein
Science Advisor
Insights Author
2,125
679
With or without the driver board? And PWM on the motor leads or the pot?
You have already gotten a better answer than I was going to give (I have never used an Arduino and did not know about the PWM outputs).
 

Related Threads on Controlling motor speed digitally

  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
4
Views
15K
  • Last Post
Replies
8
Views
39K
  • Last Post
Replies
3
Views
9K
Replies
9
Views
43K
  • Last Post
Replies
5
Views
767
Replies
4
Views
2K
Replies
4
Views
1K
  • Last Post
Replies
11
Views
99K
  • Last Post
Replies
6
Views
2K
Top