Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Collateral Damage
Jun 13, 2009

Shouldn't be a problem. You don't need to digitalRead() every revolution, you just attach the sensor to an interrupt, then on each loop through the main code you check the interrupt counter and derive the rpm from that.

See http://playground.arduino.cc/Main/ReadingRPM

Adbot
ADBOT LOVES YOU

Beve Stuscemi
Jun 6, 2001




Yeah, I mean the math is probably pretty simple, but I just wasn't sure if it could handle that rate.

I'd also argue that a tach is one thing because if it's a few ms late in responding, who cares, but if your cdi is a few ms late, any power you might be making is gone.

Rev. Dr. Moses P. Lester
Oct 3, 2000
Yeah to be honest I may have been a bit shortsighted on the Arduino and sensor rates. I just went Arduino because that's the only thing I knew was software programmable with minimal fuss and is small and would accept simple 5v sensor inputs etc. I don't know what it's capable of in terms of refresh rates.

ReelBigLizard posted:

Please share any work on that Rev. I'd be interested in building something similar when I rebuild my Bantam.
Do you mean BSA Bantam? Was thinking about one of those for my mom to ride in a MotoGiro, never did find one though. Ended up with a Ducati 160.

Ripoff posted:

The custom ignition thing is cool as hell and you need to update on your progress with it. Stupid question, though and I think you covered it before but I'm an idiot and can't search to save my life - what's the redline on this thing? From what I remember from playing with my arduino it's pretty easy to confuse it when things are happening fast, but for all I know it could be more than capable of handling 14k RPM in a 2 stroke motor.
I'm gonna run a 12k redline. It's not far off the stock setup on the bike and when I ran the numbers from my tuners books it sounded like this was the highest you'd want to go without sacrificing reliability on this engine. It frustrates me a little bit because I know the original GP 50 bikes, Kreidlers etc., would run upwards of 17k, but I don't know enough about engine mods to attempt to make it do that. I suspect porting and piston and all kinds of things would need to be changed radically.

Collateral Damage
Jun 13, 2009

At 12k RPM you'd need an ignition pulse every 5ms. The Arduino Uno board is a 16Mhz CPU which is still going to let you do things in the microsecond range if not better. Some of the stock Arduino functions are a bit slow (because they do a bunch of idiot-proofing checks on each call), but there are ways to work around that if needed.

Beve Stuscemi
Jun 6, 2001




Generally the first thing to go when you spin super high rpm's is the crank. You can weld it, harden it, balance it, and upgrade the main bearings, as well as the conrod bearings and get pretty far.

Guys like Scott Clough out in California do this stuff for two stroke race engines all day.

Since most two stroke cranks are just press fit, they get slightly out of alignment at super high rpm, then the bearings take a poo poo because the crank arms are no longer spinning true and it's all done.

Rev. Dr. Moses P. Lester
Oct 3, 2000
Yeah I think I may leave that kind of work until the next big off-season upgrade. Still got a couple moderately big things to do before this season, and there's some low hanging fruit like aluminum rims that can be done whenever. I would love to be able to rev it higher and I would love to fabricate an aluminum trellis frame for it. Theoretically. Some day.

Beve Stuscemi
Jun 6, 2001




If you have a really good welder and a setup for truing cranks to a very fine degree, you could true the crank and weld the pin and that would get you spinning faster right away, with the only limitation being the bearings at that point.

You can probably skip the hardening as the piston isn't going to be putting down the force that a bike like a cr500 would.

E: I should say that will get you able to spin faster right away. You still have to do the porting, exhaust, ignition and carb work to get it making enough power to spin faster than before

Rev. Dr. Moses P. Lester
Oct 3, 2000
Yeah but is the rod strong enough? Piston strong enough? Needle bearings strong enough? How do I even know, without running it until it blows up? I'm not at RedBull Racing levels of financing such that I'm comfortable using that method. Maybe I should try calling TAG Heuer and Santander and see what kind of cash I can get, though.

