Go Back   IceInSpace > Equipment > ATM and DIY Projects

Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average.
  #61  
Old 24-01-2013, 08:30 AM
rcheshire's Avatar
rcheshire (Rowland)
Registered User

rcheshire is offline
 
Join Date: Apr 2010
Location: Geelong
Posts: 2,617
Not sure if this is helpful? if you are using, data types unsigned int; or unsigned long; they don't store negative numbers... int; and long; do.

-32! Ouch. I remember -20C with a wind chill of -35 in Goose Bay one time. Best to stay indoors.
Reply With Quote
  #62  
Old 24-01-2013, 09:02 AM
DancesWithWords
Registered User

DancesWithWords is offline
 
Join Date: Jul 2011
Location: Ottawa, CanadaO
Posts: 9
Quote:
Originally Posted by rcheshire View Post
Not sure if this is helpful? if you are using, data types unsigned int; or unsigned long; they don't store negative numbers... int; and long; do.

-32! Ouch. I remember -20C with a wind chill of -35 in Goose Bay one time. Best to stay indoors.
Looking at the code it looks like Sungjune used 32bit unsigned type.

// note that all the time variable should be 32bit unsigned.
static uint32_t system_tick = 0; // ever increasing from zero
static uint32_t slcd_timer = 0; // timeout count for the LCD backlight
static uint32_t encsw_timer = 0; // timeout count for the encoder switch

// this value is used to determine the heater control
#define DEWPOINT_MARGIN 500 // 5 degree in celsius

static int16_t dew_point = -1000; // initial value(-10 degree)
static int16_t ambient_temp = 0; // ambient temp. in Celcius (x100)
static int16_t ambient_humid = 0; // relative humidity in percentage
static int16_t mirror_temp = 0; // mirror temp. in Celcius (x100)

===
DWW
Reply With Quote
  #63  
Old 24-01-2013, 02:46 PM
rcheshire's Avatar
rcheshire (Rowland)
Registered User

rcheshire is offline
 
Join Date: Apr 2010
Location: Geelong
Posts: 2,617
uint data type seems to apply to timing for various functions. If timing is exceeding the storage value I think it will loop around to negative values. In that case, I think long unsigned int will provide significantly more margin for your timer/timing.

I'm no expert, but you could try long uint instead. No need for temp calculations as they require +/- values provided by int.
Reply With Quote
  #64  
Old 24-01-2013, 06:50 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,064
Quote:
Originally Posted by hikerbob View Post
BTW, I've ordered some bit's to try a Veroboard version of the remote controller. Not sure how much effort would be involved in getting the existing controller to talk to it but given I'm already using I2C maybe not too bad.

If it works as expected I'd have to look at some options for a surface mount version.

Since I wrote that I've been having another look at the pinout's for the 8M2 and am not sure that I can do both PWM and I2C, the one pin labelled with pwm is also the I2C SDA pin.

Should be able to do a version of PWM in code on another pin. Failing that look into the 14M2 chip's which do have PWM on pins seperate to I2C.

Bob
I use Picaxe i2c all the time, it's a snitch. Why the hang up with PMW?, why do you bother with it at all?, a very simple timer function or even just a padded for-next loop is all that's required for a dew heater . Any thing faster than a 1 sec period is a waste of effort and just creates noise. An 8m2 will easily do the job with i2c.
Reply With Quote
  #65  
Old 24-01-2013, 10:18 PM
alistairsam's Avatar
alistairsam
Registered User

alistairsam is offline
 
Join Date: Nov 2009
Location: Box Hill North, Vic
Posts: 1,837
Hi,
I'd agree with Fred. I don't think pwm is necessary at all. I've got a 4 channel working fine based on freds code in post 48 using one 20m2.
for pwm and i2c, have a look at the x2 series, 20x2 or 28x2.
they have a lot of features and I have 3 x 20x2's at 64Mhz talking on I2C and pwm as well the hardware timer in the background.
I think 20m2's do that as well.
Are you making a remote controller? I couldn't find your post on the remote control Bob.
Reply With Quote
  #66  
Old 25-01-2013, 06:20 PM
rcheshire's Avatar
rcheshire (Rowland)
Registered User

rcheshire is offline
 
Join Date: Apr 2010
Location: Geelong
Posts: 2,617
If that's what you have on hand pwm is suitable and easy enough to do.

I bung a 22uf cap across the FET gate and GND which generates a slightly rounded at the peaks sawtooth wave +/- 0.05v. Is that smooth enough?
Reply With Quote
  #67  
Old 26-01-2013, 04:27 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,064
Quote:
Originally Posted by rcheshire View Post
If that's what you have on hand pwm is suitable and easy enough to do.

I bung a 22uf cap across the FET gate and GND which generates a slightly rounded at the peaks sawtooth wave +/- 0.05v. Is that smooth enough?
PWM is harder to do and just plain inappropriate for a dew heater application. Sledge hammering the out put with a cap is energy sapping and heat generating (in the wrong place), daft
Reply With Quote
  #68  
Old 26-01-2013, 08:50 PM
rcheshire's Avatar
rcheshire (Rowland)
Registered User

rcheshire is offline
 
Join Date: Apr 2010
Location: Geelong
Posts: 2,617
Quote:
PWM is harder to do and just plain inappropriate for a dew heater application. Sledge hammering the out put with a cap is energy sapping and heat generating (in the wrong place), daft
Oh dear! I guess that's the burning smell and smoke I see from time-to-time. Perhaps I don't need the capacitor after all? I guess it's a bit more convenient than holding a cigarette lighter under the lens. That got a bit tedious after a while.

Cheers Fred. Don't mention PWM - specifically with reference to dew heaters - got it! Totally inappropriate - silly, in-fact

Last edited by rcheshire; 27-01-2013 at 08:40 PM.
Reply With Quote
Reply

Bookmarks

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 03:23 PM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Advertisement
Bintel
Advertisement
Testar
Advertisement