Duty Cycle Adjusting DC Motor Controller

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Duty Cycle Adjusting DC Motor Controller

Postby ephesus » Fri Jun 01, 2012 9:50 am

Hi,earlier,i msged this message

hi,i just want to enquire this,i bought this project and i just want to know how i can control the duty cycle of the pulses.For an example,if K=100% or K=70% ,what will be the results of the rpm .In this project im able to find the speed but i just want to know how to control the duty cycle for my results.Thank you

and my reply is this

Is being control by CCP1RL value. The sample program is using 8-bit PWM duty cycle, therefore the value is from 0-255. For 70% duty cycle, you should load 179 to CCP1RL. The RPM depends a lot on the motor itself and the gear, you will need to measure it yourself. If you have further inquiry, please discuss in our technical forum as this section is for short inquiry, thanks :)

My question:

The thing that i need to do is to have results for a 70% duty cycle and for an example 80% duty cycle..must i always reprogram the whole CCP1RL always to get a 80% or a 90% from my current duty cycle?Another question,what the current duty cycle now,with the stock program .just following the program given by cytron?thanks.
ephesus
Greenhorn
 
Posts: 3
Joined: Fri Jun 01, 2012 9:43 am

Re: Duty Cycle Adjusting DC Motor Controller

Postby ephesus » Fri Jun 01, 2012 9:59 am

By the way,i bought the Controlling DC Brush Motor Using MD10C.Thanks
ephesus
Greenhorn
 
Posts: 3
Joined: Fri Jun 01, 2012 9:43 am

Re: Duty Cycle Adjusting DC Motor Controller

Postby sich » Fri Jun 01, 2012 2:37 pm

ephesus WROTE:The thing that i need to do is to have results for a 70% duty cycle and for an example 80% duty cycle..must i always reprogram the whole CCP1RL always to get a 80% or a 90% from my current duty cycle?

No need to reprogram the microcontroller. Just write your code so that it update new value into CCP1RL register.

ephesus WROTE:Another question,what the current duty cycle now,with the stock program .just following the program given by cytron?thanks.

Which program are you referring to? Link?
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: Duty Cycle Adjusting DC Motor Controller

Postby ephesus » Fri Jun 01, 2012 7:48 pm

im speaking about the hex code,burned into the PIC chip.How do you set it with CCP1RL?sorry im noob in this things:)
ephesus
Greenhorn
 
Posts: 3
Joined: Fri Jun 01, 2012 9:43 am

Re: Duty Cycle Adjusting DC Motor Controller

Postby sich » Sun Jun 03, 2012 12:27 am

HEX code is generated from programming code. Eg: If you are writing assembly code, the assembler will translate the code to HEX. If you are using C language, you will need the correct C compiler to translate it.

So when talking about changing the register value, it means you have to modify the sample program whether it's in Assembly, C language, BASIC,...etc. Then regenerate the new HEX code to load into the microcontroller.

Perhaps you should start from the beginning... You haven't clarify with sample code you are referring to. May be you can have a look at the details description and source code of this DIY project if you haven't do so.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 2 guests