I worked up the Arduino code today for the thing. Been a long time since I wrote any code and never used an Arduino before. Wondering if it's inefficiently written enough that it'll cause processing speed problems at 12000rpm. Or whatever else might be wrong with it. Won't be able to find out until the top end comes back from the machinist and the frame comes back from the bodywork guy.

http://pastebin.com/iiVKc4ps

Beve Stuscemi
Jun 6, 2001




To your point, I don't know how much force your piston is exerting, but I'd have to guess that it's not a ton, and unless the bike uses the worlds worst bearings and conrod they're probably ok.

The deal with spinning fast is more around the initial trueness of the crank and its ability to stay true under those kinds of high speed.

But yeah, I get it, experimenting by popping motors is expensive and time consuming.

Collateral Damage
Jun 13, 2009

What Arduino board do you plan on using?

Or I guess I should ask what AVR, since I assume you're going to make your own board down the line if it works.

Rev. Dr. Moses P. Lester
Oct 3, 2000

Jim Silly-Balls posted:

To your point, I don't know how much force your piston is exerting, but I'd have to guess that it's not a ton, and unless the bike uses the worlds worst bearings and conrod they're probably ok.
Ok to what rpm though?

quote:

The deal with spinning fast is more around the initial trueness of the crank and its ability to stay true under those kinds of high speed.
I was under the impression it was more about the acceleration forces on the parts and whether the parts are light/stiff enough to withstand it. And again, the real question is, exactly how many rpms can we do without blowing the motor more than once a season?

Collateral Damage posted:

What Arduino board do you plan on using?

Or I guess I should ask what AVR, since I assume you're going to make your own board down the line if it works.
I have an uno now, it looks like it'll do what I need. All I need is one digital input pin and one digital output pin, really. I'm probably not planning on replacing it with a proper board unless someone in the club cries foul on the setup. (The Arduino itself is clearly not period appropriate equipment for 1983, but the rules in this class are very short and vague) I want to be able to easily change the software map in the future if I alter the ports/exhaust/intake/piston.

Collateral Damage
Jun 13, 2009

Rev. Dr. Moses P. Lester posted:

I have an uno now, it looks like it'll do what I need. All I need is one digital input pin and one digital output pin, really. I'm probably not planning on replacing it with a proper board unless someone in the club cries foul on the setup. (The Arduino itself is clearly not period appropriate equipment for 1983, but the rules in this class are very short and vague) I want to be able to easily change the software map in the future if I alter the ports/exhaust/intake/piston.
The code itself looks OK. If you find that it can't keep up because digitalWrite takes too much time, you can try one of the high performance IO libraries for Arduino, or just do low-level calls on your own.

There are probably some people over in the Arduino thread who are much better at optimization than I am who can tell you if there are any other performance pitfalls.

Collateral Damage fucked around with this message at 02:44 on Jan 18, 2016

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Collateral Damage posted:

The code itself looks OK. If you find that it can't keep up because digitalWrite takes too much time, you can try one of the high performance IO libraries for Arduino, or just do low-level calls on your own.

There are probably some people over in the Arduino thread who are much better at optimization than I am who can tell you if there are any other performance pitfalls.

There's actually a DIY ECU thread. I'm using an arduino nano on my bike now -- same processor as the Uno; ATMEGA328. I think the nano has enough power to run a 2-stroke 2-cylinder up to 14k rpm. A complete crank cycle takes 4.28ms at that RPM, so all your math has to be done in less time than that. The clock is 16MHz, and the arduino IDE is pretty well optomized to generate code.

Be intelligent with your function calls, and you'll have plenty of headroom on your timing; maybe not so much headroom on your memory space, though.

The thread has good info about what transistors to use to fire your coil, too.

Beve Stuscemi
Jun 6, 2001




Rev. Dr. Moses P. Lester posted:

Ok to what rpm though?

