Author Topic: Motor controller design question  (Read 4017 times)

0 Members and 1 Guest are viewing this topic.

Offline kevinisnekkidTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 0
    • Golden Bares
Motor controller design question
« on: May 21, 2010, 12:10:06 AM »
Hi,
  I'm working on making a motor controller so I don't have to worry about my control circuitry. I'm using an AVR chip, so I'll have 5v regulated power for it. The motors will be 12v with a potential for high amps. I want to use pwm for speed control. To protect my circuitry, I plan on using opto-isolators. The opto-isolated connections are at the +enable and +direction. The only part I'm not quite sure how to do is how to invert a signal in one place. Ideas?

I started with a Tilden style h-bridge, and added a little to (hopefully) make it smokeless.
I wanted to keep it at 2 control leads, so I can control several of these from a single chip. I'll use pwm on the enable line to control speed. Fwd/Rev will be control by high/zero voltage on the direction line.



-Kevin
« Last Edit: May 21, 2010, 12:35:05 AM by kevinisnekkid »
Robots don't hide what they are.

Offline Cristi_Neagu

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 5
Re: Motor controller design question
« Reply #1 on: May 21, 2010, 05:18:02 AM »
You can invert a signal either with a simple transistor, or with a op-amp. I'd go with the transistor. Connect the signal wire to the base of the transistor, the emitter to ground, and the collector will be your inverted output. Also, you must add a pull-up resistor between collector and +5V. When the signal wire is high, the transistor conducts, and puts the collector low. When the signal is low, the transistor doesn't conduct anymore, and the pull-up resistor pulls high the collector (hence the name).

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.
Re: Motor controller design question
« Reply #2 on: May 21, 2010, 07:24:58 AM »
Your circuit will not work, without the pull-up resistor at the collector, the transistor will not turn on.
look at this design and read more from the site

http://www.mcmanis.com/chuck/Robotics/tutorial/h-bridge/bjt-circuit.html
http://www.robotroom.com/BipolarHBridge.html

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Motor controller design question
« Reply #3 on: May 21, 2010, 04:32:41 PM »
Hi,

Bob Blicks H-bridge.

You don't  need optocouplers for this and it won't give you any more (or any less) protection, just a more expensive board.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline kevinisnekkidTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 0
    • Golden Bares
Re: Motor controller design question
« Reply #4 on: May 21, 2010, 10:26:08 PM »
Would this work?



If no, where did I go wrong?

Did I do the inverting transistor correctly?

Please forgive me if I sound like a noob... I'm still trying to understand electronics... and I've been playing with them since I was a lil' kid... :) I'm not looking for someone to just hand me a circuit that works... I want to understand it. And I want my circuit to meet my needs.

Billhowl, I read both of those sites. Thanks for pointing them out. :)
Robots don't hide what they are.

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.
Re: Motor controller design question
« Reply #5 on: May 22, 2010, 12:52:31 PM »
The ways that you wired the transistors will not work, there is no current flow in the ways you wired them.

like the Opto-Trans OT2 is connected from base of T3 to ground, when OT2 turn on how current will flow? there is no source of current. How T3 can turn on T1 and T10? again no source of current.

I know you want to design your own circuits, but you have to understand the transistor theory then you can make the circuit work. All transistors need to correctly biased to work.

You can use this LTspice IV to test your circuit.

Quote
LTspice IV

LTspice IV is a high performance Spice III simulator, schematic capture and waveform viewer with enhancements and models for easing the simulation of switching regulators.  Included in this download are Spice, Macro Models for 80% of Linear Technology's switching regulators, over 200 op amp models, as well as resistors, transistors and MOSFET models.

Read about the transistor theory here
http://www.mcmanis.com/chuck/Robotics/tutorial/h-bridge/bjt_theory.html
http://www.faqs.org/docs/electric/Semi/SEMI_4.html

Offline kevinisnekkidTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 0
    • Golden Bares
Re: Motor controller design question
« Reply #6 on: May 25, 2010, 03:26:11 AM »
I tried doing this in spice... but I got completely lost. That looks like a great program, but it will take me a while to figure out.

So, I tried just reading the articles you pointed out, and I think I understand transistors better now. Here's my latest version that I believe makes more sense.

*** Edit: Fixed image, missed 2 connection dots.



For the resistors, my guess is that R3 should be higher than R1 and R2. I'm thinking R1 and R1 should be 1K, and R3 should be 10K. Does this sound right? If not, what would you recommend?

For the transistors, what would you recommend? I need it to be able to handle the amps of the motor being seized without smoking anything. I am using another circuit to check the actual rpm of the motor, so the motor won't be seized for long. It will make a few attempts to run the motor, but if it can't get the motor running, the whole thing will shut down.

Soeren: I don't mean to ignore your comment. For this project, I would prefer having the opto-isolators there since this is connected to 2 AC power sources. I want to limit the damage if something goes seriously wrong. Replacing motor controllers would be much cheaper than replacing my main board.

In the future, I may need more than 12 volts...
« Last Edit: May 25, 2010, 02:19:27 PM by kevinisnekkid »
Robots don't hide what they are.

 


Get Your Ad Here