MEGAsquirt A place to collectively sort out this megasquirt gizmo

Custom stimulator with VVT!

Thread Tools
 
Search this Thread
 
Old 06-27-2010, 07:23 AM
  #1  
Elite Member
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default Custom stimulator with VVT!

I asked Jean of jbperf.com fame some time ago, if he could implement a VVT emulation function in the JimStim cpu. Specifically, I wanted to be able to change the phase between the cam and crank signals by using the spare pot on the stim. He said that it is not possible right now because the spare pot is not brought over to the cpu, but he would put it on his to-do list. Well, now that I have my MS2 running on the stock sensors rather than on the NA CAS back when I had the MS1, its time to do closed loop VVT control. Being a microcontroller guy, I like to do things because a) its fun and b) because I can.

Recently, my JimStim died on me, so I needed to build one from scratch. I took the liberty of building one with features not found on the JimStim:

1) proper CKP/CMP signals for my 2002 Miata w/VVT
2) VVT phasing
3) Coolant fan LED
4) A/C request w/LED
5) A/C relay and A/C fan LED
6) clutch & neutral switch emulation and LED
7) power steering switch emulation and LED
8) VREF check (red/green LED)
9) VSS emulation
10) CEL led
11) battery light LED
12) alternator field control LED
13) tachometer LED
14) system voltage potentiometer.

On the bench:


VVT phasing as seen on the scope:


Dimitris

Last edited by y8s; 08-24-2010 at 10:15 PM. Reason: only the stuff after "=" goes in the youtube tags.
Reverant is offline  
Old 06-27-2010, 08:22 AM
  #2  
Elite Member
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default

And a picture of the board, labeled.

Reverant is offline  
Old 06-27-2010, 09:11 AM
  #3  
Elite Member
iTrader: (1)
 
richyvrlimited's Avatar
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,642
Total Cats: 42
Default

Brilliant
richyvrlimited is offline  
Old 06-27-2010, 11:03 AM
  #4  
Senior Member
 
WestfieldMX5's Avatar
 
Join Date: Nov 2007
Location: Belgium
Posts: 999
Total Cats: 73
Default

Good stuff. My hat's off to you.
WestfieldMX5 is offline  
Old 06-27-2010, 01:16 PM
  #5  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Coolio!
Which uP board did you use?
JasonC SBB is offline  
Old 06-27-2010, 03:23 PM
  #6  
Elite Member
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default

I use AVRs, this is a Mega128.

Dimitris
Reverant is offline  
Old 06-27-2010, 03:42 PM
  #7  
Elite Member
iTrader: (12)
 
neogenesis2004's Avatar
 
Join Date: Aug 2006
Posts: 4,413
Total Cats: 20
Default

I love AVRs myself and use them for my projects. Cheap, easy to code for, great OS compiler available, and a huge community support.
neogenesis2004 is offline  
Old 06-27-2010, 07:40 PM
  #8  
Ben
Supporting Vendor
iTrader: (33)
 
Ben's Avatar
 
Join Date: Jul 2006
Location: atlanta-ish
Posts: 12,659
Total Cats: 134
Default

I like it.
__________________
Chief of Floor Sweeping, DIYAutoTune.com & AMP EFI
Crew Chief, Car Owner & Least Valuable Driver, HongNorrthRacing

91 Turbo | 10AE Turbo | 01 Track Rat | #323 Mazda Champcar

Originally Posted by concealer404
Buy an MSPNP Pro, you'll feel better.
Ben is offline  
Old 06-27-2010, 08:10 PM
  #9  
mkturbo.com
iTrader: (24)
 
shuiend's Avatar
 
Join Date: May 2006
Location: Charleston SC
Posts: 15,177
Total Cats: 1,681
Default

Now for Ken just get get us some proper VVT code written for the MS3 and we will be golden.
shuiend is offline  
Old 08-24-2010, 07:12 PM
  #10  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Which Mega128 board is that in particular, which vendor?

And, does it have a bootloader - do you use anything similar to the Arduino system, or do you do it more "raw"?
JasonC SBB is offline  
Old 08-25-2010, 01:59 AM
  #11  
Elite Member
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default

It's made by Olimex. It doesn't have a bootloader, I write in C and flashing everything in using an Atmel JTAG programmer (JTAG ICE MKII).

Dimitris
Reverant is offline  
Old 08-25-2010, 11:32 AM
  #12  
Junior Member
 
muythaibxr's Avatar
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Originally Posted by shuiend
Now for Ken just get get us some proper VVT code written for the MS3 and we will be golden.
A stimulator that'll let me change the phasing of the cam vs crank signals would go a long way towards me actually implementing it in 1.1.

