DC Motor Control

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
Widgetman
Posts: 136
Joined: Sun Dec 16, 2007 7:39 pm
Location: Florida

DC Motor Control

Post by Widgetman » Mon Apr 25, 2011 1:54 pm

Hi,
I have a need to control a DC motor for my cattle gate. I was wondering if anyone has ever used a PIC to control a DC motor, and how you would handle ramping the voltage up slowly to avoid jerk on a chain drive system. I plan on using a 15W solar cell to charge a battery system, and use the PIC to monitor and control stuff. Any thoughts or ideas would be greatly appreciated.
Thanks

User avatar
Senacharim
Posts: 139
Joined: Tue Aug 10, 2010 5:19 pm
Location: Ventura, CA

Post by Senacharim » Mon Apr 25, 2011 2:17 pm

You'll want to look at PWM (Pulse Width Modulation) for that.

Also, if you connect a amperage-reading sensor you could monitor the motor load; which can give you indicators for if it has become stuck on something while attempting to move.
Surviving Member
Bermuda Triangle Battalion
from 2026 to 1992

Voted "Most likely to time travel"--Class of 2024.

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Mon Apr 25, 2011 2:18 pm

Assuming it is a brushed DC motor, then a half-bridge implemented using the ECCP module of the PIC will drive the motor forward and/or reverse. Instead of ramping the voltage (poor torque at low voltage), use PWM and ramp the duty cycle from 0-100%.
Why use 8 bits when you can have 32?
ARM CORTEX Rules!!! :D :D :D

Widgetman
Posts: 136
Joined: Sun Dec 16, 2007 7:39 pm
Location: Florida

Stepper Motor

Post by Widgetman » Mon Apr 25, 2011 2:38 pm

Hi,
Thanks for the input. I am actually leaning towards a stepper motor closed loop system, but I need a 1/4 Horsepower DC motor, and I am not sure of cost and availability. Would the ECCP module in a PIC control this type of motor ?
Thanks

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Mon Apr 25, 2011 3:11 pm

Yes, you can control the 1/4HP DC motor with a PIC using PWM - assuming you have a sufficiently beefy out stage. A stepper is not closed loop unless you add an encoder and do the loop control in software - you can also do the same with the DC motor. Why would you need close loop for a cattle gate? It would be more appropriate to use limit switches for the open and close positions. Unless you want to be able to partially open the gate.
Why use 8 bits when you can have 32?
ARM CORTEX Rules!!! :D :D :D

Post Reply