The RC modelling fraternity are doing it all the time, so an RC forum might be better able to help you there. Servos are available for only a few $ online. Basically, the PIC needs to generate pulses of (IIRC) 1ms to 2ms width every 25ms or so. Pulse width controls servo position.i have to see if i can get hold of som RC servo units and find a way to controll it with a PIC ..
;==============================;
; Subroutine to service servos ;
;==========================================================================================
; This routine is used to control basic RC servos. You first load "channel"
; with the bit mask of the specific bit, and thus, specific servo you want
; to move. Then, you load position with where you want it to move to. Then
; You call "servo" and this routine does the rest.
;
; In practice, it will look like this...
;
; ~Code~
;------------------------------------------------------------------------------
; movlw b'00000001' ; Which bit of the port is
; movwf channel ; the servo control wire on? (here, we have bit0)
;
; movlw .50 ; What angle to move it to?
; movwf position ; 0 > X > 100 (here, we have ~center)
;
; call servo
;------------------------------------------------------------------------------
; And here are the variables you need to make it work.
;
; ; Delay vars
; count
; count1
; ; Servo vars
; settle
; channel
; position
;
;==========================================================================================
;{
servo
movlw .10 ; we need to loop this subroutine enough
movwf settle ; times to make the servo "get the message"
loop
movlw .200 ; Delay for ~20ms
call delay_x00us ;
movlw channel ; Use a bit mask to select
movwf PORTB ; Which particular servo to move.
movlw .100 ; Delay for 1ms with
call delay_x0us ; pin at logic HIGH(1)
movwf position ; Where to move the platters
call delay_x0us ;
clrf PORTB ; Clear PORTB, ending the pulse.
decfsz settle, 1 ; Loop for ~1 second so the
goto loop ; servos have time to settle in
RETURN
;}
;===========================================================================================
; Delay in hundreds of microseconds ;{;=====================================================
delay_x00us
movwf count1 ; Load Counter from working then increment
incf count1, 1 ; it ounce to correct a blank value roll over
call delay_100us ;
; Call 100us delay routine, count # of times
decfsz count1,f ;
goto $ -2 ;
bcf STATUS, RP0 ; Access bank 0
return ; return from subroutine ;}
;===========================================================================================
; Delay in tens of microseconds ;{ ; Call = (2 Cycles) ====================================
delay_x0us
movwf count1 ; Load Counter from working then increment
incf count1, 1 ; it once to correct a blank value roll over
call delay_10us ;
; Call 10us delay routine, count # of times
decfsz count1,f ;
goto $ -2 ;
bcf STATUS, RP0 ; Access bank 0
return ; return from subroutine ;}
;===========================================================================================
; Delay for 10 microseconds ;{ ; Call = (2 cycles) ========================================
delay_10us
movlw 0x0F ; Repeat 15 machine cycles (1 cycle)
movwf count ; Store value in counter (1 cycle)
decfsz count, 1 ; Decrement counter (2 cycles)
goto $ -1 ; Continue if not 0 (2 cycles)
return ; End of delay ;}
;===========================================================================================
; Delay for 100 microseconds ;{ ; Call = (2 cycles) =======================================
delay_100us
movlw 0xA4 ; Repeat 164 machine cycles (1 cycle)
movwf count ; Store value in counter (1 cycle)
decfsz count, 1 ; Decrement counter (1 cycle)
goto $ -1 ; Continue if not 0 (2 cycles) 4 + (164 * 3) = 496
goto $ +1 ; 497 + 498
nop ; 499
return ; End of delay (1 cycle for 500 cycles total) ;}
;===========================================================================================
You need a speed sensor, PID control and output adjusting the speed based on the PID error correction.
Microchip has app notes on PID with a PIC. A hall sensor or tachometer input from the coil can give u the speed data. Then all u need is a throttle body with an E throttle so u can control it with an electrical signal. No diddling with servos or steppers, these things are OTC or available form a junkyard and are quite reliable. This is fuel injected I presume?
I'd suggest a PIC 16f886 as the baseline PIC: built in comparators , T0CK, PWM,RS232 comms for PC monitoring or remote speed changes, EPROM for rembering setup, internal clock of 8MHZ , up to 20MHz with a crystal, lots of I/O for creating an independent HMI for local control, eg LCD panel or touch screen. the 16f886 can also do capacitive touch pads for input , great for grimy/greasy environments.
I'm also thinking about running the engine on producer gas from a gassifier
The gassifier i have in mind is not the 55 gallon drum type .. my idea is to have a two camber setup . one camber is the burn camber witch provides the heat to gassifie the feedstock in the second chamber , where it will be gassified in an oxygen starved inviroment.. This setup wil be able to use any carbon based material as a feedstock.
When it comes to the power i will be needing i guess a 10KW unit would be enough but i'm looking to be able to grow plants indoors in the wintertiem and depending on the size of the building i will have the ligh alone can use more than 10 kw ..
Since i'm going to use a ssr connectet to the PIC to turn on the ignition i guess the engine will stop if the PIC die since the SSR will loose it's input from the mcu and shut off the engine
You do understand that a major combustible gas produced by a bio-mass gasifier is actually carbon monoxide, right? And that you will require oxygen to make carbon monoxide gas out of a solid carbon source. You can't simply heat dry carbon in an oxygen starved environment, that won't work. Now doing that with bio-mass, like wood, can distill out volatiles like methanol and toluene. It can also create hydrogen gas through steam reforming if there is enough water present. But your method will not make solid dry carbon into carbon monoxide. You need oxygen to do that.
Yes, I am not pulling your leg. Carbon monoxide gas absolutely is 100% combustible. It's carbon DIOXIDE that is not combustible. If you don't believe me, at the very least, you will still need carbon monoxide to make hydrogen through steam reforming. Finally, carbon monoxide gas also happens to be a cyanide class of poison, which will kill you dead through cellular asphyxiation in fairly small concentrations. So... be careful, and don't try and operate something like this indoors. OK?
***** EDIT *****
I assume that you are expecting these Wattage figures for your light because you plan on using several large typical high pressure sodium or Halide grow lamp? If so, you should be aware that these types of lamps dissipate most of their energy as heat, and what they do convert to light is not all centered at the optimal spectrum for plant growth. Though they are mostly on target.
I personally have been watching the very high power/performance LED grow lights that have started to come out recently. For one, LED's can be a more efficient electricity to light conversion method than alternatives, meaning less of your energy is converted to heat. Secondly, they are usually tailored to the exact spectrum of light plants use to grow. So more of the light made is actually absorbed by the plants. Watt per growth rate LED grow lamps are about 2.5 to 3 times more powerful that others. So a 300 Watt LED lamp is pretty much the same as a 1000 Watt HPS lamp, with a fraction of the heat output.
Then again, the LED grow lights can be pricey, but are usually about $1 a watt if your getting a good deal. So the above 300 Watt LED lamp will run you $300~$500. And if as you say, you are intending to grow during the winter, you may actually want to have the extra heat produced by the other less efficient lamps. As I said though, LED lamps do not produce nearly as much heat, so you can not rely on them as heaters.
***** EDIT *****
Guessing = bad.
(hypothetically) If the PIC gets shocked, it can easily take the pin that powers the SSR, and short it directly to Vcc, which of course would hold the SSR on.
Again, one simply can not know what a CMOS chip is going to do if and when it gets hit with a HV spike. You can only (fairly accurately) approximate it statistically. 99 times out of 100, it's going to just short internally, blow up, then go open circuit. In some situations, 99% chance is perfectly fine. But don't think that 99% is as good as a sure thing, because it can easily do just about anything. It might short a pin to Vcc, might short a pin to ground, might go open, might get stuck in some unimaginably convoluted loop that rapidly toggles a pin. Aside from something absurd like purple monkeys flying out of the thing, if you can imagine it, the PIC could do it after getting hit with HV. One just can't know for sure.
The only thing you can be sure of, is the odds of being able to accidentally reproduce complex "safety signal" become statistically impossible the more complex that signal is. This is why, for a virtually 100% safe design, one wants to use just such a signal fed into a watchdog circuit. Ideally with the watchdog circuit having it's own protection to > 2x of the HV areas voltage.
But I digress, realistically we talking about the kinds of design choices that are really only necessary for very safety critical applications. Airplanes, medical devices, NASA space craft, military weapons systems, nuclear power plants, and so on and so forth. Most of the time, lots of lives are at stake with these things, not just your own.
Thanks for the links .. i guess your project are more than i need for a regular speed governor but i wil have a closer look and maybe i find something i can use for my projectWell this thread has tickled my memory. A couple years ago I designed and built (made a few), add on performance controllers for turbo vehicles based on the 16f886. Used ALL the I/o and then some via double/triple duty.
Anyway It has a robust power supply section with both tranzorb and MOV suppression to meet automotive standard.
https://www.electro-tech-online.com/custompdfs/2013/02/autotransients.pdf
Sensors included Mass air flow, oxygen/AFR, coil - tacho via an optoisolator, Primary MAP - boost control, secondary MAP for dynamic barometric boost control.
The design featured a relatively new electronic blow off valve controller to optimize boost conservation between gearshifts. There are 3 closed (PID) and 3 open loop tables for boost control over all conditions.
There is an 18 item hierarchical menu structure with both pseudo analog and 4 digit 7 segment displays capable of displaying independent data sets.
Anyhow I attach the schematic and board layout and draft user manual.
Note the schematic power supply section and components WILL handle ALL auto transients. It uses a staged transient snubber, a tranzorb for the fast low power transients backed by an MOV of slower 'load dump' handling and the regulator is automotive grade with a 60V input tolerance suitable for 24 Volt jump starting tolerance etc.
There are separate digital /analog power sections to handle ground bounce due to hi current switched inductive loads via the 4 NFET output drives.
FYI there's about 6.6Kb of pure machine code in the programming for all the features.
One thing is even though we both are talking about gassification we are also talking about two different system .. What you say about oxygen do apply to the one chamber design where the oxygen is mostly used to maintian the heating of the feedstock. My system will use the same amount of air as the Drum based gassifers but i have separated em in to 2 different chambers and the chamber for the feedstock will have a oxygen STARVED enviroment.. no mater what design you are usine to much oxygen ( like to much air) will resulit in a burning feedstock or worse, an explosion ...
since my governor setup will be used for both gasoline and diesel engines i will go for a magnet picup solution but you are right the cmos could leave the SSR in an on state but there are optocoupler and other solutions to deal with it in case it's needed and i will look into em if i find out i will go for a solution using the coil as a trigger
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?