EPG Testing sequential pulsar using the Arduino

firepinto

RE: EPG Testing sequential pulsar using the Arduino
« Reply #51, on May 26th, 2011, 05:33 PM »
That is just going to be awesome!

I can see a use for this on my 10 cell series HHO project, when I get around to resurrecting it. lol I had planned on using my Thunderbird tail light sequencer set up to sequentially short out cells.  Running at 12 volts is 1.2 volts per cell, so shorting out 2 or 3 cells raises the voltage on the remaining cells to get into production range.  It is a pump through dry cell design, so the 'off' time for the shorted cells gives time for bubbles to be washed off the plates ready for its 'on' time with fresh electrolyte and full surface area.  This code with the arduino will be awesome for changing on the fly and regulating cell voltage.

Nate

txqNL

RE: EPG Testing sequential pulsar using the Arduino
« Reply #52, on May 26th, 2011, 05:47 PM »Last edited on May 26th, 2011, 06:38 PM by txqNL
Quote from Rwg42985 on May 26th, 2011, 01:13 PM
Isolator Driver Schematic!

This is just the PCB and schematic, I will draw up the Arduino Schematic soon!

Let me know what you think! ~Russ
Here a list of my thoughts;
- pcb; no copper over the isolater border, so 78xx has to move
  to other side of board.
- pcb: no copper under the isolaters
- pcb: preferably fully balanced, so every path is ~same lenght.
- pcb: independent output connectors with ground.
- pcb: maybe fillup empty space with ground.
- pcb: One layer with a few wire bridges is easer to make.
- before LM and cap place a diode so reverse power cannot do harm.
- after LM 0.1uf cap I place also a small cap like a ~30nf.
- IC1 needs 10nf cap.
- Mosfet drivers give the best fall/rise times for switching mosfets
  (I use now mc34152, 2 channel inverted driver in dil8 chip)
- R1-R6 looks a bit low, for ~5v 470-600 is used for leds.
  havent calulated for 2N38A but it uses 80-120ma most leds
 do about 30–60ma.
- D1-D6 are already in mosfet, but you need emf short diode between
  mosfet drain output and main postive input.
  (so coil voltage cannot raise above input voltage while sw is open)
- Add fuse on power line.
- And one very important output leds !! (on mosfet driver side)
- power led on regulated power line.
- note: 5v is sometimes to low(found some heavy mosfets in pc power
which worked at 8v before switching)
- Could you make as 8 output ? Then 1 board can work from 3 to 6 output and 2 boards in extended mode would give 16 out.
Which is very nice for 8 coil muller setup 8 power out and 8 shorting outs.

Thats why i need to redo the step duty stuff so that timer2 is free again for calculating motor/coil rpm/freq. Then pulse train speed
correction can be made auto so it can work for pulse motors with one hall sensor.

That irfp2907 mosfet is a very nice one, the Rds(on) is 4.5mOhm which is very low. Two+Two of those in coil shorting gives 4.5mOhm resistance which is lower then the 'required' 0.005 Ohm.
I now test with 5+5 irfz44n which is 17.5mOhm so total 0.007 Ohm.





Quote from firepinto on May 26th, 2011, 05:33 PM
That is just going to be awesome!

I can see a use for this on my 10 cell series HHO project, when I get around to resurrecting it. lol I had planned on using my Thunderbird tail light sequencer set up to sequentially short out cells.  Running at 12 volts is 1.2 volts per cell, so shorting out 2 or 3 cells raises the voltage on the remaining cells to get into production range.  It is a pump through dry cell design, so the 'off' time for the shorted cells gives time for bubbles to be washed off the plates ready for its 'on' time with fresh electrolyte and full surface area.  This code with the arduino will be awesome for changing on the fly and regulating cell voltage.

Nate
Thats a cool idea, have you tried that already and what was the increase ?

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #53, on May 28th, 2011, 08:16 AM »
William!

I need a'n operaters manual... :)

The way this program work is actuley cinda complex for a simple user to operate, but that's to be expected as we/you build the code...

Right now I have a Copple of requests so I can start my testing! Tuesday or wensday!

 One, how do I set this up so one pot will adjust the frequency of the pulsing, and the other pot will adjust the duty cycle.?

I get the train to do some stuff but I can't get each pulse or led to change correctly?

Then, pulse modes, on version .4 there was this 2 led pulse mode thing... I like that! Where did it go? Lol

