Arduino TCI

sleddog83

XS650 Addict
Messages
173
Reaction score
327
Points
63
Location
Vancouver Island, British Columbia
Been working on a Arduino TCI project last couple of years. Got it mostly working. Still a few issues, but 95% of the way there. Here is a shaky video of a test in the garage this morning. The proto board was cut to fit into a tci plastic box, but for this test it is not mounted in the box. The input and output circuitry was patterned after the yamaha TCI boards with a few modifications. The Arduino programming measures the rpm of the bike from the pickup pulses and calculates a time to energize the coil and a time to fire it. The advance curve is similar to the tci board with idling at about 15deg and fully advanced at 40 deg. The curve ramps up from 1900 rpm and maxes out at about 3300 rpm. Had an extra circuit that would only allow the coil to energize when the engine is turning but had to temporarily disable that. still a couple of bugs to work out. Apologize for the shaky video. It is a video of a static test in the garage.
 

sleddog83

XS650 Addict
Messages
173
Reaction score
327
Points
63
Location
Vancouver Island, British Columbia
Plans for it? Production... kits.... open source docs? Or just a one off?
If I can work the last couple of kinks out of it, I will think about producing a few boards. It currently starts and runs smoothly most of the time. There is an occasional misfire, which may be due to noise on the +5 volt line, but could also be a bodgy proto board build problem. I started working on a ki-cad layout during the winter, but got bogged down by the learning curve. I may do another prototype first, this one using a nano arduino instead of the atmel chip. But mostly I will probably just ride this summer.
 

Jan_P

XS650 Guru
Top Contributor
Messages
1,585
Reaction score
2,713
Points
263
Location
Sweden
If this was me i Would focus on the signal and triggering protection
A difficult subject.

which may be due to noise on the +5 volt line,

I don't know exactly what parts you have
But I have a Chinese clone of Arduino ( UNO i believe it is called ) is has a Atmel controller on the board I do believe ..So perhaps the Code you write can go in on a
Design made by oneself.
 
Last edited:

sleddog83

XS650 Addict
Messages
173
Reaction score
327
Points
63
Location
Vancouver Island, British Columbia
I cleared up a lot of my early problems by placing some extra transient suppressing capacitors on the 5 and 12 volt rails. The atmel chip was originally in a socket which made it easier to change the code. I took the socket out and soldered it directly to the board, thinking that the vibration and the cheap socket may be part of the problems. Unfortunately it is more difficult to update the code now. I think the problems with the board now, are more to do with the actual proto-board build. This type of build is inherently bodgy and troublesome. Wires criss-crossing on the board can pick up induced noise from other wires or components and possible also from the electrics on the bike itself. I think the next step is to come up with a prototype printed circuit board, where the signal traces on the board are laid out properly.
The way I worked on the code up to this point was by using a nano on a breadboard layout. The code was changed easily on the nano since it has it's own usb connector. Installing the code on the atmel chip, involved inserting the chip on a uno board, programming it, extracting and inserting the chip on the proto-board. Each time you do this, you run the risk of damaging the chip, the protoboard and the uno board. My decision to go to a nano is so that I can easily make changes to the code. There are some tweaks to the code that I might try, but am hampered by the current construction.
Part of the reason for this project (other than keep myself busy during the pandemic) was to prove that it can be done. I think I have done that now. I would be willing to share my ideas on how to do this sort of project, but I don't think I will share out my code just yet.
 

xjwmx

It's just the unknown.
Top Contributor
Messages
7,870
Reaction score
4,330
Points
313
Location
U.S.A.
i did similar a couple years ago and put the code on github. it's not worth being stingy over. my first version used both pickups but i changed to a single one and based the firing of the current cycle on the previous cycle because it gives much more time. ideal would probably be use both pickups and have them trigger two interrupts that start and stop a timer, to get the rpm. i polled them, which was sloppy. i did it without dreams of fame and fortune, just wanted the exercise. firing at the correct time as a function of rpm and finding the right advance programatically was a little bit of a personal breakthrough moment that i'll share if you want.
 