I'd be able to test before putting it on a car.

Ken
muythaibxr is offline  
Old 08-25-2010, 04:48 PM
  #13  
Elite Member
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default

I'll make it happen Ken. Any preferences?
Reverant is offline  
Old 08-25-2010, 07:51 PM
  #14  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

J_Man wrote a program that runs on a Windoze PC. (Just the cam and crank signals, with any pattern you like, and a means of changing the VVT phase). It outputs on the parallel port. I tried it, it works.

I had one in an ancient PC running under DOS (minus VVT), for the NB sensors.

I suggest also coding for a 12+1 crank trigger wheel (a la Honda K20 / RSX) for increased crank angle resolution / accuracy.
JasonC SBB is offline  
Old 08-25-2010, 08:00 PM
  #15  
Elite Member
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default

There is absolutely no reason at all to go for a 12+1 crank trigger wheel when you can go for a 36-1 or a 60-2, if accuracy is what you want.

Last edited by Reverant; 08-25-2010 at 08:43 PM.
Reverant is offline  
Old 08-25-2010, 08:25 PM
  #16  
Guest
iTrader: (6)
 
M-Tuned's Avatar
 
Join Date: Sep 2007
Location: Vaughan, On, Canada
Posts: 1,085
Total Cats: 1
Default

Originally Posted by JasonC SBB
I suggest also coding for a 12+1 crank trigger wheel (a la Honda K20 / RSX) for increased crank angle resolution / accuracy.
That would be great.. I'd love to see the MS be able to support the K20 VTC also. I'm doing a ton of K-Pro tuning and it would be great to use the MS on the Honda stuff.
M-Tuned is offline  
Old 08-26-2010, 10:17 AM
  #17  
Junior Member
 
muythaibxr's Avatar
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Originally Posted by Reverant
I'll make it happen Ken. Any preferences?
As long as all the sensors work and the crank/cam signals and phasing are exactly like the stock miata, I'll use that stim and get it working.

One thing that would be nice is if the stim had some way of telling me what cam angle it thinks its commanding WRT its base position so I can compare that to what my code thinks the angle is.

I can calculate that looking at the signals on the scope, but if your code is already calculating it, having some way of seeing it would be cool. If it takes too much coding to make that possible though then forget it.

This is going to be an ms3 1.1 feature which means we'll probably start doing alpha releases in the next month or so as we start working on the features that are going in that release.

Ken
muythaibxr is offline  
Old 08-26-2010, 10:24 AM
  #18  
Junior Member
 
muythaibxr's Avatar
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Originally Posted by Reverant
There is absolutely no reason at all to go for a 12+1 crank trigger wheel when you can go for a 36-1 or a 60-2, if accuracy is what you want.
Actually I usually recommend using what is necessary. On an NA engine that doesn't accelerate very quick and doesn't have that much torque 12+1 is plenty. Going to 36-1 or 60-2 doesn't really help during steady state or during light acceleration or deceleration... Where it helps is under very heavy acceleration.

So for really fast accelerating turbo engines, 36-1 is good, 60-2 is great, but for an NA 1.6-2.0L engine, it's not really going to acclerate fast enough to cause major accuracy problems, so you can safely go with 12+1, and save some time on the ms2/ms3 CPU for doing other things.

12+1 at 8000 rpm is 1600 interrupts per second, 36-1 is 4800 interrupts per second, 60-2 is 8000 interrupts per second. Every time the CPU has to process an interrupt, it's not calculating a new pulse width or looking up a new ignition timing, etc... We can handle those numbers of teeth, but like I said, I'd go with only as much as you need.

Ken
muythaibxr is offline  
Old 08-26-2010, 10:36 AM
  #19  
mkturbo.com
iTrader: (24)
 
shuiend's Avatar
 
Join Date: May 2006
Location: Charleston SC
Posts: 15,177
Total Cats: 1,681
Default

Originally Posted by muythaibxr
This is going to be an ms3 1.1 feature which means we'll probably start doing alpha releases in the next month or so as we start working on the features that are going in that release.

Ken
So I need to get my car working within the next month so I can start trying to blow it up. I am game.
shuiend is offline  
Old 08-26-2010, 10:48 AM
  #20  
Junior Member
 
muythaibxr's Avatar
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Well, 1.1 alphas should start in a month. I have no idea if I'll have VVT done by then :P

I'd say when I'm ready to start working on it, I'll post here, and then Reverant can send me one of those nice custom stimulators for me to use to write the code.

Ken
muythaibxr is offline  


Quick Reply: Custom stimulator with VVT!



All times are GMT -4. The time now is 03:30 AM.