Think of some intresting pulse modes and add them! Lots of options for random pulse testing would be helpfull!

This is so sweet and can't thank you enuf for your help! We should chat agin early next week for a walk threw! But for now how doni get that pot to work???

Thanks!!! ~Russ    

firepinto

RE: EPG Testing sequential pulsar using the Arduino
« Reply #54, on May 28th, 2011, 03:00 PM »
Quote from Rwg42985 on May 28th, 2011, 08:16 AM
Think of some intresting pulse modes and add them! Lots of options for random pulse testing would be helpfull!
I vote for a Knight Rider style sequencing, just because.  :D  The wooshing noise would be a bonus. lol jk

How about a sequencing that is an inverse style?  The outputs would be sequenced off instead of on.

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #55, on May 28th, 2011, 03:09 PM »
Quote from firepinto on May 28th, 2011, 03:00 PM
Quote from Rwg42985 on May 28th, 2011, 08:16 AM
Think of some intresting pulse modes and add them! Lots of options for random pulse testing would be helpfull!
I vote for a Knight Rider style sequencing, just because.  :D  The wooshing noise would be a bonus. lol jk

How about a sequencing that is an inverse style?  The outputs would be sequenced off instead of on.
Actuly I need the night rider also! So I can ossalate  the gas to simulate a 60 HZ AC signal.

~Russ


~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #57, on May 29th, 2011, 05:45 AM »
Quote from firepinto on May 28th, 2011, 09:19 PM
I got my Arduino Uno :-) and I have an LCD but not sure how it should be hooked up.  It is a Displaytech 162A.  I found the PDF for it here:

http://www.glyn.de/data/glyn/media/doc/162a%20series-v11.pdf

Will this work with pulsefire?

Nate
Nate, yes, that will work just fine!

Also, look at the beginning of the code for the pinout of the arduino. I will wright up a diagram soon!

Just look at the pinout of your data sheet.

There is also a demo on the Arduino web site that will get you going on understanding it!

Get back with you soon on the full schematic! But for now look at the beginning of the code!

~Russ      

txqNL

RE: EPG Testing sequential pulsar using the Arduino
« Reply #58, on May 29th, 2011, 12:59 PM »Last edited on May 29th, 2011, 01:10 PM by txqNL
Quote from Rwg42985 on May 28th, 2011, 08:16 AM
William!

I need a'n operaters manual... :)

The way this program work is actuley cinda complex for a simple user to operate, but that's to be expected as we/you build the code...

Right now I have a Copple of requests so I can start my testing! Tuesday or wensday!

 One, how do I set this up so one pot will adjust the frequency of the pulsing, and the other pot will adjust the duty cycle.?

I get the train to do some stuff but I can't get each pulse or led to change correctly?

Then, pulse modes, on version .4 there was this 2 led pulse mode thing... I like that! Where did it go? Lol

Think of some intresting pulse modes and add them! Lots of options for random pulse testing would be helpfull!

This is so sweet and can't thank you enuf for your help! We should chat agin early next week for a walk threw! But for now how doni get that pot to work???

Thanks!!! ~Russ
Manual indeed I would start one when Arduino is maxed out of memory of other limits, then do final nameing check and order check.
For example pulse mode 4 with the pulse_seq_* vars could also be named TDM like feature.
The train_* is PWM timing some pulse_* out OUT(put) controllers.
That would make a diagram mush more readable.

"One, how do I set this up so one pot will adjust the frequency of the pulsing, and the other pot will adjust the duty cycle.? "

Analog input values and mapped to variables seen in the info:
sys_adc_map4==4 65535 0 0
sys_adc_map5==5 65535 0 0

sys_adc_mapX==X
Meaning A4 and A5 not current not mapped.

The variable-idx is a number of variable which is the same as in menu and help list; (while typing added the idx to help cmd output)
Code: [Select]

train_loop==0
train_loop_delta==1
train_tcnt==2
train_tcnt_delta==3
train_clock==4
step_loop==5
step_loop_delta==6
step_tcnt==7
step_tcnt_delta==8
step_clock==9
pulse_steps==10
pulse_duty==11
pulse_mask==12
pulse_trigger==13
pulse_mode==14
pulse_init==15
pulse_seq_off==16
pulse_seq_type==17
pulse_seq_data==18
pulse_seq_len==19
lpm_start==20
lpm_stop==21
lpm_size==22
sys_lcd_time==23
sys_menu_time==24
sys_adc_time==25
sys_adc_jitter==26
sys_input_time==27
sys_input_delay==28
sys_start_secs==29
sys_start_duty==30
sys_conn_mode==31
sys_push_mode==32


