Dual PWM circuit for reversible motor

Status
Not open for further replies.

Electric Rain

New Member
Alright, so I'm designing my own remote-controlled motorized cable cam (I'm going into videography, but that's a different story...). I need to be able to control the speed AND DIRECTION of two motors (for traveling along the cable and for panning the camera). A circuit like this should suffice, I think. I will split it at the MOSFET. So, the output of U1b would feed to my RF encoder on my "remote control", and the MOSFET would be attached to the output of the decoder on the receiving end. The pulse should actually just transfer right over via RF, (right?) then the MOSFET should amplify it, and drive the motor. I planned on using these ICs for the encoding/decoding.

I don't yet know enough to understand the full theory of this circuit, though I'm sure it's very simple for most of you. So, here's the real question. This circuit uses a variable voltage divider (VR1) to adjust the pulse rates. I basically need TWO copies of this circuit, but controlled by one potentiometer, with a middle deadzone. (I need to be able to reverse the direction of the motor, and I was going to use two separate channels on my RF encoder to specify which direction the motor was actually supposed to run in.) I need to basically "split" the potentiometer. When it's at its mid-point, I want the circuit to be off, and it needs a small deadzone in that area so it doesn't have to be at an EXACT position to be off. When it's turned one way, it should control one of the circuits, varying it from 0% to 100%. When it's turned the OTHER way, it should do the same for the other circuit with the midpoint being 0% for both circuits, and the two endpoints (full resistance and no resistance) being 100%.

So, to clarify, imagine this: The pot starts out in the middle, and the unit is off. I turn the pot clockwise, and the cable cam begins traveling down the cable one way. The more I turn the pot, the faster it travels down the cable. Once the pot is turned to its clockwise limit, the cable cam will be traveling at its max speed. When I turn the pot back counter-clockwise, the cable cam will start to decrease in speed. Once I reach the middle again (remember I need a small "deadzone here), the unit will be off. As I continue rotating counter-clockwise, the other circuit will kick in, sending the pulse to a different input of the RF encoder chip, telling the motor to run in the reverse direction. The more I turn it counter-clockwise, the faster the unit will travel in the opposite direction. At the pot's counter-clockwise limit, the unit will be traveling in the opposite direction as the first time, and at max speed, just like if worked in the other half of the pot.

I REALLY over explained that, I think. I'm sure you guys understood what I needed without that entire previous paragraph, but I just wanted to make sure I was clear. It wouldn't be the first time I tried to explain something to someone that they couldn't understand, but that was obvious in my mind. It's usually due to the way I explain things... I guess.

I'm a programmer before I am an electronic engineer, so it might seem like a simple IF THEN math operation to me at first, but I know it's more complicated with analog hardware. I think the solution is basically just going to end up as a slightly more complicated version of a voltage divider, but I still don't know how to do it. After all, I'm only 17. I haven't gone to college yet, so I haven't properly "learned" how to do any of this stuff. All I know is what I've taught myself, and that hasn't been much since I usually don't have any money to build anything to experiment with. I just know what I've read online.

So, how about it... can someone help me out?
 
I'm a programmer before I am an electronic engineer,

I have to admit that I did not read all of your post.

But since you are a programmer use a PIC to drive a dual H-Bridge on a chip. Send commands to the PIC via RF.
 
I knew I should have specified what I meant by "programmer". I probably should have said I'm a "webmaster" or something like that.

I know Javascript, PHP, MySQL... you know... THAT kind of programming.
 
Hey Electric Rain, remember me? Its probably been about 3 years.

Do you have any specs on the motor that you are using? (voltage rating/current draw). You could use one of these: https://www.electro-tech-online.com/custompdfs/2008/02/LMD18200.pdf if its 3 amp continuous. If you run it in locked anti-phase PWM mode,(See bottom of page 6) you can just use 1 pwm signal to drive both direction and speed:
A 50% duty cycle will hold the motor still, because it drives the motor both forward and backwards an equal amount of time. If the duty cycle is set at 30%, it will drive it forward 30% of the time and drive it in reverse 70% of the time, so the motor will move backwards.

Another advantage to the LMD18200 is that you can get free samples of them from national semiconductor. **broken link removed**

I'm not sure how you would use IR to control it without using a PIC or something. I'd start off by just getting it controlable using wires, then work on getting some sort of remote in the loop.

Hope that helps.
 
Electric Rain said:
I knew I should have specified what I meant by "programmer". I probably should have said I'm a "webmaster" or something like that.

I know Javascript, PHP, MySQL... you know... THAT kind of programming.
If you can program the script languages it is not a huge step to learn to program a micro controller in C. Think of the things you can do and the fun you can have

Have you ever used the Zend debugger for PHP programming? If you are into serious php work it is great but you need to set it up on your testing server.

jrz126: I am not a great fan of anti-phase PWM especially on battery driven equipment. Regular PWM works and draws no motor current when not moving.
 
jrz126 said:
Hey Electric Rain, remember me? Its probably been about 3 years.

Yeah, of course I remember you! Sorry, but I haven't had time to frequent these forums anymore... so I obviuosly haven't seen much of you... So... how've you been, anyway?

jrz126 said:
Do you have any specs on the motor that you are using? (voltage rating/current draw).

I don't, as I haven't decided on what motor I'm going to use yet. I have no idea how heavy this is going to be or how much torque will be required to move it up to 20 MPH, which is about what I need, so I have to build the frame and pulley section before I can worry too much about the mechanics. In the mean time, I'm planning out the electronics section.


Thanks, I'll look into that. I am worried about what 3vo said about battery driven equipment, though. It will be battery driven, so...
**broken link removed**
jrz126 said:
I'm not sure how you would use IR to control it without using a PIC or something. I'd start off by just getting it controlable using wires, then work on getting some sort of remote in the loop.

Well, like I said, step one is the frame and basic mechanics (the pulleys, basically). Step two is the motor (extended mechanics), and the electronics will come last, but I'm trying to get all the kinks worked out before I start designing it anyway. But, my point is that yes, I will be getting it running without RF controls first. Oh, and remember those encoder/decoder IC's I linked to? That's what I'll be using to get around having to use a PIC.
 

I'm pretty good. Finished up with college now and working full time. I also got married back in July. (So I have very little free time for electronics )

20MPH is 30 feet/second, which seems to be pretty fast. How long is this track going to be? You'll probably need a pretty big motor to run that, so I dont think those motor drivers that I mentioned will work. You're going to need some pretty big batteries as well. What exactly are you trying to do with it?

You may want to try using a motor and controller from a treadmill. Most of the motor driving circuitry is already built, but it might not have reverse now that i think about it. A pre-built H-bridge is definitly the way to go though. I spent about a week and a half working out the bugs in a H-bridge that I built to drive a motor for an inverted pendulum for a school project. Here's the breadboard when I was finished: **broken link removed**
Here's a pic after i had a few mosfets fail and short-circuit the supply: **broken link removed** added a current-limiting circuit right after that.
(here's a video of it in action: **broken link removed**)
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…