CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

control DC110 motor

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
whung.john
Guest







control DC110 motor
PostPosted: Mon Jul 23, 2007 10:53 am     Reply with quote

Very Happy
hi ,all my friends.
because i think use DC110 motor to control a machine.
i uses electric parts follow as;
from pic16f73 to moc3023,and use moc3023 control triac .
use triac part to control my dc110 motor.
but i dont understand ,how to write program.
i tried written porgram.and not use ccp1 direct to control DC110 motor.
i used pin A1 to connect motor.
please tell me ,where have bug error.

very thanks u read my question contents.

#define PWM_PIN PIN_a1
#define LOOPCNT 50
int8 width;

#INT_RTCC
void tick_interrupt(void);

//====================================
main()
{
width = 10;
setup_counters(RTCC_INTERNAL, RTCC_DIV_1);
enable_interrupts(INT_RTCC);
enable_interrupts(GLOBAL);

while(1)
{

}

}

//====================================
#INT_RTCC
void tick_interrupt(void)
{
static int8 loop = LOOPCNT;
static int8 pulse;

if(--loop == 0)
{
loop = LOOPCNT;
pulse = width;
}

if(pulse)
{
output_high(PWM_PIN);
pulse--;
}
else
{
output_low(PWM_PIN);
}

}
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Jul 23, 2007 12:54 pm     Reply with quote

110VDC or 110VAC ?
I don't think you can use a triac for regulating a DC motor. Once triggered a triac will only shut down when the current goes down to zero, this will never happen with a DC voltage.

If you meant AC, then you will need some kind of synchronization to the power supply zero crossings.
whng.john
Guest







HOW TO ADJUST MOTOR SPEED
PostPosted: Mon Jul 23, 2007 6:33 pm     Reply with quote

ckielstra wrote:
110VDC or 110VAC ?
I don't think you can use a triac for regulating a DC motor. Once triggered a triac will only shut down when the current goes down to zero, this will never happen with a DC voltage.

If you meant AC, then you will need some kind of synchronization to the power supply zero crossings.


HI,MY friend.
the hareware use moc3023 control triac action operation,
and triac volt from BRIDGE 110VAC trans to 110vDC.
i use pic16f73 send a high or low. the moc3023 starts operation and
traic started volt output to my 110VDC MOTOR.
I think use software pwm method ,and i can control motor and adjust .
please u can tell me and teach me ,how can i solution my question from
adjust question.
now i tried control from my post infortion program.the motor can operation but motor operate not very smooth operation.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Jul 24, 2007 4:14 am     Reply with quote

Even when using a rectifier bridge the DC voltage will continously vary from 0 Volts to the maximum. To get a stable motor regulation you will need some kind of synchronization with the mains voltage.

I'm no expert in this area. Maybe someone else can jump in?
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Jul 24, 2007 8:43 am     Reply with quote

ckielstra is right. If you try to use an unsynchronized PWM to control AC by a triac you will get a "beat note" as the AC and PWM clocks creep into and out of synchronization. I suggest you try these:
1) Get comfortable using PWM control of a small DC motor like in a toy car.
2) Try using a triac to control a 110VAC incandescent light bulb. A light bulb is a very easy load to drive, with minimal inertia, power changes are obvious, and it is electrically rugged and easy to replace if you find a way to damage it. Look at Microchip application note AN521 to see how to synchronize the PIC to the AC power line. I suggest you invest in an isolation transformer so you don't get shocked or blow up your PIC equipment if you touch a wrong wire.
3) Try controlling an AC brush motor like a lawn mower or vacuum cleaner motor.
4) Finally try your rectified AC drive of a DC motor.
_________________
The search for better is endless. Instead simply find very good and get the job done.
WHUNG.JOHN
Guest







MAKE A ZERO
PostPosted: Wed Jul 25, 2007 5:50 am     Reply with quote

SherpaDoug wrote:
ckielstra is right. If you try to use an unsynchronized PWM to control AC by a triac you will get a "beat note" as the AC and PWM clocks creep into and out of synchronization. I suggest you try these:
1) Get comfortable using PWM control of a small DC motor like in a toy car.
2) Try using a triac to control a 110VAC incandescent light bulb. A light bulb is a very easy load to drive, with minimal inertia, power changes are obvious, and it is electrically rugged and easy to replace if you find a way to damage it. Look at Microchip application note AN521 to see how to synchronize the PIC to the AC power line. I suggest you invest in an isolation transformer so you don't get shocked or blow up your PIC equipment if you touch a wrong wire.
3) Try controlling an AC brush motor like a lawn mower or vacuum cleaner motor.
4) Finally try your rectified AC drive of a DC motor.



thank u teach me.
i even read a internal about eletric report.
it teach me ,my hardware need a scan a zero voltage.
so pic16f877 knows AC valtage started and start count time.
60hz about 16ms,and need make a delay time .
so hardware triac can get a middle valutage.
i try written programm. but motor operation dont smooth active.
my program here: follow as :

main()
{
while(1)
{
if (!input(pin_a4)) //USE PIN_A4 TO SCAN AC110v START
{
delay_ms(10);
output_high(pin_a1); //connection TRIAC let AC MOTOR can operate pin
delay_ms(6)
output_low(pin_a1);
}
}
}


please teach me ,where have bug? and how to debug?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group