sleddog83

XS650 Addict
Messages
173
Reaction score
327
Points
63
Location
Vancouver Island, British Columbia
xjwmx, I think I saw some of your code once, but when I went looking for it later I couldn't find it. The code as you describe I wrote sounds similar to what I wrote I will release the code once I have cleaned it up a bit. The one currently running on the bike has a lot of warts on it. I have one of several versions on the bench right now that is simplified with a lot of the commented-out faulty code removed as well being a more streamlined version that eliminates a lot of the extra chips on the board. Works on the fine bench but haven't had the time yet to get it on the proto-board for a road test.
Also trying to figure out a way of of de-energizing firing signal. Currently if the bike stops(stalls) the coil could remain energized. Not sure if this is a big deal or not, because for the most part people just switch off their bikes to stop them. But I was looking for ways to prevent this situation. Was looking at using a timer interrupt.
Team Junk, I haven't really been following your progress. When ever I look at the number of entries in this feed I usually skip to the end and miss all the meat in the middle. How is this project going now? Can you give me a short synopsis. Seems to work but I see that their are some noise issues?
 

Jim

Beyond the edge is the unknown. Here be Dragons
Top Contributor
XS650.com Supporter
Messages
11,779
Reaction score
44,749
Points
813
Location
Kansas City Mo.
Team Junk, I haven't really been following your progress. When ever I look at the number of entries in this feed I usually skip to the end and miss all the meat in the middle. How is this project going now? Can you give me a short synopsis. Seems to work but I see that their are some noise issues?
I'll answer since I'm also invested in the GN conversion. I'm currently running it on my SG. Haven't had any noise issues. To swap over required making a slot in the TCI pickup as the timing's slightly different... and I'm not getting as much advance as the TCI box. As a compromise, I'm running about 18° at idle and about 35° at full advance. The bike starts easily and runs just fine out on the road. I've had it out to about 80mph several times and it was still pulling nice and strong. About the only thing I had to do tuning wise was up the pilot jet because it acted as little lean off idle and on decel.... but it was marginal at that range with the TCI box too. So others might or might not see that. In summary, I honestly can't tell the difference between the boxes... and I've made back to back runs swapping 'em out. About all I haven't checked is the mileage. I suspect it might be down slightly because of slightly less full advance, but seat of the pants says it's not much, if at all.
 

xjwmx

It's just the unknown.
Top Contributor
Messages
7,870
Reaction score
4,330
Points
313
Location
U.S.A.
Currently if the bike stops(stalls) the coil could remain energized. Not sure if this is a big deal or not, because for the most part people just switch off their bikes to stop them. But I was looking for ways to prevent this situation. Was looking at using a timer interrupt.
Yes, it's easy to add. Set up about a 1 sec counter or timer. Vector it to a routine that turns the wire to the coil off when it overflows or times out. Anytime the wire to the coil goes low, clear the timer. In normal operation it'll never turn it off

when I went looking for it later I couldn't find it.
Here is the first version of it. The comments might be helpful because I wrote them in a way that would tell me two years later what I had done :)
https://github.com/hwm1/electronic-ignition/blob/master/tci.c
 

sleddog83

XS650 Addict
Messages
173
Reaction score
327
Points
63
Location
Vancouver Island, British Columbia
Jim, I guess I should read the post from start to finish. While I was skimming through the post, you tend to concentrate on the problems, not the successes. In general, I am kind of curious about what is the best advance curve. I was looking at doing some variations from the stock curve, but I am not sure which way to go. Possibly even making them easily switchable. Some of the variations that I have set up so far were just a byproduct of some of the initial testing. One of the first curves I had, did not have a flat bottom end. It sloped down from about 15 degree (@1900rpm)to under 10 at the bottom end. While I am willing to give that a try at some point, I figured for now I would stick close to the curve in the shop manual.
 

