Author Topic: picaxe ?  (Read 18666 times)

0 Members and 1 Guest are viewing this topic.

Offline Cornelius

  • Full Member
  • ***
  • Posts: 57
  • Karma: +7/-0
  • Grimstad, Norway
Re: picaxe ?
« Reply #30 on: October 27, 2012, 01:37:13 am »
Quote
If temp comp is 750mS, and code hz is relaterd to pic effort,
couldn't that step be skipped 999 of 1000 times?

You're absolutely right. ;)

I have my bank in a cellar with 1 meter thick granite walls, so the temperature varies only 10°C during the whole year, so i could skip the variable temp. comp. alltogether... But i like the temp comp... ;)
And since i use the controller for solar only, the speed are not critical. As the code are now, it uses around 1.5 sec. from low idle to full dump.
 
Niall;
Using 1024 step-resolution in the pwmduty will more or less get rid of the hunting, but it will also slow down the response; you'll have to find a middle way. (steps of 5 or 10? )

Offline niall

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +16/-0
  • No Personal Text Set by User
Re: picaxe ?
« Reply #31 on: November 02, 2012, 02:27:48 pm »
the way the pic is set now Cornelius ( i keep changing things ) is , when it reads 430 , it treats this as zero , if it goes to 431 this becomes 1 and is multiplied by 13 ...so i have 78 steps of pwm up to  a sense reading of 508 ...a total of 1014 ..i hope  thats fairly close  ::)

roughly a window of 50 to 57v...easy on at 50 , full on at 57 ...( furling affected )  ....kind of ..ish ..:'(

standing with my ear to the mast is concerning the neighbors a bit , so a good excuse to get the logger working again ...

reasonably good winds but its a terrible site , lots of tail hunting going on ...





even though the site is bad it,s good for testing the picaxe  in a way ...the picture is,nt very clear but the green line is the voltage readings over 1 hour ...orange rpm ..white amps

with a swing of 7v at the top end there's a fair amount of spikes ...( furling is kicking in at the top level )

some stormy weather is needed to see when the elements conspire to do their damage ...all fun  :)


Offline Cornelius

  • Full Member
  • ***
  • Posts: 57
  • Karma: +7/-0
  • Grimstad, Norway
Re: picaxe ?
« Reply #32 on: November 02, 2012, 04:51:08 pm »
Seems to me that you have the voltage and the gen under good control. :)

And yes; fast and varying output from the gen are good to test the controller... But it would also be interesting to see how it performs under a good steady wind, too; preferrably close to furling. ;)

Offline niall

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +16/-0
  • No Personal Text Set by User
Re: picaxe ?
« Reply #33 on: November 03, 2012, 05:07:42 pm »
yes ...that would be the interesting bit ...but the mill may not play ball to soon on this one ...the only bit of clean (ish) wind comes from the north west across a small field at the back of the house ....

very dubious at best .....

i set the pic pwm  back down to 250 tonight ,(very windy today , mill maxing out at 956w ) running at 16m clock frequency ....

it seems ok with that ....all very confusing ...

edit..i had a small cheap pot on the v divider for the pic .....just taking this out has changed things a lot ...dont know,  but i read on threads where these pots can have one reading ...and the next day its something slightly different..... 

Offline niall

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +16/-0
  • No Personal Text Set by User
Re: picaxe ?
« Reply #34 on: January 25, 2013, 03:17:18 pm »
the circuits been running on the mill for a while now ......no other tweeking since...

the fan code plan did,nt quite work out .....using the pause command to pwm the heatsink fan was interfering with the rest of the code ....the pause in the code was  interupting realtime voltage sensing.....not a good idea

so now the temp code is just a simple on/off aux signal .....

final full code.....

Start: setfreq m16
       SYMBOL Volt = w0
       symbol niall= w1
       symbol temp = w2

init:   
       pwmout pwmdiv64,C.2,249,000       ;start pwm
Main:
    readadc10 4,Volt                     ;sample input volt
    readadc10 1,temp                   ;sample thermistor v on heatsink
   
     
   
   
   
   
    if volt<430 then let volt=430        ;set up volt window
    end if
    if volt>508 then let volt=508
    end if
   
     
    niall=volt-430                       
           
   
                                         ;compensate volt to act as 0-1000 duty ish
       
     
    niall=niall*13
   
       
    pwmduty C.2,niall
   
   
    if temp< 382 then high 0     ; have a feel of the heatsink   
    end if
    if temp> 382 then low 0 
    end if
    goto main




the pic has no " doomsday  " option ....so playing with a simple transistor 60v peak voltage trip might be an option ....fun if nothing else  :)...and will run at hi dc without any v regulation ...cheap too   



this is kind of a copy of one of  " fc solar circuits " voltage switchs....a small pnp is fired when zener diodes in series on its base sense enough v to turn on .... very experiential this bit

all the mill power goes directly into a dc immersion element added in to the oil heater .


Offline Burnit0017

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
  • No Personal Text Set by User
Re: picaxe ?
« Reply #35 on: January 25, 2013, 04:58:36 pm »
Hi, very nice load. Did you post the circuit that reads the voltage into the pic?

Offline niall

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +16/-0
  • No Personal Text Set by User
Re: picaxe ?
« Reply #36 on: January 25, 2013, 05:49:10 pm »
...i was just copying the basic backshed piclogger layout...Burnit

i though for 48v a 47k and 2k2 divider might be ok , with a 100n decoupler and no zener protection ...this should give a safe portion of the 5v window to the pic ....ish

thats pretty much the sense input v at the moment on pin 4 of the pic ...not much else......

a multi turn pot with the 47k is usefull i think ......it works well in tandem with code .......trim the Resistance and the code readings can compensate at the same time ...kind of ....

i,m  sure theres other ways to do the same thing .....the pic seem,s  very adaptable .... :) 

Offline niall

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +16/-0
  • No Personal Text Set by User
Re: picaxe ?
« Reply #37 on: March 02, 2015, 04:35:23 pm »
the thread is a bit old now , but i thought i,d update it as its an ongoing control system for the mill .....

capacitors are the 1k mills "battery".....and these are failing periodically ....you get that unique smell and somethings wrong , the picaxe,s  pwm led indicator goes a little rough ...you can feel it in the mill too ( a different rumble )

i have about 15000uf at 80v ....30,000uf  would be required , i thought i would get away with less ....thats what thinking did

Hugh recommends a min of 25000uf 100v on his ldr,s .....should have stuck to that

3802-0

this cap did,nt swell but started shorting inside near the - terminal.....

the picaxe/ fets settled down with the replacement cap .....the chip and fets are cheap , the caps ...not some much

 i guess thats the trade off....

the older the mill gets the more maintenance it needs ...some of last summers repairs

3807-1


.