Controlling motor speed digitally

  • Thread starter Thread starter kolleamm
  • Start date Start date
  • Tags Tags
    Motor Speed
AI Thread Summary
The discussion revolves around converting a milling machine into a CNC using a motor driver purchased online. The main challenge is controlling motor speed digitally, as the user struggles to find a suitable device that can regulate resistance at 9.7V and 100KOhms. Suggestions include using a current-output DAC or implementing PWM control through an Arduino, which has compatible PWM outputs. The milling machine is equipped with encoders for position sensing, and the user considers using a MOSFET transistor for speed control, although concerns about voltage spikes arise. Ultimately, the conversation emphasizes the feasibility of using software-based PWM to manage motor speed effectively.
kolleamm
Messages
476
Reaction score
44
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)
 
Engineering news on Phys.org
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?
 
kolleamm said:
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 ?
 
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.
 
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?
 
Windadct said:
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.
 
Your link sent me directly to the solution - a P(ulse) W(idth) M(odulation) controller.
 
Svein said:
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.
 
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
Svein said:
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
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
kolleamm said:
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).
 
Back
Top