I was under the impression it was more about the acceleration forces on the parts and whether the parts are light/stiff enough to withstand it. And again, the real question is, exactly how many rpms can we do without blowing the motor more than once a season?

It is about those things, but more so on heavier motors. My gut says you could spin it pretty fast, but unfortunately you're probably in pretty untested waters with that motor, and it might be a "try and see" situation. Really, having talked to guys who were some of the first to take rd350's on a track way back in the day and to try to get big power out of them, that's what you have to do a lot of times, run them till they pop and either dial them back or find a way to improve and try again.

Honestly, getting over the porting and exhaust hurdle to make power at higher speeds will be your first and arguably bigger hurdle.

All this being said, and keeping in mind your limited race budget, have you played with pipe design, porting and gearing to try to get more out of the stock rev range and crank? Look at the intake length and maybe put a boost bottle in there to try to get more from a longer intake length?

If you haven't already, check this out if you'd really like to math the poo poo out of this:
http://www.amrca.com/tech/tuners.pdf

The above does talk of piston speed and contains the math required to get a good guestimate of when things might blow up

Beve Stuscemi fucked around with this message at 04:56 on Jan 18, 2016

Rev. Dr. Moses P. Lester
Oct 3, 2000

Collateral Damage posted:

There are probably some people over in the Arduino thread
Ugh I have to talk to Arduino nerds? I got into motorcycles specifically so I wouildn't have to do that.


Jim Silly-Balls posted:

All this being said, and keeping in mind your limited race budget, have you played with pipe design, porting and gearing to try to get more out of the stock rev range and crank? Look at the intake length and maybe put a boost bottle in there to try to get more from a longer intake length?

If you haven't already, check this out if you'd really like to math the poo poo out of this:
http://www.amrca.com/tech/tuners.pdf

The above does talk of piston speed and contains the math required to get a good guestimate of when things might blow up
Yeah I read that a couple times and also another 2t tuning book. The 12k redline I came up with was based on the math in either that one or the other book. I got a few different gearsets and I know I need to test those out at the track, I never had it quite right before. I made an attempt to map out the port sizes and timings and do the math to see if they were as efficient as possible, again based on one of the books. I'm not totally confident I did it right, it was pretty difficult poo poo to do, but I came away with the impression that the porting Yamaha had on there was pretty good already. For a piston port engine anyway. Have you messed with boost bottles much? The engine on mine was later used in the YSR50 and it had a boost bottle on it stock in that bike. Didn't have it originally on mine so I'd have to mod something in there for it. I rarely hear it discussed, though, so I wondered if actually helped much. It's not mentioned in either of those books, for example.

Collateral Damage
Jun 13, 2009

Rev. Dr. Moses P. Lester posted:

Ugh I have to talk to Arduino nerds? I got into motorcycles specifically so I wouildn't have to do that.
Then trying to build an ECU on an Arduino might be the wrong route. :v:

You can always go talk to noisymime in the DIY ECU thread that babyeatingpsychopath linked.

Sagebrush
Feb 26, 2012

Rev. Dr. Moses P. Lester posted:

Yeah but is the rod strong enough? Piston strong enough? Needle bearings strong enough? How do I even know, without running it until it blows up? I'm not at RedBull Racing levels of financing such that I'm comfortable using that method. Maybe I should try calling TAG Heuer and Santander and see what kind of cash I can get, though.

I worked up the Arduino code today for the thing. Been a long time since I wrote any code and never used an Arduino before. Wondering if it's inefficiently written enough that it'll cause processing speed problems at 12000rpm. Or whatever else might be wrong with it. Won't be able to find out until the top end comes back from the machinist and the frame comes back from the bodywork guy.

http://pastebin.com/iiVKc4ps

The two things that stand out to me are that you can save a couple of milliseconds by doing direct port manipulation instead of digitalWrite(), and that I think you could get rid of the if statement inside your interrupt handler with some other code structure since the vast majority of the time it's going to be skipped anyway.

