Microcontroller for DC Motor Controller

  • #1

Main Question or Discussion Point

Hello, I am designing and eventually constructing a high current DC motor controller to be used in an electric vehicle for a senior design class. Right now I am at the stage of selecting the PWM source for the MOSFET drivers. A team member wants to use dedicated PWM TTL chips, I wish to use a microcontroller. Although a microcontroller is more costly and adds complexity, it has more capabilities.

I am hoping there is someone here who can help me out with some pros and cons of both, which you would use or have used etc.
 

Answers and Replies

  • #2
1,762
59
What are the features you think you'll need or want with your motor controller?
 
  • #3
MATLABdude
Science Advisor
1,655
4
Well, how would you generate and vary the PWM in the first place? Input with pre-generated PWM (from a microcontroller or PC)? Drive with digital input? Serial control? Analog comparator using a ramp? IF YOU HAVE EXPERIENCE with the micro in question, it's often the easiest way to go. May even be easier than any of the other methods if you have no experience with either of these routes.
 
  • #4
1,564
6
I would go with a microcontroller. For the extra $2 its more than worth it over using 555/or similar timers with the analog circuitry to control them. Most micros have dedicated hardware routines for running for outputting PWMs which can be very easily and directly controlled which is what you want. I take it your going to be going with the classic H-bridge design?
 
  • #5
I will be using an H bridge design. I am looking for the basics: forward, reverse, regen braking in both directions, and speed and torque measurement to be outputted to a display. I was thinking of using a dsPIC, but I want something with higher level programming, but I am not sure what is out there. MSP430? something C-like.

The dsPIC offers 4 or 8 PWM outputs, duty cycle controlled by comparing a reference voltage.
 
  • #6
MATLABdude
Science Advisor
1,655
4
There are C compilers available for the entire Microchip line. But they were designed by EEs to be programmed by EEs (i.e. in assembly) Their architecture is not really meant for high-level programming (this might be different for PIC32, but I'm less familiar with their offerings these days than I used to be). Most of the C compilers cost a few hundred bucks, but the official Microchip one can be "student evaluated" with optimizations that expire after three or so months. I don't believe that any of these are perfectly ANSI C compliant.

On the other hand, ATMEL was designed from the get-go to be a high-level language microcontroller (lots of instructions, memory access modes, deep stack, etc.) The (arguably) best compiler happens to be the free implementation of GCC (WinAVR). Programming it is a bit harder, but the plain-jane programmer (the AVR-ISP mkii) is pretty cheap, even if it doesn't give emulation / stepping functionality, and requires the use of the ISP port.

Different beasts, but low-level work seems to be less and less popular these days (probably because everything is so fast, anyways).
 
  • #7
I appreciate all of the replies. I am going to check out the AVR. It sounds like its right up my alley.
 
  • #8
1,762
59
I will be using an H bridge design. I am looking for the basics: forward, reverse, regen braking in both directions, and speed and torque measurement to be outputted to a display. I was thinking of using a dsPIC, but I want something with higher level programming, but I am not sure what is out there. MSP430? something C-like.

The dsPIC offers 4 or 8 PWM outputs, duty cycle controlled by comparing a reference voltage.
Have you considered things like ramp up (would it be okay if someone goes from 0 to full speed in an instant?), torque limiting (allow fast acceleration only if a preset torque isn't exceeded.) and stall protection (what would you do if the motor stalled?).

Don't forget that all of the functions you mention and that I mentioned can be done with op amps, in fact that's the way it was done before microcomputers. Believe it or not, some of these things are actually more easily done analog.
 
  • #9
I am interested in ramp acceleration. As for torque limiting and stall protection, those are things I am unfamiliar with and haven't considered. This controller must have full protection from almost everything that can happen when driving an electric vehicle, so I would like to select one that isn't going to come up short down the road.
 
  • #10
1,564
6
Stall protection can be solved by using a fuse in series with your motor. Torque limiting is a very complex thing to do and I suggest that you don't deal with it.
 

Related Threads on Microcontroller for DC Motor Controller

Replies
5
Views
935
  • Last Post
Replies
14
Views
2K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
5
Views
18K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
4
Views
15K
  • Last Post
Replies
2
Views
2K
Replies
10
Views
15K
  • Last Post
Replies
6
Views
2K
Top