Some examples;
root@pulsefire: sys_adc_map 4 0 10 10000
Mappes A4 to train_loop with range of 10-10000.

root@pulsefire: sys_adc_map 4 10 1 6
Mappes A4 to pulse_steps with range of 1 to 6 outputs.

root@pulsefire: sys_adc_map 4 11 0 1500
Mappes A4 to pulse_duty 0-1500, this is the duty of the full pulse train.

There is also "special" mapping idx for non-config input which is currently;
case 101:pf_data.lpm_level
case 102:pf_data.req_train_freq_high
case 103:pf_data.req_train_freq_low

root@pulsefire: sys_adc_map 4 102 0 300
Mappes A4 to req_train_freq with 0 to 300 hz.

To see set pot 50% ~ 150hz and set pulse_steps 2 and lcd will
say ~74Hz for 2 outputs which is 150hz on one out.

Mapping 103 should be from 0-9 but had better results with 0-~17.
Step duty is a bit harder with the raw step_* variables but that
will change into one variable in next release.


"Then, pulse modes, on version .4 there was this 2 led pulse mode thing..."

root@pulsefire: pulse_mode 4
Select seq mode which btw /16 the freq of train.

root@pulsefire: sys_adc_map 5 16 0 15
Map A5 to pulse_seq_off range 0-15 bits in future.

root@pulsefire: pulse_seq_data 65535
Set custom bit data on all 16pulses to ON, now output looks like
normal train mode.

Just started to make this seq_data * 16 so it can be configured for
every output seperatly.



Quote from firepinto on May 28th, 2011, 03:00 PM
I vote for a Knight Rider style sequencing, just because.  :D  The wooshing noise would be a bonus. lol jk

How about a sequencing that is an inverse style?  The outputs would be sequenced off instead of on.
Very nice will add a mode for that :)
The inverse output is on the todo for sequenced off output or use of (dual/none)inverting output drivers.

firepinto

RE: EPG Testing sequential pulsar using the Arduino
« Reply #59, on May 29th, 2011, 09:49 PM »
Quote from Rwg42985 on May 29th, 2011, 05:45 AM
Nate, yes, that will work just fine!

Also, look at the beginning of the code for the pinout of the arduino. I will wright up a diagram soon!

Just look at the pinout of your data sheet.

There is also a demo on the Arduino web site that will get you going on understanding it!

Get back with you soon on the full schematic! But for now look at the beginning of the code!

~Russ
OK i'll check that out tomorrow.:-)  I did a quick scan through the code but didn't notice.  Sure looks like this wasn't easy for William to do!  I guess it might look easier if you know how the code works.  Only code I've half way taught myself is Visual Basic .net :-/  I'm looking forward to pulsing the 4 circuits of my Quad9 coil with this thing in sequencer mode. Rotational magnetic field?  :cool:

firepinto

RE: EPG Testing sequential pulsar using the Arduino
« Reply #60, on May 30th, 2011, 01:47 PM »Last edited on May 30th, 2011, 01:52 PM by firepinto
Quote from txqNL on May 26th, 2011, 05:47 PM

Quote from firepinto on May 26th, 2011, 05:33 PM
That is just going to be awesome!

I can see a use for this on my 10 cell series HHO project, when I get around to resurrecting it. lol I had planned on using my Thunderbird tail light sequencer set up to sequentially short out cells.  Running at 12 volts is 1.2 volts per cell, so shorting out 2 or 3 cells raises the voltage on the remaining cells to get into production range.  It is a pump through dry cell design, so the 'off' time for the shorted cells gives time for bubbles to be washed off the plates ready for its 'on' time with fresh electrolyte and full surface area.  This code with the arduino will be awesome for changing on the fly and regulating cell voltage.

Nate
Thats a cool idea, have you tried that already and what was the increase ?
I haven't tried it as of yet.  About the time I was close to getting it fired up back in '04 it was winter time and electrolyte don't like Wisconsin winters lol  Some day I'll pull that project back out.

