Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

on/off controller with deadband

Status
Not open for further replies.

ibrahim_damt

Newbie level 4
Joined
Nov 28, 2006
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,330
i need to make on/off controller but with deadband how can i implement deadband
 

DXNewcastle

Full Member level 4
Joined
Jan 8, 2011
Messages
201
Helped
77
Reputation
154
Reaction score
73
Trophy points
1,308
Location
Newcastle, UK
Activity points
3,259
You will need to tell us more about your project.
Do you want to implement the 'deadband' in software or in hardware? What output switching device are you controlling? What output would you expect to see during the 'deadband' ?

Very simply, when the input value is above the high threshold value, you set the output to state A. When the input value is below the low threshold value, you set the output to state C. For other values of input, you are in the 'deadband' and must set the output to state B, but exactly what you do in software will depend on the device you are controlling.

I guess you are not trying to implement hysteresis, which has only two output states.
 
  • Like
Reactions: Eshal

    Eshal

    points: 2
    Helpful Answer Positive Rating

ibrahim_damt

Newbie level 4
Joined
Nov 28, 2006
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,330
well, i want implement deadband in software ,switching device just a relay

this is a picture exact what i want to do ,thank you for replay
 

Attachments


DXNewcastle

Full Member level 4
Joined
Jan 8, 2011
Messages
201
Helped
77
Reputation
154
Reaction score
73
Trophy points
1,308
Location
Newcastle, UK
Activity points
3,259
Ibrahim
That diagram represents hysteresis, not 'deadband'. You can see that it has only 2 output states: high and low (or M and -M).
Hysteresis is easier to implement in software than a 'deadband'.

The element of code which implements this on an single output requires a variable which holds the current output state ('M' or '-M'). This will only have a logical value of 'on' or 'off', lets call it 'Memory'.
You will also have a numerical input and a logical output (to control the relay).

The input is read regularly in by polling the numerical input. Each time it is read, do the following tests.
When the input value is equal to or greater than M, set the output high and set Memory to 'on'.
When the input value is equal to or less than -M, set the output low and set Memory to 'off'.
When the input value is between -M and M leave the output unchanged (high if Memory is 'on' or low if Memory is 'off')

You will also have to decide what state to use when initialising the output at the start of your code, and set Memory to the corresponding state.

I hope that's clear and that you recognise the difference between 'deadband' and hysteresis.
 
  • Like
Reactions: Eshal

    Eshal

    points: 2
    Helpful Answer Positive Rating

ibrahim_damt

Newbie level 4
Joined
Nov 28, 2006
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,330
thank you , i try this code and works well
for loop
mem = PORTE ;
if (input < 50 && (mem =1)) PORTE =0x00;
if ((input > 80) && (mem =0)) PORTE = 0x01;
what do you think about this code ?
 
  • Like
Reactions: Eshal

    Eshal

    points: 2
    Helpful Answer Positive Rating

DXNewcastle

Full Member level 4
Joined
Jan 8, 2011
Messages
201
Helped
77
Reputation
154
Reaction score
73
Trophy points
1,308
Location
Newcastle, UK
Activity points
3,259
Yes, that looks good. But you must also set 'mem' when you change PORTE.
Like this:

for loop
mem = PORTE ;
if (input < 50 && (mem =1)) PORTE =0x00; mem =0;
if ((input > 80) && (mem =0)) PORTE = 0x01; mem = 1;

But remember, this is hysteresis, NOT a 'deadband'.
Good luck!
 
  • Like
Reactions: Eshal

    Eshal

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top