I have about decided to do a single chip solution to
the dwell ignition problem because potentially it is the
cheapest way to do a stand alone ignition for use with a carb.
The knowledge gained can then be used to do a variety of simple
things including a trim table adjustment to the 555 fuel injection
system using spread sheet data as suggested by Henry Nee.
I will focus on assembly language as these are time critical jobs
and with assembly language you always know how long
it takes to do anything. If you keep the job short and
simple the software size will be manageable from many aspects.
Further more I have considerable experience with assembly
language much of which can be applied to the AVR instruction
set.
I realize that most of you will not be interested so you
can delete the messages on the subject.
Those that wish to follow along can make a folder and move
the stuff over to that.
Tom Walter, I think, was the first to mention the
Arduino board as a good low cost and small AVR trainer that will
do a variety of jobs. The advantage is it is wired
for USB and there is programming software that runs
on both Windows and Linux.
There are a lot of people using this board around the world so there
should eventually be a lot of asm code examples.
The Arduino Mega 2560 is a small microcontroller board based on
the ATmega2560. It has 54 digital input/output pins (of which 14
can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware
serial ports), a 16 MHz crystal oscillator, a USB connection, a
power jack, an ICSP header, and a reset button. It contains
everything needed to support the microcontroller; simply connect
it to a computer with a USB cable.
We will be using only a very few of these capabilities but the
cost and size is so low it does not matter.
AVRA is an assembler for Atmel AVR microcontrollers, and it is almost
compatible with Atmel's own assembler AVRASM32.
The initial version of AVRA was written by John Anders Haugum in
1999. He released all versions until v0.7. All later versions were
released by Tobias Weber. And version 1.3.0 is released by Jerry
Jacobs.
Paul Lamar
Runs on a Mac too. This is the board we are using in the
Mechatronics
courses at the University of Utah. Mostly for automated robots
with lots of sensors.
Chris Cosman
Paul,
The AT90USB Demo-Kit sells for 31.00 on Digikey and I think
provides similar resources, plus has some external flash storage
that might help for storing tables. Check it out, as it could be a
cheaper alternative.
Thanks,
Brannon
That is a bargain. I had to call and confirm it was completely
assembled.
That beats the Arduino for our purposes. Thanks for finding that
Brannon.
I ordered one.
Paul Lamar
Paul,
No problem, happy to help. Let me know if you would like any help
coding
this up or if you'd like someone to review your code. I've done several
designs on these processors and one on this board in particular.
One note, you might want to consider writing the majority in C, as
you will be able to use the Atmel supplied libraries for USB
communication, etc, and coding your time critical procedures in
assembly. Most compilers have statements that allow you to write in-
line assembly. Also, you can always generate the .lst file on
compile and see what assembly is being generated for any code you do
write in C.
Thanks,
Brannon
Great Brannon!
Good to hear it. Here is the problem.
At 7500 RPM the engine makes one rev in 8 ms.
The RX8 coil delays a fixed 2 ms after the crank sensor tells
it to fire. This is called dwell. In effect what this does is retard
or reduce the advance near 90 degrees. That causes the spark to fire
about 70 degrees AFTDC!!!!!! Of course losing power in the bargain
and hurting the BSFC. (fuel burn).
My suggestion is to measure the period of a given RPM and anticipate
the advance required up to 2 ms at 7500 RPM for the next revolution.
As you go through the rev range of course the adjustment changes. No
adjustment at idle and a lot
(2ms) at 7500 RPM.
Any ideas? Do you have a scope you can test it with?
CD's don't do this but they are a lot of bucks compared
to the LS1 or RX8 coils with built in solid state switches.
Paul Lamar
Automotive computer ignitions use the previous CAS signal to fire the
plug
you want. It is easy to delay the firing event, but anticipate it?
What could
be used is the adjustable pick-up mounting and a timing light to find
where it
needs the pick-ups to be to get the advance required. Once the
position is
determined for the set-up, the rest should be close with a small
adjustment
like setting timing on the distributor.
Dale Davies
Well if you measure the time it took to rev the engine once
and subtracted 2 ms when you fired on the next rev I think that would
work.
Paul Lamar
For a 2-rotor, measure the time for half a rev by timing from rotor1 CAS
to rotor 2 CAS, then subtract the 2 ms.
For CDI you can get motor scooter ignition packs for under $10. Use two
in parallel and deliver 40 millijoules to the coil. 4 wires to each pack
- 12 volts, ground, output to coil, and trigger. They are made to work
with inductive CAS sensors.
http://www.scooterpartssale.com/index.php?main_page=product_info&cPath=71_77&products_id=191
Victor Roberts
That might work for a 2 rotor. Our immediate need is for a one rotor.
Paul Lamar
Why not set the physical timing so that the plug fires at the desired
advance by default at 7500 RPM and then use the software to delay the
firing at lesser RPMs. Anticipating the event is a bit harder to code
than reacting to the event after it occurs. The computer will be
calculating a timing retardation instead of a timing advance.
Mark LaPierre
I got the $30 AVR Explaine test board. Lots of I/O to test a program.
Switches for inputs. LED and a speaker for out put.
Probably more powerful than an IBM mainframe from just a few
years ago.
Paul Lamar
Just wanna verify the unit shown above is: ATAVRXPLAIN-ND "KIT EVAL FOR
ATXMEGA128A1" as listed in digikey catalog.
Ed Carver
Correct Ed. There is a lot of free doc from various web sites.
There are at least two free assemblers.
Also there are one or two IDE Integrated Development Environment's that
you will need. It is a software program that talks to the board and sends
it assembled program through the USB. The USB also powers the board.
I am not sure but sometimes the assembler program
has a built in IDE.
It was so cheap I had to call DigiKey and confirm it was completely
assembled
and functional out of the box.
------------------------------****------------------
This site will be a big help in getting you started Ed.
http://avrbeginners.net/
This is an extremely well done site maintained by AVR.
Here is a way to cheat and speed up the process of learning.
Cheat! Get somebodies else source code and fool around with it :)
Back when I was learning I did not have that option. No Internet.
Paul Lamar
Alright, so I'll buy it and get to work on it. Should be here in a few
days?
Ed Carver
I had an old friend that had a son. He was about 3 years old when I met his
dad. I taught him 6502 asm language when he was 14 and hired him part
time to help rewrite the 6502 software on the computerized road test
equipment.
When he graduated high school he went to college for a few years and
they attempted to teach him BS. He got a job with a company renting
old fashioned mechanical movie editing equipment to movie directors. About
that
time digital video editing was just getting started. With banks of 100 meg
hard drives. The problem was there were a lot of old movies that needed
converting to video for TV. At that time it was done by hand one frame
at a time. Cost over a million dollars per film.
This guy invented a machine that would convert film to video in real
time. In other as fast as you could watch the film. He used a 6502 type
processor. Several of the large studios spending big bucks tried
to come up with such a machine and failed. The problem is the frame
rate of a movie and the frame rate of TV is different. Jim (not his real
name)
manufactured the machine and rented them out to the studios for $10,000 a
month.
He bought some real estate in the South Bay with the income and became a
millionaire before the age of 30.
The point is: inventors that know programming are becoming rich all over
the place. Particularly with real time products like machine tools.
BTW It has never been easier to learn ASM thanks to Microchip and AVR.
The AVR is what is known as a RISC chip. Reduced Instruction Set
Computer. It was only recently I discovered what that really meant.
It means there are no addressing modes to speak of in the instruction
set. That makes the chip easier to design and easier to learn to program.
I'll leave it up to you to research addressing modes :)
Paul Lamar
Yup! And my kids will Not attend californias perverse public schools, or
the even more perverse colleges here. I'm aiming to send them to Hillsdale
College. hillsdale.edu Paid for exclusively with private funds, no
connections to the US department of education. Everyone should get their
monthly digest called "Imprimis"
But long before they get there, they will understand the mechanics of life
in this great universe we are in, which now includes learning to design and
some programming. I hope they get a chance to help finish unraveling our
genome. That will be a great day. Can you imagine turning off the fascist
sequence in someones genes? It would give us a shot at getting rid of
political correctness. Now thats programming!
Anyway, glad to see a forum for AVR. I guess my first attempt at
programming will be to make an LED flash. I will be in love with it when I
do that.
Ed Carver
Piece of cake Ed :)
Paul Lamar
--
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
Youtube key word PaulLamar2
Copyright 1998-2011 All world wide rights reserved.