Nate
Quote from firepinto on May 29th, 2011, 09:49 PM
OK i'll check that out tomorrow.:-)  I did a quick scan through the code but didn't notice.  Sure looks like this wasn't easy for William to do!  I guess it might look easier if you know how the code works.  Only code I've half way taught myself is Visual Basic .net :-/  I'm looking forward to pulsing the 4 circuits of my Quad9 coil with this thing in sequencer mode. Rotational magnetic field?  :cool:
OK so I have my LCD working and some LED's pulsing!  I seem to have something backwards though because all the LEDs are on and pulsing off?  I haven't figured out how to speed up the pulse train yet either.  :s

txqNL

RE: EPG Testing sequential pulsar using the Arduino
« Reply #61, on May 30th, 2011, 07:45 PM »
Quote from firepinto on May 30th, 2011, 01:47 PM
OK so I have my LCD working and some LED's pulsing!  I seem to have something backwards though because all the LEDs are on and pulsing off?  I haven't figured out how to speed up the pulse train yet either.  :s
Are your leds connected to ground ? for speed try train_loop or req_train_freq or map the variable to analog input for pot see prev post.

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #62, on May 30th, 2011, 08:18 PM »
Quote from txqNL on May 30th, 2011, 07:45 PM
Quote from firepinto on May 30th, 2011, 01:47 PM
OK so I have my LCD working and some LED's pulsing!  I seem to have something backwards though because all the LEDs are on and pulsing off?  I haven't figured out how to speed up the pulse train yet either.  :s
Are your leds connected to ground ? for speed try train_loop or req_train_freq or map the variable to analog input for pot see prev post.
Dude! This thing is amazing! I can not thank you enuff will!

Nate, I'm drawing up a schmatic for the Arduino tomorrow. Are u pulsing the LEDs from the arduino or from mosfets?

Thanks all!!! ~Russ

firepinto

RE: EPG Testing sequential pulsar using the Arduino
« Reply #63, on May 30th, 2011, 09:12 PM »
Quote from Rwg42985 on May 30th, 2011, 08:18 PM
Quote from txqNL on May 30th, 2011, 07:45 PM
Quote from firepinto on May 30th, 2011, 01:47 PM
OK so I have my LCD working and some LED's pulsing!  I seem to have something backwards though because all the LEDs are on and pulsing off?  I haven't figured out how to speed up the pulse train yet either.  :s
Are your leds connected to ground ? for speed try train_loop or req_train_freq or map the variable to analog input for pot see prev post.
Dude! This thing is amazing! I can not thank you enuff will!

Nate, I'm drawing up a schmatic for the Arduino tomorrow. Are u pulsing the LEDs from the arduino or from mosfets?

Thanks all!!! ~Russ
I'm pulsing from the arduino.  I found the problem, a stupid mistake!  :blush:  It slipped my mind that they are ... um .. diodes. :blush:  I'll try the other settings, I did get some more speed out of it.  This thing truly is amazing.
  I started building a 4 channel Mosfet board from old UPS parts today.  A trial run I'll use for my rodin coils before I order the parts to dupicate Russ's circuit.  

Nate

HHOstar

RE: EPG Testing sequential pulsar using the Arduino
« Reply #64, on May 30th, 2011, 09:40 PM »
Quote from Rwg42985 on May 15th, 2011, 11:44 AM
Quote from txqNL on May 15th, 2011, 11:20 AM
Version 0.5 is almost done now, hope i can release it before end of the week.
Here are already some changes made;
- Seqence mode offset looks working now
- Fixed custom init data reversal in reverse mode
- Added input validation for Serial and Lcd.
- Given LCD UI all config options to change.
- Added auto push mode which pushes config changes to serial
- Added output masking for disabling some outputs
- Spilt info into 3 commands info_conf,info_data and info_calc
- Changed adc mapping now all config variables can be mapped.
- Fixed flashmode output steps limit
- Change _inc to _delta and added _tcnt_deltas's so now we have
4 config values which puts the fire in the pulse.
- start added auto lpm messurement code for freq tuning feature.
- start working on req_train_freq command.

