A DIY Electronic Speed Control ? is that viable?

In summary: That would be useful to see how the code performs without having to wire it up and use LEDs and switches as input/output. I don't know..]In summary, the conversation revolves around the feasibility and challenges of creating a "DIY" electronic speed control (ESC) using an Arduino. The concept of using 3-stage brushless motors and incorporating sensors seems simple, but the difficulty lies in integrating it into programming. The possibility of using transistors and resistors to create an ESC is discussed, but there may be a delay in response time compared to a pure electronic solution. The idea of using an Arduino's I/O as both input and output at the same time is also brought up,
  • #1
Jarfi
384
12
A "DIY" Electronic Speed Control ? is that viable?

The concept of 3-stage brushless motors does seem very simple to me. Simply power the 3 different stages at different times, use 2 at the same time and the 3rd as a magnetic sensor. When the sensor goes on you flip the stages, one goes off and other on, one stays the same.

Why is this concept so hard to integrate into programming? Do I really need to spend 100$ to buy an electronic speed controller, can't I just integrate it somehow into an arduino using transistors and resistors etc.

Oh and why can't an arduino use an I/O as both input and output at the same time?

When I am programming I always need to define it as EITHER input or output, but if they are designed to work as both, why can't I incorporate that into the code? Is the arduino assembly language too limited to allow for input and output in a port at the same time?

I am talking about when the electromagnet changes from being power to becoming a sensor, it shouldn't be as hard as it is, but for some reason this is very un-user friendly technology.

I simply don't get why you cannot code an ESC into a microcontroller using perhaps a transistor to amp up the power on each of the three stages.

Any thoughts on this?
 
Physics news on Phys.org
  • #2
I don't see why this should be a problem in the software. Doesn't an Arduino handle Interrupts?
 
  • #3
An I/O device always uses one or the other at any given time. Live with it.

As Sophie said, the Arduino has plenty of interrupt capability so you should have no problem creating your "DYI ESC" as you choose to call it.
 
  • #4
There could be a slight lag that prevents your motor from running efficiently or running fast enough. You're detecting a change of state and then required to switch something off and another thing on. A pure electronic solution will always operate faster than equivalent software.

You may have to do some experiments as to how fast the CPU (arduino) can respond and act on an interrupt. It has to be faster and be completed before the next interrupt comes in.
 
  • #5
jedishrfu said:
There could be a slight lag that prevents your motor from running efficiently or running fast enough. You're detecting a change of state and then required to switch something off and another thing on. A pure electronic solution will always operate faster than equivalent software.

You may have to do some experiments as to how fast the CPU (arduino) can respond and act on an interrupt. It has to be faster and be completed before the next interrupt comes in.

The clock speed of an Arduino is in the region of 16MHz. That means delays in the order of a couple of microseconds, at the most. This can hardly be relevant when dealing with a few tens of Hz of motor supply. If that really turns out to be a problem then you would need to have a separate driver oscillator, controlled by the Arduino but that sounds like standing up in a hammock, to me.

Look up the spec of the Arduino. It'll all be in there somewhere. Personally, I wouldn't rely on what you read here to determine your plan. You're the one who is investing time and money :biggrin: - it's just well-informed (mostly) guidance that you can get on PF.
 
  • #6
sophiecentaur said:
The clock speed of an Arduino is in the region of 16MHz. That means delays in the order of a couple of microseconds, at the most. This can hardly be relevant when dealing with a few tens of Hz of motor supply. If that really turns out to be a problem then you would need to have a separate driver oscillator, controlled by the Arduino but that sounds like standing up in a hammock, to me.

Look up the spec of the Arduino. It'll all be in there somewhere. Personally, I wouldn't rely on what you read here to determine your plan. You're the one who is investing time and money :biggrin: - it's just well-informed (mostly) guidance that you can get on PF.

Yep but now it's starting to seem simpler to just the parts to make a pure non software ESC, it shouldn't be so hard buying the parts and following some circuit map of an ESC. I'd rather have it perfect and smooth, since It'll be running on high voltage and high RPM, then at that speed this delay could start affecting and messing up the cycles bad.

Btw thanks for the help guys, the arduino forum is pretty useless for electronics questions.
 
  • #7
I do however wish that a programming language and microcontroller system would exist that handles defining Ports as both outputs and inputs at the same time, you'd just choose in the beginning of a loop weather it's an input or output...

maybe in the future, who knows.
 
  • #8
Why ever would you want to do that? Most real circuits are either inputs or outputs- or the two functions would fight each other. You may need to take some feedback from a system which you are supplying with power (as in this case and many others) but that will involve two different 'wires' to and from the circuit. You can't be that short of connecting wires that you need to be multiplexing an input and an output - which is really what you're proposing.
I think you need to reassess what you really need for this circuit. What actual hardware did you have in mind? (The fragment of circuit that would interface as you seem to propose.)
On the processor, a port can't be the same thing (I and O) at the same time so what advantage is there in wanting to connect the same port to two parts of your circuit? In processor circuits, where there are hundreds of wires, it is common to use a Bus system and once IC will use it to send and receive - but at different times; never (?imo) at the same time.