Team Junk

XS650 Guru
Top Contributor
XS650.com Supporter
Messages
1,888
Reaction score
5,054
Points
513
Location
Central Texas
http://www.xs650.com/threads/gonzo-diy-tci-system.57694/

Here is the readers digest version. The first post has the estimated advance curve which has pretty much what we are seeing in the meat world. The advance chart comes from @TwoManyXS1Bs who recommended the 35 degree total advance. The fuel we buy today is whole different fuel than what was available in 1967 when the xs650 was being designed. I have looked at the advance curves of a lot of bikes in the last couple of years and the Gonzo is right there in total advance on modern bikes of similar tuning. The lochin 300 that the Gonzo was designed for is a pretty good match in tuning and cylinder capacity. I think that a few degrees less advance is a nice safety margin considering todays fuels and in my case 100+ degree summer days in my part of the world.
The other thing to consider is the difference in total advance is probably in the same range as the slop in the steampunk advance unit and cam chain slop on the stock points system.
I'm going to cross post this in the Gonzo thread as it has been discussed there quit a bit.
 

Jan_P

XS650 Guru
Top Contributor
Messages
1,585
Reaction score
2,713
Points
263
Location
Sweden
I cleared up a lot of my early problems by placing some extra transient suppressing capacitors on the 5 and 12 volt rails. The atmel chip was originally in a socket which made it easier to change the code. I took the socket out and soldered it directly to the board, thinking that the vibration and the cheap socket may be part of the problems. Unfortunately it is more difficult to update the code now. I think the problems with the board now, are more to do with the actual proto-board build. This type of build is inherently bodgy and troublesome. Wires criss-crossing on the board can pick up induced noise from other wires or components and possible also from the electrics on the bike itself. I think the next step is to come up with a prototype printed circuit board, where the signal traces on the board are laid out properly.
The way I worked on the code up to this point was by using a nano on a breadboard layout. The code was changed easily on the nano since it has it's own usb connector. Installing the code on the atmel chip, involved inserting the chip on a uno board, programming it, extracting and inserting the chip on the proto-board. Each time you do this, you run the risk of damaging the chip, the protoboard and the uno board. My decision to go to a nano is so that I can easily make changes to the code. There are some tweaks to the code that I might try, but am hampered by the current construction.
Part of the reason for this project (other than keep myself busy during the pandemic) was to prove that it can be done. I think I have done that now. I would be willing to share my ideas on how to do this sort of project, but I don't think I will share out my code just yet.

I do believe this is t the right way to go ..on a little longer time frame
The Gonzo Boys I do believe have underestimated the Electronical interference. Problems
I have not followed it strictly but I have seen 2 persons Rich and cannot remember the Other having midrange misfiring.
Still remains to find an explanation and solution. for. It is dangerous lets be honest about that ..
It might come. But can take some head scratching .

If it is as this a question of a own designed system I do believe there is a better chance to in the design implement protection.
Hera are People from Flying and Military so knowledge might be here in the forum

Tentatively I also believe it to be better to use the camshaft end as Pickup location
It is further away from the alternator .And Pamco and Boyer use that placement
Not sure how it looks there for past 1980 bikes if there is something to connect to

I also do believe that a programmable curve can be obtained .. I dont have experience of these controllers but generally that is what a computer is good at
given indata quickly calculate .
Mr xjvmx published a code thank you for that ..

A quick googling indicated it to be an ARM controller which are sold in enormous numbers so out there is the know how of using and
protecting .There is also special purpose controllers for Automotive.
I have not yet looked at the code .It might take time
But please publish more if possible
Component schematic would be interesting and Protection efforts.
The programming i dont think is the problem But as always I can be wrong
But to sum it up
ARM has capabilities ( I Understand it to be a step up but still not to expensive )
And there are Know how somewhere out there
Programming .can be done

So please more info would be appreciated. If possible .. I do understand that sometimes it is not possible .
 

Team Junk