So now working in the code for freq and I want to see some values
behind the dot for example Hz: 123.123
(but without using floats but need to get my mind around it first)
Oooooo..... Nice!!! Cant wait!!!!! Lost of hard work I can see!! Sweet!!! thank you!!! ~Russ
Russ very nice I like the plastic display as your incasement. You always marvel me with your intuity. The sander turned into a lathe is classic. You do great work and are very motivating. By the way you never talk toooo much I think that is our biggest downfall as humanity, more communication of communication is always better. Take care God bless and thanks for everyones input and hardwork. You guys all should be congardulated, thanks again!

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #65, on May 31st, 2011, 07:59 PM »Last edited on June 3rd, 2011, 03:17 AM by ~Russ/Rwg42985
here is the simple setup wiring schematic.

Willem (did i spell your name correct this time... Sorry!)

  please check my work...

OK so here is the schematic!



Should be easy to read... you will need to zoom in on your PC to see all the text...

Thanks, ~Russ

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #66, on May 31st, 2011, 08:03 PM »Last edited on June 3rd, 2011, 03:18 AM by ~Russ/Rwg42985
your going to need to just right click and save as. to view the schematic... sorry kinda big lol

here is the link just in case...

schmatic
~Russ

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #67, on May 31st, 2011, 08:05 PM »
Quote
Russ very nice I like the plastic display as your incasement. You always marvel me with your intuity. The sander turned into a lathe is classic. You do great work and are very motivating. By the way you never talk toooo much I think that is our biggest downfall as humanity, more communication of communication is always better. Take care God bless and thanks for everyones input and hardwork. You guys all should be congardulated, thanks again!
Thanks man! its a pleasure to get the feed back from people like you and the help of others... that my motivation out side of you know... creating something good for man kind... lol[/quote]Really! thank you!

~Russ

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #68, on May 31st, 2011, 08:19 PM »
Quote
Manual indeed I would start one when Arduino is maxed out of memory of other limits, then do final nameing check and order check.
For example pulse mode 4 with the pulse_seq_* vars could also be named TDM like feature.
The train_* is PWM timing some pulse_* out OUT(put) controllers.
That would make a diagram mush more readable.

"One, how do I set this up so one pot will adjust the frequency of the pulsing, and the other pot will adjust the duty cycle.? "

Analog input values and mapped to variables seen in the info:
sys_adc_map4==4 65535 0 0
sys_adc_map5==5 65535 0 0

sys_adc_mapX==X
Meaning A4 and A5 not current not mapped.

The variable-idx is a number of variable which is the same as in menu and help list; (while typing added the idx to help cmd output)
Code: [Select]

train_loop==0
train_loop_delta==1
train_tcnt==2
train_tcnt_delta==3
train_clock==4
step_loop==5
step_loop_delta==6
step_tcnt==7
step_tcnt_delta==8
step_clock==9
pulse_steps==10
pulse_duty==11
pulse_mask==12
pulse_trigger==13
pulse_mode==14
pulse_init==15
pulse_seq_off==16
pulse_seq_type==17
pulse_seq_data==18
pulse_seq_len==19
lpm_start==20
lpm_stop==21
lpm_size==22
sys_lcd_time==23
sys_menu_time==24
sys_adc_time==25
sys_adc_jitter==26
sys_input_time==27
sys_input_delay==28
sys_start_secs==29
sys_start_duty==30
sys_conn_mode==31
sys_push_mode==32


Some examples;
root@pulsefire: sys_adc_map 4 0 10 10000
Mappes A4 to train_loop with range of 10-10000.

root@pulsefire: sys_adc_map 4 10 1 6
Mappes A4 to pulse_steps with range of 1 to 6 outputs.

root@pulsefire: sys_adc_map 4 11 0 1500
Mappes A4 to pulse_duty 0-1500, this is the duty of the full pulse train.

There is also "special" mapping idx for non-config input which is currently;
case 101:pf_data.lpm_level
case 102:pf_data.req_train_freq_high
case 103:pf_data.req_train_freq_low

root@pulsefire: sys_adc_map 4 102 0 300
Mappes A4 to req_train_freq with 0 to 300 hz.

To see set pot 50% ~ 150hz and set pulse_steps 2 and lcd will
say ~74Hz for 2 outputs which is 150hz on one out.

Mapping 103 should be from 0-9 but had better results with 0-~17.
Step duty is a bit harder with the raw step_* variables but that
will change into one variable in next release.


"Then, pulse modes, on version .4 there was this 2 led pulse mode thing..."

root@pulsefire: pulse_mode 4
Select seq mode which btw /16 the freq of train.