Beve Stuscemi
Jun 6, 2001




Rev. Dr. Moses P. Lester posted:

Ugh I have to talk to Arduino nerds? I got into motorcycles specifically so I wouildn't have to do that.

Yeah I read that a couple times and also another 2t tuning book. The 12k redline I came up with was based on the math in either that one or the other book. I got a few different gearsets and I know I need to test those out at the track, I never had it quite right before. I made an attempt to map out the port sizes and timings and do the math to see if they were as efficient as possible, again based on one of the books. I'm not totally confident I did it right, it was pretty difficult poo poo to do, but I came away with the impression that the porting Yamaha had on there was pretty good already. For a piston port engine anyway. Have you messed with boost bottles much? The engine on mine was later used in the YSR50 and it had a boost bottle on it stock in that bike. Didn't have it originally on mine so I'd have to mod something in there for it. I rarely hear it discussed, though, so I wondered if actually helped much. It's not mentioned in either of those books, for example.

Rev. Dr. Moses P. Lester posted:

Ugh I have to talk to Arduino nerds? I got into motorcycles specifically so I wouildn't have to do that.

Yeah I read that a couple times and also another 2t tuning book. The 12k redline I came up with was based on the math in either that one or the other book. I got a few different gearsets and I know I need to test those out at the track, I never had it quite right before. I made an attempt to map out the port sizes and timings and do the math to see if they were as efficient as possible, again based on one of the books. I'm not totally confident I did it right, it was pretty difficult poo poo to do, but I came away with the impression that the porting Yamaha had on there was pretty good already. For a piston port engine anyway. Have you messed with boost bottles much? The engine on mine was later used in the YSR50 and it had a boost bottle on it stock in that bike. Didn't have it originally on mine so I'd have to mod something in there for it. I rarely hear it discussed, though, so I wondered if actually helped much. It's not mentioned in either of those books, for example.

Boost bottles help a lot to cure flat spots in the powerband. If the ysr came with one I'd imagine your bike could see benefit from it as well.

Is the ysr a different induction type, I.e. Reed valve on the ysr vs port induction on your bike?

500excf type r
Mar 7, 2013

I'm as annoying as the high-pitched whine of my motorcycle, desperately compensating for the lack of substance in my life.
http://www.ebay.com/itm/331747012070

Boost bottle AND N20 kit all in one for the low price of 60 bucks you can thank me later rev

Rev. Dr. Moses P. Lester
Oct 3, 2000

Jim Silly-Balls posted:

Boost bottles help a lot to cure flat spots in the powerband. If the ysr came with one I'd imagine your bike could see benefit from it as well.

Is the ysr a different induction type, I.e. Reed valve on the ysr vs port induction on your bike?
Pretty sure the internals of the engine and the carb and reeds are identical on the YSR and RX. Only difference I've seen is a slight change in magneto rotor design and exhaust and that boost bottle with a hole in the intake boot for it.


EX250 Type R posted:

http://www.ebay.com/itm/331747012070

Boost bottle AND N20 kit all in one for the low price of 60 bucks you can thank me later rev
The rule book doesn't specifically prohibit NOS in this class.

funeral home DJ
Apr 21, 2003


Pillbug
If you're not cheatin', you're not tryin'. :clint:

That said, you gonna post up some before-and-after dyno videos and show us that obscene torque curve?

Rev. Dr. Moses P. Lester
Oct 3, 2000
Yeah I'll be having charts and all kinds of poo poo to post. Hopefully before too long but I dunno when exactly I'm getting my frame back (machinist is nearly done with the engine parts) and I have no clue how hard it'll be to make an exhaust pipe or get the ECU working.

I looked for RF shielding on Amazon and most of it came from a company that made a metal mesh knit winter hat to keep the Zionist Occupation Government's chemtrails out, so I'm not sure I trust anything else they're selling to actually protect my arduino from spark noise.

