hey guys, have had arduino, garagelabs version (garaguino), few months now. have played around little bit leds , pwm rgb led fade between colors. however, wanted bit more complex. decided wanted make myself new vaporizer, wanted include temperature set. vision have 3 digit 7-seg display 3 button inputs. 1 button mode-select navigation button, , other 2 up/down select buttons. in mind, came finite state machine system follows:
modes - digit select
digit set
fire
sleep
the machine starts in digit select.
digit select:
the current values set in each digit displayed , decimal point right of selected
digit lit up
if up/down button pushed decimal move left/right respectively signify new
selected digit
if select button tapped machine goes digit set mode set selected
digit
if select button held short duration machine goes fire mode
if select button held long duration machine goes sleep mode
digit set:
all of set values displayed , decimal point lit selected digit
if up/down button pushed value of selected digit increase/decrease respectively
if select button tapped machine goes digit select mode select different
digit
if select button held short duration machine goes fire mode
if select button held long duration machine goes sleep mode
fire:
brings heating element temp
if select button held go digit select mode temperature set change
sleep:
puts device in sleep mode
if button held short duration device wakes in digit select mode
currently trying drive 7-segment display correctly , respond button presses correctly. unfortunately sketch not compile due following errors:
my current sketch attached.
i have not put thought past setting temperature other plan on using pid library regulate temperature via transistor using pwm.
my immediate question doing wrong in code have? looked @ example came fsm (finite state machine) library, fail see did differently make not work.
my "long term question" advice/comments implementing pid controller alongside state machine. few challenges/issues can foresee after getting temperature heating element going exposed moving air, cool down due small mass (coil of kanthal). can pid handle kind of dynamic environment hold temperature? also, work/be safe if had 2 pairs of batteries in parallel somehow switched between series , parallel during operation? start out in series higher voltage bring coil temp quicker, switch parallel in order better battery life. i'm not sure how work, previous experience know coils can take while heat up, , initial higher voltage (double exact) heat faster. after switch have double duty cycle same output voltage , have make sure pid has slowed @ 50% duty cycle before switching. idea ramp time had somehow charge super-capacitor , discharge when bringing coil temp, have not experimented yet.
thoughts, questions, , comments far? plan on making available open source after functioning , give updates.
thanks in advance
modes - digit select
digit set
fire
sleep
the machine starts in digit select.
digit select:
the current values set in each digit displayed , decimal point right of selected
digit lit up
if up/down button pushed decimal move left/right respectively signify new
selected digit
if select button tapped machine goes digit set mode set selected
digit
if select button held short duration machine goes fire mode
if select button held long duration machine goes sleep mode
digit set:
all of set values displayed , decimal point lit selected digit
if up/down button pushed value of selected digit increase/decrease respectively
if select button tapped machine goes digit select mode select different
digit
if select button held short duration machine goes fire mode
if select button held long duration machine goes sleep mode
fire:
brings heating element temp
if select button held go digit select mode temperature set change
sleep:
puts device in sleep mode
if button held short duration device wakes in digit select mode
currently trying drive 7-segment display correctly , respond button presses correctly. unfortunately sketch not compile due following errors:
code: [select]
vaporizer.ino:29:9: error: no matching function call 'state::state()'
vaporizer.ino:29:9: note: candidates are:
in file included vaporizer.ino:2:0:
c:\users\toffer\documents\arduino\libraries\fsm/finitestatemachine.h:45:3: note: state::state(void (*)(), void (*)(), void (*)())
state( void (*enterfunction)(), void (*updatefunction)(), void (*exitfunction)() );
^
c:\users\toffer\documents\arduino\libraries\fsm/finitestatemachine.h:45:3: note: candidate expects 3 arguments, 0 provided
c:\users\toffer\documents\arduino\libraries\fsm/finitestatemachine.h:44:3: note: state::state(void (*)())
state( void (*updatefunction)() );
^
c:\users\toffer\documents\arduino\libraries\fsm/finitestatemachine.h:44:3: note: candidate expects 1 argument, 0 provided
c:\users\toffer\documents\arduino\libraries\fsm/finitestatemachine.h:42:7: note: state::state(const state&)
class state {
^
c:\users\toffer\documents\arduino\libraries\fsm/finitestatemachine.h:42:7: note: candidate expects 1 argument, 0 provided
vaporizer.ino: in function 'void sel_pressed_fnctn()':
vaporizer.ino:188:19: error: no match 'operator==' (operand types 'state' , 'state')
vaporizer.ino:189:21: error: no match 'operator==' (operand types 'state' , 'state')
vaporizer.ino:189:37: error: expected ';' before '{' token
error compiling.
my current sketch attached.
i have not put thought past setting temperature other plan on using pid library regulate temperature via transistor using pwm.
my immediate question doing wrong in code have? looked @ example came fsm (finite state machine) library, fail see did differently make not work.
my "long term question" advice/comments implementing pid controller alongside state machine. few challenges/issues can foresee after getting temperature heating element going exposed moving air, cool down due small mass (coil of kanthal). can pid handle kind of dynamic environment hold temperature? also, work/be safe if had 2 pairs of batteries in parallel somehow switched between series , parallel during operation? start out in series higher voltage bring coil temp quicker, switch parallel in order better battery life. i'm not sure how work, previous experience know coils can take while heat up, , initial higher voltage (double exact) heat faster. after switch have double duty cycle same output voltage , have make sure pid has slowed @ 50% duty cycle before switching. idea ramp time had somehow charge super-capacitor , discharge when bringing coil temp, have not experimented yet.
thoughts, questions, , comments far? plan on making available open source after functioning , give updates.
thanks in advance
bump
Arduino Forum > Using Arduino > Project Guidance > Need some help getting my idea up off the ground - Temperature controlled vape
arduino
Comments
Post a Comment