root@pulsefire: sys_adc_map 5 16 0 15
Map A5 to pulse_seq_off range 0-15 bits in future.

root@pulsefire: pulse_seq_data 65535
Set custom bit data on all 16pulses to ON, now output looks like
normal train mode.

Just started to make this seq_data * 16 so it can be configured for
every output seperatly.
will, hows those updated pulse sequences coming?

also im getting the hand of it now but still have some questions.

like whats the number for making each led change duty cycle with in the pulse train, and not the pulse train duty?

so you have a list of command numbers... but in that list 102 is not there? ans that's confusing me.
Quote
root@pulsefire: sys_adc_map 4 102 0 300
Mappes A4 to req_train_freq with 0 to 300 hz.
where did you get the number 102? its not on the list that list had 0-32 on it? i must be missing something?

any hoo i am picking it up so thanks for the help!

~Russ

firepinto

RE: EPG Testing sequential pulsar using the Arduino
« Reply #69, on June 1st, 2011, 05:46 AM »
Quote from Rwg42985 on May 31st, 2011, 08:03 PM
your going to need to just right click and save as. to view the schematic... sorry kinda big lol

here is the link just in case...

schmatic
~Russ
Awesome Russ,

Does the trigger type switch make the pots unused when it is switched to external pulse source?  The pots i bought happen to have SPDT switches on them.  I could use that if the pots aren't needed in that mode.

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #70, on June 1st, 2011, 07:48 AM »
Quote from firepinto on June 1st, 2011, 05:46 AM
Quote from Rwg42985 on May 31st, 2011, 08:03 PM
your going to need to just right click and save as. to view the schematic... sorry kinda big lol

here is the link just in case...

schmatic
~Russ
Awesome Russ,

Does the trigger type switch make the pots unused when it is switched to external pulse source?  The pots i bought happen to have SPDT switches on them.  I could use that if the pots aren't needed in that mode.
Even more awesome is that the pots are programable... Thats the beauty of what willem has done...

So you answer Is kinda... If your using the pots for the Frequancy adjustment then yes. But if you are using the pot for let's say number of outputs then no...

This thing is so sweet all by how willem has programed it...

So you will interface the mapping of the pots via the arduino serial moniter in the arduino program on your pc.

Read what willem posted in his earlier postes. I asked how to program the pots...

It is kinda complicated but once you get it... It's realy stright foreword.

~Russ          

txqNL

RE: EPG Testing sequential pulsar using the Arduino
« Reply #71, on June 1st, 2011, 09:06 AM »Last edited on June 1st, 2011, 09:47 AM by txqNL
Quote from Rwg42985 on May 31st, 2011, 08:19 PM
will, hows those updated pulse sequences coming?

also im getting the hand of it now but still have some questions.

like whats the number for making each led change duty cycle with in the pulse train, and not the pulse train duty?

so you have a list of command numbers... but in that list 102 is not there? ans that's confusing me.  

where did you get the number 102? its not on the list that list had 0-32 on it? i must be missing something?

any hoo i am picking it up so thanks for the help!

~Russ
Those number above 100 are not config variables which are indexed but internal data variable which are not indexed.
So for the few we can use in the mapping there is some code which
maps the 100+ numbers to the internal data like;
case 101:pf_data.lpm_level
case 102:pf_data.req_train_freq_high
case 103:pf_data.req_train_freq_low
(The 100+ is there so there is space for adding more config variables)

"each led change duty cycle"
That can be ~done with the step_* cmds but is a bit limited.
Also this brings me to the update because I've removed the step_* and replaced it with per output duty counter.
It is looking like this; (train_* -> pwm_ and _seq_* -> ppm_)
Code: [Select]