Edit:
Prototyped up the relay circuit to attach the arduino to the coil. I think I should write another bit of software just to test if this thing can reliably make a spark on its own before I go so far as to hook it up to an engine and see if it can time a spark properly at 12k rpm.



Edit:
https://www.youtube.com/watch?v=e-OapQKEzkY

Rev. Dr. Moses P. Lester fucked around with this message at 03:09 on Jan 22, 2016

Rev. Dr. Moses P. Lester
Oct 3, 2000
Got the crank sensor ring mounted on the flywheel stub piece.



Gotta get the sensor mounted on it now.



Luckily it'll fit inside the engine cover without cutting any holes in it so the engine will look stock from the outside. That's an unexpected bonus.


Got the cut down cylinder back from the machinist and started dremeling the head to set up the combustion chamber and squish band. Here's measuring the squish band with bondo.




That's squish as gently caress yo. The edge varied from 0.011 to 0.014". 0.015" is the smallest you'd ever want on the smallest motor according to the books I've read. So I need to adjust it a bit. Then check the cranking PSI and carve the combustion chamber bigger if it's over like 160psi.

ReelBigLizard
Feb 27, 2003

Fallen Rib
This is looking really sweet. Keep the updates coming.

You could probably make some small revenue out of an affordable open source programmable CDI. The greybeards who are restoring bikes these days are more and more computer savvy because all the 70s/80s mainframe/telco/unix guys are reaching retirement age.

Rev. Dr. Moses P. Lester
Oct 3, 2000
I was kinda tempted to develop that. The one I built doesn't use a CDI style crank sensor so it would have to be different.

Of course the thing is, it's a lot more complicated than that. How easy do you want it to be to install? There are a number of old bikes you can't get CDIs for, such as CM400A and poo poo. Their CDIs are identical to similar bikes like a CM400T but there's like one extra wire in the connector related to the odd gearshift on the A, and it probably does nothing for the actual ignition, but it makes it so that the units are not interchangeable in a plug-n-play way.

And actually I did take some of my circuitry, though not the code, from a random site on the internet I found describing how to make your own programmable CDIs and TCIs. The info is out there already, it's just not in a friendly form. The site I found described using some PIC chip but didn't tell how to get your code onto the drat chip. I figured an arduino would be more straightforward.

Rev. Dr. Moses P. Lester
Oct 3, 2000
Got the fairing, tank and seat back from the fiberglass guy. Working on mounting it all now. Made a new subframe for the seat and future battery.





Carved out the combustion chamber to bring the cranking PSI down to around 160, as per the max described in one of my 2t tuning books. It was over 200 after my previous cylinder/head mods. This is a bondo mold of the new combustion chamber.



Will be mounting the fairing next and planning out the paint scheme. And/or hydroforming the exhaust. Also realized I need to redo a bunch of circuitry for the ignition computer.

ReelBigLizard
Feb 27, 2003

Fallen Rib
Keep the updates coming, can we get a video of the detonation first start?

Dat squish tho :wiggle:

Rev. Dr. Moses P. Lester
Oct 3, 2000

ReelBigLizard posted:

Dat squish tho :wiggle:
0.015" ni55a. Ain't nobody squish like me.

Adbot
ADBOT LOVES YOU

Rev. Dr. Moses P. Lester
Oct 3, 2000


Got the testbed ignition system wired up finally. Took 3 different BMW crank sensor plates and 2 different custom machined BMW sensor rings on the stub flywheel to get it this far. Also a homemade adjustable concentric mounting base for the sensor plate which I will show at some point. It now produces spark when the engine is cranked, which is a milestone. Installed the new Dellorto and tomorrow when I get my high speed (>1000rpm) drill back I will try to actually run it for the first time. The 600rpm drills (3 of them) I had access to today were not really fast enough to spin the crank for a good start. If the running seems somewhat functional tomorrow I will finalize some of the wiring so it's not all hooked up with alligator clips and then it's dyno time.

  • Locked thread