[Edit:I was thinking of the problems they have with Radio Transceivers and Radar sets where they need to use the same antenna for transmit and receive. It's a real pain to protect input from output.]
 
Last edited:
  • #9
sophiecentaur said:
Why ever would you want to do that? Most real circuits are either inputs or outputs- or the two functions would fight each other. You may need to take some feedback from a system which you are supplying with power (as in this case and many others) but that will involve two different 'wires' to and from the circuit. You can't be that short of connecting wires that you need to be multiplexing an input and an output - which is really what you're proposing.
I think you need to reassess what you really need for this circuit. What actual hardware did you have in mind? (The fragment of circuit that would interface as you seem to propose.)
On the processor, a port can't be the same thing (I and O) at the same time so what advantage is there in wanting to connect the same port to two parts of your circuit? In processor circuits, where there are hundreds of wires, it is common to use a Bus system and once IC will use it to send and receive - but at different times; never (?imo) at the same time.

[Edit:I was thinking of the problems they have with Radio Transceivers and Radar sets where they need to use the same antenna for transmit and receive. It's a real pain to protect input from output.]

I was never meaning sending and receiving AT THE SAME TIME. I was meaning interrupting the sending of voltage to receive instead. A port sends out or receives voltage, depending on what you tell it to do. But when creating a program, in said program(as far as my programming experience goes) you define the port as an output or input.

What I am proposing is for the program to create loops that first define ports, inside the loops, as inputs or outputs, like in java f. ex.

you do

int i = 1

then loop{ if i < eworijgaoij etc}

but you can also define i inside the loop and do

loop{ if int i < eag } and so fourth.

Yes I know these are not actual programming samples but you get what I mean, the constants are defined when you want to, and they are not limited to being defined outside of loops or static functions.

This is what I want for ports, I'd like them to be definable wherever you want in the program, so you could use an antenna for transmitter or reciever just how it suits you, or lol a magnetic loop as an electromagnet of electromagnetic sensor, depending on your loop or function. The advantage would simply be to reduce wire clutter...

I have no idea if this exists or not, you have described that it does naming some "bus" system. But I I'm not sure that's like the thought I am describing. I hope you get what I mean as it may not be very clear.
 
  • #10
It's a long time since I did any serious programming, using interfaces with the outside world, but processors are very fast, now and compilers can optimise speed. You seems to be confusing the software aspects of defining what ports produce or 'see' and the ports themselves. Where is the problem with looking at the signal on one port and then putting a signal out on another port? Why should that take any longer to execute?
You may find that the Arduino forum is not as useless as you think, once you start thinking along the right lines. After all, they use Arduinos in many types of control systems. There is nothing magically different about a brushless motor.
Are you familiar with the concept of Interrupts and Interrupt Handling? Object orientated programming languages make them much easier to deal with, I believe. They can be configured to have very high priority so, as I have said before, your worry about delays is quite unfounded (small fractions of a degree of phase jitter are of no consequence when you consider the inertia of a motor). Furthermore, I am not sure why your idea would prevent the same effect.
 
  • #11
sophiecentaur said:
It's a long time since I did any serious programming, using interfaces with the outside world, but processors are very fast, now and compilers can optimise speed. You seems to be confusing the software aspects of defining what ports produce or 'see' and the ports themselves. Where is the problem with looking at the signal on one port and then putting a signal out on another port? Why should that take any longer to execute?
You may find that the Arduino forum is not as useless as you think, once you start thinking along the right lines. After all, they use Arduinos in many types of control systems. There is nothing magically different about a brushless motor.
Are you familiar with the concept of Interrupts and Interrupt Handling? Object orientated programming languages make them much easier to deal with, I believe. They can be configured to have very high priority so, as I have said before, your worry about delays is quite unfounded (small fractions of a degree of phase jitter are of no consequence when you consider the inertia of a motor). Furthermore, I am not sure why your idea would prevent the same effect.

I'm sure this delay has a significant effect when dealing with communication technologies if using a single port which is switching between inputs and outputs.

but yes, that is true, you can simply use 2 ports instead of one

also it is true that this delay probably does close to nothing to brushless motor performance.

I am not familiar with the concept of interrupts but I will check it out, it may be what I am looking for, if not I might just think about this I/O problem some more and trouble myself.
 
  • #12
ESCs are super cheap, and my understanding the programing varies greatly between applications. I would be very very surprised to learn that at anything but very low RPMs the ESC does any monitoring of rotor position at all.

Surely a magnetic field rotating at 35,000 rpm ( x3 from the FETs on/off perspective) has some unique challenges with respect to timing an electromagnetic field to "push" off of. Can't be some simple linear scale.
 
Last edited:
  • #13
Haha - it's not the delay that messes up radio transceivers - it's burning out the receive circuits with massive transmitter powers. I was using the principle to point out the difficulties of communing up inputs and outputs. Basically, you have to switch them in and out (as with your project) and they, of course, use different circuits for each. That corresponds to different 'ports'.
The nearest thing I can think of for what you are talking about would be an intelligent Comms port in which the Tx and Rx functions are shared by the same connection, as with Coax Ethernet transceivers. The Tx only transmits when the RX senses that the line is clear of other high level signals. That's done with dedicated circuitry - but the data rate is much higher than the poor old Arduino's clock rate even.
Find out about Interrupts and I think you'll find out that they are the way to go.
 
  • #14
nitsuj said:
ESCs are super cheap, and my understanding the programing varies greatly between applications. I would be very very surprised to learn that at anything but very low RPMs the ESC does any monitoring of rotor position at all.

Surely a magnetic field rotating at 35,000 rpm ( x3 from the FETs on/off perspective) has some unique challenges with respect to timing an electromagnetic field to "push" off of. Can't be some simple linear scale.

I read this link which was interesting and put me right about a lot. It appears that they use a Hall sensor on motors where they want to have good control. I am sure some sampling at regular intervals of the emf in the 'off' coils of a sensor less motor could give Phase information and, thus, a measure of the error to enable control.
 
  • #15
As I read this it seems that you are thinking of the BLDC as a 3 phase stepper - and looking to feed it a straight DC pulse-- while that is feasible, these motors are typically controlled in PWM - with the Switching Frequency usually 20x the fundamental, being fed a sine wave - basically looking like 3 phase AC, variable voltage(current) and variable output frequency ... this is probably why you are not finding much literature. I have not heard of this type motor being called a 3 Stage ( 3 phase yes) - so part of your problem in finding info is the language you are using.
As for the Aarduino - you can post on Sparkfun or other "application" side sites.
Regarding defining GPIO - as both INPUT and OUTPUT -- can you define a CIRCUIT that you would use in this case? Arduino uses ATMega uC chips typically - so that DS will tell you more about the "spec" at that level. But as mentioned before - I can not see a practical application of doing this.
 
  • #16
This link talks about Arduino processor IO capabilities.
http://arduino.cc/en/reference/board
Looks like some Arduino Analog inputs can become digital inputs or outputs, but not PWM outputs. But there is no reason you can't connect each winding to both a PWM output and an analog input and dynamically control whether the PWM is driving or tri-stated (which is basically what you are asking for). It would require some external PWM to voltage controllers with tri-stateable outputs.

Building a motor speed controller is a closed loop system and the system latency just becomes part of the loop equation.
 
  • #17
Arduinos can do PWM : http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM. The question is how long will it take ( cycles) for the ATMega to change the output back and forth?

Also - being related to switching a power circuit - any input even remotely connected will be noisy - useless, that is why sensing (inputs to the uC) are separate and dedicated.

This is the trees for the forset thinking - that gets many academics delayed -- just because it CAN be done does not mean it sould or that is even makes sense. If you we switching a basic circuit like battery charge then battery sense - and want to save inputs, this is a slow, non time critical case - but real time control of a motor...ahhhh
 
  • #18
Now that you mention that, it seems wildly unpractical. No way to know when to switch, etc.
 
  • #19
haha -- Forrest for the Trees... not forset! Should not sould... uh - I need help!
 

1. Can a DIY electronic speed control be as efficient as a professionally made one?

It is possible for a DIY electronic speed control to be as efficient as a professionally made one, but it will depend on the skills and experience of the person making it. It is important to carefully follow instructions and use high-quality components to ensure optimal performance.

2. What components are needed to make a DIY electronic speed control?

The components needed will vary depending on the specific design and functionality of the speed control. Common components may include a microcontroller, motor driver circuit, potentiometer, and various capacitors and resistors. It is important to carefully research and plan the design before purchasing components.

3. Is it difficult to build a DIY electronic speed control?

The difficulty level of building a DIY electronic speed control will depend on the individual's level of knowledge and experience with electronics. Some designs may be more complex than others, so it is important to carefully research and understand the design before attempting to build it.

4. Can a DIY electronic speed control be customized for specific motors?

Yes, a DIY electronic speed control can be customized for specific motors. The design and components used may need to be adjusted to match the specifications and requirements of the motor. It is important to carefully research and understand the motor's specifications before designing the speed control.

5. Are there any safety concerns when building a DIY electronic speed control?

Yes, there are potential safety concerns when building a DIY electronic speed control. It is important to follow all safety precautions and use proper tools and equipment when working with electronics. It is also important to carefully test and troubleshoot the speed control before using it with high powered motors.

Similar threads

  • DIY Projects
2
Replies
35
Views
5K
Replies
1
Views
2K
Replies
6
Views
2K
Replies
4
Views
2K
Replies
3
Views
3K
Replies
2
Views
2K
Replies
22
Views
2K
  • DIY Projects
Replies
32
Views
6K
Replies
31
Views
6K
  • DIY Projects
Replies
4
Views
2K
Back
Top