root@pulsefire: info_conf
pulse_enable==1
pulse_mode==2
pulse_steps==8
pulse_trigger==0
pulse_dir==0
pulse_data_inv==0
pulse_data_mask==65535
pulse_data_init==1
pulse_delay_pre==0
pulse_delay_post==0
pwm_compa0==40000
pwm_compa1==40000
pwm_compa2==40000
pwm_compa3==40000
pwm_compa4==40000
pwm_compa5==40000
pwm_compa6==40000
pwm_compa7==40000
pwm_compb0==60000
pwm_compb1==60000
pwm_compb2==60000
pwm_compb3==60000
pwm_compb4==60000
pwm_compb5==60000
pwm_compb6==60000
pwm_compb7==60000
pwm_loop==100
pwm_loop_delta==0
pwm_clock==1
pwm_duty==0
ppm_data_off==0
ppm_data_len==15
ppm_data0==65535
ppm_data1==65535
ppm_data2==65535
ppm_data3==65535
ppm_data4==65535
ppm_data5==65535
ppm_data6==65535
ppm_data7==65535
lpm_start==800
lpm_stop==300
lpm_size==50
sys_lcd_time==200
sys_menu_time==4000
sys_adc_time==170
sys_adc_jitter==3
sys_adc_map0==0 65535 0 0
sys_adc_map1==1 65535 0 0
sys_adc_map2==2 65535 0 0
sys_adc_map3==3 65535 0 0
sys_adc_map4==4 65535 0 0
sys_adc_map5==5 101 0 1023
sys_push_mode==0
sys_conn_mode==1
sys_input_time==5
sys_input_delay==300
sys_start_secs==0
sys_start_duty==50
info_conf==done


Still working on getting pwm_compaX and pwm_compbX fully working.
"NightRider" (pulse_dir=2) already works output inverting also and lpm messurement code is hooked up and looks working.
And the added some 'tags' to remove some functions to reduce size of program to fit in 16KB chip or maybe even in 8K chip.
(Also if lcd is disabled all 6 analog inputs are free to use)

Will check the schematic needs a few changes;
- PB0 & PB1 should goto gnd.
- D0 & D1 are connected internaly to USB so should left open.
- D2 External trigger for pulse needs button or sensor or connector.
- Also D2 when lpm_size > 0 then is output for mosfet for relay valve.
- D5 External clock for pwm needs BNC style connector with gnd.
- Add label D6 with LCD_RS
- Add label D7 with LCD_E
- Add label A0 with LCD_D0
- Typo cpu ATMEL 168/328
- I think backlight needs resistor.

~Russ

RE: EPG Testing sequential pulsar using the Arduino
« Reply #72, on June 3rd, 2011, 03:22 AM »
[/quote]
Quote
Will check the schematic needs a few changes;
- PB0 & PB1 should goto gnd.
- D0 & D1 are connected internaly to USB so should left open.
- D2 External trigger for pulse needs button or sensor or connector.
- Also D2 when lpm_size > 0 then is output for mosfet for relay valve.
- D5 External clock for pwm needs BNC style connector with gnd.
- Add label D6 with LCD_RS
- Add label D7 with LCD_E
- Add label A0 with LCD_D0
- Typo cpu ATMEL 168/328
- I think backlight needs resistor.
ok, I have updated the schematic and also changed the links in the previous posts
Here it is,
 :

http://open-source-energy.org/rwg42985/russ/Arduino%20Hardware%20schematic%20Simple%20for%20Pulse%20Fire%20v%200.5%20RWGresearch.bmp

enjoy! ~Russ

txqNL

RE: EPG Testing sequential pulsar using the Arduino
« Reply #73, on June 3rd, 2011, 04:31 PM »Last edited on June 4th, 2011, 07:26 AM by txqNL
The magic version 0.6 release :)

Changes I could remember;
- Added compiler flags to remove options so code can fit in 16K chip.
- Note on flags; disabling LCD will make all 6 analog input usable.
- Redone step duty timing now with option per output
- Given each output step timing options
- Added variable idx number to help output
- Renamed train_* into pwm_*
- Renamed _seq_* into ppm_*
- Renamed defaults into reset_conf
- Added reset_data(goto step0,etc) and reset_prog(reboots) cmds
- req_auto_lpm cmd works (if lpm_size > 0 and adc mapping to 101)
- LPM messurement code looks working with lcd output.
- Added pulse_enable which is a global output enable useful for map adc for safety devices
- Change pulse_modes into;
0=PULSE_MODE_OFF
1=PULSE_MODE_FLASH
2=PULSE_MODE_TRAIN
3=PULSE_MODE_PPM
4=PULSE_MODE_PPMA
- Added pulse_dir (0=LR,default,1=RL,2=LRRL(nightrider))
- Added pulse_data_inv for inverting output data
- Renamed pulse_duty into pulse_delay_post
- pwm_compa is per step timer
- pwm_compb is per step duty timer
- pwm_wait is per step wait loop to delay output a few ms.
- ppm_data is per output sequence data
- Added watchdog so if main loops is slower then 4sec device reboots.
- Improved LCD output
- Fixed pulse_steps 1 bug
- Lots of things to make code faster/smaller
- etc

