fan controller

Discussion of the PSoC Creator Integrated Development Environment for PSoC3 & PSoC5 devices.

Moderator: ericb

fan controller

Postby shofiaram » Mon Jan 14, 2013 12:17 am

hai.i m sofi doing my m.tech (3 rd sem).now i m working with my mini project..i have choosen fan controller as my topic.i thought of doing this project in psoc5 CY8C55 processor.i m not familiarize with this development kit before..plse help me sir
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Mon Jan 14, 2013 6:39 am

When you visit the Cypress homepage you may find (after some search) heresome infos about fan controlling.
Hope that helps

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Mon Jan 14, 2013 8:41 pm

sir,i have gone through some pdfs from internet.while reading that i understand that thermal expansion board kit is designed to work with CY8CKIT-001 PSOC and CY8CKIT-030 PSOC3 development kit.i have CY8CKIT-050 PSOC5 development kit with me.whether thermal expansion kit is necessary for doing fan controller in this kit
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Mon Jan 14, 2013 11:08 pm

The advantage of the thermal expansion kit in my eyes is: Just set it up and run one of the examples out-of-the-box. That can save you months of experimenting !
When that kit runs together with a kit-030 board, I'm relatively sure that it will run on a kit-050 too, but better to ask a Cypress engineer. To do so:
go to the Cypress website
under Support -> Technical Support -> Create a Case you may ask that question. Some registration might be needed.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Mon Jan 14, 2013 11:33 pm

thanks a lot sir for ur guidence.i will explain what i am planning to do.i thought to use capsense slider to control the pwm duty cycle and display the speed and duty cycle on lcd display.for completing my project successfully i need ur support sir
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Tue Jan 15, 2013 3:55 am

This is an open forum and not only me will try to help you. Probably one difficult might be that english is not my native language as it seems not to be yours too. What is your native language?
Are you able to read the datasheets (capsense, LCD, the Thermal management modules)

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Tue Jan 15, 2013 7:29 am

ya i can read the datasheets and all sir.if you have more informative documents about the topics send me please.my native language is english .can you able to understand what i am replying .

sofi
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Tue Jan 15, 2013 9:00 am

Yep, I can read you :mrgreen:


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Thu Jan 17, 2013 12:42 am

how to program a simple pwm in psoc5?whether we need to use control and status register in it?can you sent me a simple pwm program?

sofi
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Thu Jan 17, 2013 1:13 am

Right-click the PWM in Component Catalog window and select "Find Example Project". There you'll get a well-documented working example.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Thu Jan 17, 2013 10:27 pm

sir, now i am doing a simlpe program in pwm.initialize an external variable say x.when x=1 duty cycle should be 25%,when x=2 duty cycle=50% tiill x=5.i will attach the code.please tell me what all correction i need to make in it

void main()
{
CyGlobaIIntEnable;
clock_enable();
PWM_start();

while(1)
{
value=125;
PWM_stop();
PWM_WritePulseWidth(value);
PWM_start();
x=0;
for(x=1;x<4;x++)
{
value=value+10;
LED_1 Write(LED_ON);
}
}
}
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby bobmarlowe » Fri Jan 18, 2013 12:40 am

When you do a hand-simulation of your code you can see that within the for-loop you increase value and x but there is no change in the PWM-component.
There is no API named PWM_WritePulseWidth() in Creator 2 the name would be PWM_WritePeriod() but that is the wrong way to change duty-cycle, instead you should use PWM_WriteCompare()

You have to consider that changing the variable "value" occurs very fast compared to the period of the PWM so that you will have to insert a delay e.g. with CyDelay(1000) which gives you 1 second of observation time before a next change occurs.

The LED will not change its value within the loop,

your code-example is incomplete since there is no declaration for your variables x and value. Names often use uppercase characters, so it is PWM_Start() and not PWM_start()

To have a look at all the settings within your project it would be better for us when you use the "Create Workspace Bundle" (minimal) to build a complete archive of your project that you may upload here.


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Fri Jan 18, 2013 12:49 am

thank a lot for the information.i will make necessary changes and try it
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby shofiaram » Fri Jan 18, 2013 1:01 am

hai bob,i have tried the program of variable duty cycle in pwm using if else statement.i am attaching the progam.i have made the necessary changes that you suggested.when i compiled it was successively build.
Attachments
pwm try.cywrk.Archive01.zip
(340.39 KiB) Downloaded 118 times
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby danadak » Fri Jan 18, 2013 5:14 am

Some observations -

1) Write the PWM value only when it has changed from last or prior value,
thereby eliminating a delay function.

2) The PWM does not have to be stopped, the write compare -

Side Effects: Using the PWM_WriteCompare() API when the PWM is running will cause the comparison to
use the new compare value immediately and that result will propagate to the output terminal
on the next clock. A change in the PWM output also triggers deadband logic if Deadband
Mode is enabled.


3) Scale the capsense value to the bit depth of the PWM, thereby eliminating all the " if(x==0x01)
" statements. So 100% slider = 255, 0% = 0, but keep in mind the endpoints compare values do not
produce a pulse output. So you might want to detect 255 and keep it at 254.

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: fan controller

Postby bobmarlowe » Fri Jan 18, 2013 6:07 am

X is not changed and stays zero
value is not changed and stays 64

Code: Select all
#define  LED_1_Write(LED_ON)
Where did you get that from and what do you think it does?

You do not need to start the clock, it is configured to start at reset

as Dana suggested, no need to stop and restart the PWM

No delay in the main-loop


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: fan controller

Postby shofiaram » Mon Jan 21, 2013 1:04 am

I didnt understand the point below.will you please elobrate it
Scale the capsense value to the bit depth of the PWM, thereby eliminating all the " if(x==0x01)
" statements. So 100% slider = 255, 0% = 0, but keep in mind the endpoints compare values do not
produce a pulse output. So you might want to detect 255 and keep it at 254
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby shofiaram » Tue Feb 05, 2013 12:59 am

hai, i have programmed half part of my mini project.i will explain it breifly.i have programmed pwm with capsense sensor as input.capsense button is used to adjust the period and slider is used to adjust the duty cycle generated by the pwm.during this phase period and duty cycle are viewed on the lcd display.

my doubt is that i want to drive fan with the hepl of pwm.since fan cannot be driven directly by the pwm we need an external hardware.whether H bridge be suitable for it.please give me some instruction to complete my work.
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm

Re: fan controller

Postby danadak » Tue Feb 05, 2013 2:59 am

4 wire fans, Intel spec, have embedded electronics. H Bridge normally associated
with motor control, forward and reverse. "Normally" you do not reverse fan rotation.

For reference in case you do not have it -

[url]CY8CKIT-036[/url]

Interface (4 wire fans essentially logic interface) -

http://www.cypress.com/?rID=56655

http://www.formfactors.org/developer%5Cspecs%5CREV1_2_Public.pdf

http://www.pavouk.org/hw/fan/en_fan4wire.html

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: fan controller

Postby shofiaram » Thu Feb 07, 2013 2:29 am

thanks a lot for ur information.can you tel me the relationship between duty cycle and rpm in fan.
shofiaram
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Sun Jan 13, 2013 11:05 pm


Return to “%s” PSoC Creator (PSoC3 & PSoC5 IDE)

Who is online

Users browsing this forum: No registered users and 1 guest

cron