XS650 Guru
Top Contributor
XS650.com Supporter
Messages
1,888
Reaction score
5,054
Points
513
Location
Central Texas
Tentatively I also believe it to be better to use the camshaft end as Pickup location
It is further away from the alternator

1 inch above the spark plug and a few inches from the ignition coil is probably the worst location in the world to put any kind of electrical components as far as electrical noise is concerned. Not to mention the heat . The only one I've seen mention problems with electrical noise with the Gonzo is you.
 
Last edited:

Team Junk

XS650 Guru
Top Contributor
XS650.com Supporter
Messages
1,888
Reaction score
5,054
Points
513
Location
Central Texas
I have not followed it strictly but I have seen 2 persons Rich and cannot remember the Other having midrange misfiring.

The original 1980 regulator/charging system and gonzo box let me ride flawlessly for miles for several weeks while tuning...then suddenly out of no where she's eatin coils. Seems to have all started when i determined the original reg to be causin the mid range sputter.

Richride's mid range issues appear to stem from charging system issues rather than any issue with the Gonzo or electrical noise.

The Gonzo box is not something that was cobbled up by a tinkerer in his workshop. It was designed for and used on the Lochin 300 built under license from Suzuki . SE Asia is flooded with the things. If there are problems with the igniter the net would be flooded with complaints about it.
 

Jan_P

XS650 Guru
Top Contributor
Messages
1,585
Reaction score
2,713
Points
263
Location
Sweden
Richride's mid range issues appear to stem from charging system issues rather than any issue with the Gonzo or electrical noise.

The Gonzo box is not something that was cobbled up by a tinkerer in his workshop. It was designed for and used on the Lochin 300 built under license from Suzuki . SE Asia is flooded with the things. If there are problems with the igniter the net would be flooded with complaints about it.


My View Respectfully I don't do this to complain or so Input was asked for and input is given
I don't seek to upset anyone. .. Input is the seed for development
If I understand it right
We have a system A XS650
We have a system B the Gonzo

A has components A(1,2,3.. .n ) Alternator / Wiring / Charging / Ignition and so on
B has the same B(1,2,3... n) Alternator / Wiring / Charging / Ignition

The B system in present days has been tested in a shop some where ,,and mostly there are protective measurements done
against the problems arising in that system B shielding programming decoupling and so on

A -- System has been tested in a shop in Japan in the 70 ies
What happens here as I understand it is that B(4) is taken out off its design situation
B and are moved into the System A . A(4 ) IS replaced with B(4) with 40 years design differences if not 50
which can be entirely different in terms of fex electrical power
Brushes damping and so

"]Richride's mid range issues appear to stem from charging system issues rather than any issue with the Gonzo or electrical noise.

If the alternator ( I am not claiming is so but if ) are sparking like a weld at the brushes fex ..It is not necessarily so that the
Micro controller in the Gonzo Box ever was designed never tested to cope with that.

You gentlemen are experienced enough to know these problems
You don't take it for granted that a carburetor from a System C can be installed .
And / Or don't install it without Re jetting Some tweaking
So if you are honest most of you realize that there are perhaps problems involved in doing what you are
doing.
And fine ...nothing strange or Disqualifying .. These issues happens in Many development Projects
If not all .. Some tweaking and adjustments and the solution is ready Plug and Play
I am no expert but i Know a little and know that micro controllers are sensitive.

The facts are
Two different systems
A and B Both work
Taking ignition box from B and hook up on A --> There are at least 2 bikes I have seen --> Having problems

I have not read it or analyzed ... But There is where I am at .. If the explanation is clear and known
fex Worn brushes or whatnot then it is no problem I got it wrong with poor reading.

If it is right so far then a development engineer would notice those situations and trying to figure out what is going on.
I have not seen any figures on the number of working installations
I know of Jim but not much more and seen 2 different with Problems
Rich has tested rather extensive strategies .And appears to be experienced, Still with problems
Input was asked for and input was given.
 
Top