Have removed the 103 special mapping but given freq mapping (102) now raw data so;
root@pulsefire: sys_adc_map 5 102 200 8000
root@pulsefire: sys_adc_map 4 16 0 200
Maps analog input5 to req_freq_cmd with range 2hz to 80hz
And maps analog input4 to pwm_duty with range from 0 to 200 percent.
NOTE; pwm_duty auto change only works when freq request is done so;
pwm_duty 50
req_pwm_freq 300
WORKS but this does not work;
req_pwm_freq 300
pwm_duty 50
But when both are mapped 16 and 102 then auto duty update does work without freq change because is knows the requested freq of last analog freq change request.

Also added info_ppm cmd to see the bit pulse data, so select pulse_mode 3 or 4
and example default config output looks like this; (for 16 outputs)
Code: [Select]

root@pulsefire: info_ppm
ppm_data00==0101010101010101
ppm_data01==0101010101010110
ppm_data02==0101010101010111
ppm_data03==0101010101011000
ppm_data04==0101010101011001
ppm_data05==0101010101011010
ppm_data06==0101010101011011
ppm_data07==0101010101011100
ppm_data08==0101010101011101
ppm_data09==0101010101011110
ppm_data10==0101010101011111
ppm_data11==0101010101100000
ppm_data12==0101010101100001
ppm_data13==0101010101100010
ppm_data14==0101010101100011
ppm_data15==0101010101100100


The variables "pwm_compa,pwm_compb,pwm_wait,ppm_data" are index per step so work a bit different like;

root@pulsefire: pwm_compa 30000
Sets all compa steps to 30000.

root@pulsefire: pwm_compa 35000 4
Only set compa of step 4 to 35000.

The req_pwm_freq cmd is also changed;
root@pulsefire: sys_push_mode 1
Select auto config change push mode so we change see what req_pwm_freq is doing.

root@pulsefire: req_pwm_freq 500
Requests 5hz for all compa steps with pwm_duty cycle.

root@pulsefire: req_pwm_freq 1380 3
Requests 13.8hz speed of step 3 with pwm_duty cycle.

root@pulsefire: req_pwm_freq 13300 7 60
Requests 133hz speed of step 7 with 60% duty cycle.

root@pulsefire: req_pwm_freq 6000 255 10
Requests 60hz speed of all steps with 10% duty cycle.
(255 selects all steps)

Also totaly forgot the 2 or 3 steps output can also be done in normal train mode see;
root@pulsefire: pulse_mode 2
root@pulsefire: pulse_data_init 3
root@pulsefire: pulse_data_init 7
root@pulsefire: pulse_data_init 1
Selects 2 then 3 and back to 1 output.

For doing LPM messurements there needs to be some method of reading the start and stop level, which can be as easy as some two switches and some resistors to make diffent voltage levels for analog input.
Also you need a relay valve for stopping the gas to messurement starts.
root@pulsefire: lpm_size 200
root@pulsefire: save
root@pulsefire: reset_prog
(Enable lpm by setting size > 0, now 200ml , save and reboot so input trigger pin is now output of relay valve)
root@pulsefire: lpm_start 800
root@pulsefire: lpm_stop 400
root@pulsefire: sys_adc_map 5 101 0 1023
root@pulsefire: save
Tune the start and stop values and map lpm level input.

Now use PUSH1 to start lpm or use 'req_auto_lpm' cmd;
root@pulsefire: req_auto_lpm
req_auto_lpm==Starting
root@pulsefire:
req_auto_lpm==3.00 4.18

That 3LPM in 4.18sec by moving the pot up and down :)

Errata:
- soft startup does not work
- req_pwm_freq chooses sometimes low compa values which give some problems with receiving the serial data cmds correct.
For this I'll start replace the arduino serial lib with custom one.

Happy pulsing, gr Willem (dutch) or William (english)

This code works with this nice schematic Russ has created;

txqNL

RE: EPG Testing sequential pulsar using the Arduino
« Reply #74, on June 5th, 2011, 12:26 PM »
Found bug with external pulse trigger (pulse_trigger==2) in all versions to fix search "MCUCR" and replace with "EICRA" so new line looks like;

EICRA |= (1 << ISC01);  // Falling-Edge Triggered INT0