View previous topic :: View next topic |
Author |
Message |
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Sat Jan 15, 2005 12:10 pm Post subject: Programable ignitionsystem |
|
|
Hi. i shall try to build a programable ignitionsystem for a motorcycle, 2 cylinder and max rpm 12000-13000. Any sugestion witch avr that will suit this aplication?
Best regard Lasse2t |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Sat Jan 15, 2005 1:06 pm Post subject: |
|
|
In order to precisely determine the rotation speed of your engine you will need a microcontoller with input capture function.
The 16-bit timers have an input capture function that captures the value of the free-running counter when an input pin changes state.
In order for this forum to help you:
What do you know about 2 stroke and 4 stroke engines?
What do you know about electronic?
What do you know about microcontrollers?
Best regards,
Luciano |
|
Back to top |
|
|
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Tue Jan 18, 2005 12:55 am Post subject: ignitionsystem |
|
|
I know a lot about 2 and 4 strokes and of electronícs. it´s the microcontroller part that is a bit more difficult.
Lasse2t |
|
Back to top |
|
|
Werner
Joined: 27 Sep 2004 Posts: 30 Location: Germany
|
Posted: Tue Jan 18, 2005 9:55 am Post subject: Re: Programable ignitionsystem |
|
|
Hallo Lasse,
I'm working on an ignition Controler for motorcycles too.
If you do it as a hobby development, use the biggest AVR you can handle. To change a running system to a smaler controler is easier than changing a system under development to bigger one.
If you need more Flash, RAM or EEProm Space you will have to spend a lot of work.
At the moment I use a M32-16. Only 1 Port is used for the ignition. The others will be filld up with supporting functions if Flash, RAM and controler Speed will be left.
Ciao,
Werner
P.S. will your ignition system work with a 2 dimensional or with 3 dimensional ignition curves? |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Tue Jan 18, 2005 2:53 pm Post subject: |
|
|
Hi Lasse!
I am curious now! If you like we can share ideas while you put down the requirements for your project.
Once you have defined the requirements, choosing the right microcontroller will be easy.
Some more questions:
- Is it a two stroke engine? (RPM 12000-13000).
- Is it a two cylinders with 0 degree cylinder angle and 180 degree crankshaft angle?
- Describe the original ignition. (CDI, Pickup sensor available)?
- Battery available?
- What are the reasons for this project?
- Describe what you expect from your new ignition.
Best regards,
Luciano |
|
Back to top |
|
|
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Tue Jan 18, 2005 10:02 pm Post subject: Ignition system |
|
|
Its a twostroke engine with 2 cylinder (Yamaha RD350 YPVS).maximum rpm is 12000-13000.
It has CdI ignition and two magnets (180 degree) and one pickup, and a battery.
So called a "waste and spare" system, The two cylinder are firing at the same time, one at the top and one at the bottom. The main reason for this system is to get maximum power from this engine because the original cdi is not so god when you start to tune the bike to higher power . Some more info about this project will follow soon.
Lasse2t |
|
Back to top |
|
|
Werner
Joined: 27 Sep 2004 Posts: 30 Location: Germany
|
Posted: Wed Jan 19, 2005 8:35 am Post subject: Re: Ignition system |
|
|
Hello Lasse,
Quote: | two magnets (180 degree) and one pickup, and a battery. | as far as i know Yamaha use magnetic preloaded Pickups. That means there is one magnet in the pickup. The signal generatation is work by changing the magnetic flow through the pickup coil caused by changing the air gap on the spikes. The spikes at the rotor are no magnets itselve (except an small value accured by long time of using).
Ciao,
Werner |
|
Back to top |
|
|
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Wed Jan 19, 2005 10:25 pm Post subject: Ignition |
|
|
Yes i think your right, there is some magnet in the pickup.
Lasse2t |
|
Back to top |
|
|
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Sun Jan 23, 2005 10:21 pm Post subject: Ignition system |
|
|
Ok, now i have got some idea of this project.
Use a timer and capture its value every rotor rev.
Calculate an index value (1-48) according to the right rpm and use it to get a new delay value in a table. That value will be used to get the right
ignition degrees.
0-12000 rpm/250=48. Because i need a new value every 250 rpm.
If this sounds like a god idea i will do some workbench test and see if it will work?
What do you think?
Lasse2t |
|
Back to top |
|
|
Werner
Joined: 27 Sep 2004 Posts: 30 Location: Germany
|
Posted: Mon Jan 24, 2005 8:51 am Post subject: Re: Ignition system |
|
|
Hallo Lasse,
Quote: | Use a timer and capture its value every rotor rev.
Calculate an index value (1-4 according to the right rpm and use it to get a new delay value in a table. That value will be used to get the right
ignition degrees. |
How do you store the delay values in the table?
-> as timer value? Your ignition degree will be ripple a low rmps.
For example, at the tablestep 1000-1250 rmp your timercount will change about 25%. That causes that the ignition degree will change to.
->as a degree value? You have to calculate a value "Timercount/degree" at the aktual rmp. This value has to be multilied with your stored ignition degree.
ignition event prediction:
Timercount_new = (Timercount_old - (Timercount_old / 360 * degree_value)) for a newstarted Timer
and
Timercount_new = Timercount_old + (delta_Timercount_old - (delta_Timercount_old / 360 * degree_value)) for a free running Timer.
If you do it in this way, you could also run a linear interpolation over your degree_values stored in the table. So you only have to store the degree values at the points the gradient will change.
Ciao,
Werner |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
|
Back to top |
|
|
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Thu Jan 27, 2005 9:58 pm Post subject: Ignitionsystem |
|
|
Thanks Luciano for the links, i will read them as soon as possible.
And Werner for the idea about the calculation, i think i need to read more about the interpolation thing to I will be back soon.
Regards Lasse2t |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Sun Jan 30, 2005 2:02 pm Post subject: |
|
|
Hi Lasse,
Your idea is fine.
* * * * *
Basic concept for a CDI ignition:
Step 1.
The ignition pickup triggers a timer interrupt. The interrupt routine stores the value of the timer (the rotation speed of the engine) into a variable.This value will be used to determine the timing of the ignition spark that will take place for the next engine rotation. (Not the immediate next ignition spark).
Step 2.
The number of clock cycles needed to execute the interrupt routine is always the same, so its duration will be always the same. At the end of the interrupt routine, a delay will take place and at the end of this delay the ignition spark will occur. (The time used for the delay is previously stored in a variable and it is determined in step 3).
Step 3.
Now we have time to do some work. (Time until next timer interrupt, see step 1).Based on the value of the timer stored in step 1 now we can extrapolate the value for the delay used in step 2.The best way to do that is to use a table which contains previously calculated delay values and to use the timer value as the index to access the values in the table. (The table contains 8 bit constants values stored in the flash memory of the micro). So in step 3 you read from the table the delay value and you store it into the variable for the delay in step 2.
Step 4.
Wait for next interrupt. (Interrupt = Back to step 1).
* * * * *
Some advices:
- Do your math outside the micro (multiplication and divisions), and use a table of previously calculated delay values.
- Build with a microcontroller a circuit that simulate pickup signals (square signal) and simulate the engine speed variations. (0 to 15000 RPM).
- Use an oscilloscope to debug and verify your ignition circuit.
(Using the pickup signal simulator debug and verify your ignition circuit without the engine).
- Once ready, do your testing on your worst engine. (Risk of engine damages).
- Be careful while testing. (Carbon monoxide is a colorless, odorless, poisonous gas).
Best regards,
Luciano |
|
Back to top |
|
|
RickB
Joined: 27 Jan 2005 Posts: 29 Location: Eugene, Oregon USA
|
Posted: Sun Jan 30, 2005 10:14 pm Post subject: magazine articles |
|
|
Lasse2t
From Circuit Cellar magazine:
Engine Control System Sept,Oct, Nov 1995
Digital ignition System Aug 2002
None of these articles are online, but back issues are still available and on cdrom
http://www.circuitcellar.com/
Rick |
|
Back to top |
|
|
Larry Ing
Joined: 30 Jan 2005 Posts: 1 Location: Sacramento, CA
|
Posted: Mon Jan 31, 2005 3:17 am Post subject: |
|
|
Hey guys,
I designed and mostly finished an ignition system for my Toyota pickup... I have needed one for the last 15 years and some months ago I finally started it. The system (for this slow engine) was designed for about 6K rpm with the tables as you described. I don't know if you want to be able to adjust the timing as you are driving (as I need) or want it fixed or to merely to report what the timing is currently. I have worked out timing, measurement, and software for the ststem under the hood. I still need to decide what I will place on the dashboard... probably another atmel test system used on another project with keyboard and LCD.
Anyway, I used the Tiny2313 in the design for under the hood, and when I found it hard to come by because of issues in fab, I substituted the 90S2313 on the advice of the factory. I see now that I can get the Tiny2313 and will probably switch to that shortly. I haven't finished the interface to the dashboard control/display but that should be mostly trivial. The only issues are what other items I want to communicate besides timing and control of it before finializing the design of the interface.
If I can help, Please let me know. _________________ N6XZD
What this country needs is less people telling us what this country needs! |
|
Back to top |
|
|
|