Custom stimulator with VVT! - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


MEGAsquirt A place to collectively sort out this megasquirt gizmo

Reply
 
 
 
LinkBack Thread Tools
Old 06-27-2010, 08:23 AM   #1
Supporting Vendor
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,440
Total Cats: 198
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 11:15 PM. Reason: only the stuff after "=" goes in the youtube tags.
Reverant is offline   Reply With Quote
Old 06-27-2010, 09:22 AM   #2
Supporting Vendor
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,440
Total Cats: 198
Default

And a picture of the board, labeled.

Reverant is offline   Reply With Quote
Old 06-27-2010, 10:11 AM   #3
Elite Member
iTrader: (1)
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,658
Total Cats: 39
Default

Brilliant
richyvrlimited is offline   Reply With Quote
Old 06-27-2010, 12:03 PM   #4
Senior Member
 
Join Date: Nov 2007
Location: Belgium
Posts: 939
Total Cats: 59
Default

Good stuff. My hat's off to you.
WestfieldMX5 is offline   Reply With Quote
Old 06-27-2010, 02:16 PM   #5
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Coolio!
Which uP board did you use?
JasonC SBB is offline   Reply With Quote
Old 06-27-2010, 04:23 PM   #6
Supporting Vendor
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,440
Total Cats: 198
Default

I use AVRs, this is a Mega128.

Dimitris
Reverant is offline   Reply With Quote
Old 06-27-2010, 04:42 PM   #7
Elite Member
iTrader: (12)
 
Join Date: Aug 2006
Location: Central-ish VA
Posts: 4,449
Total Cats: 16
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   Reply With Quote
Old 06-27-2010, 08:40 PM   #8
Ben
Supporting Vendor
iTrader: (33)
 
Ben's Avatar
 
Join Date: Jul 2006
Location: atlanta-ish
Posts: 12,689
Total Cats: 99
Default

I like it.
Ben is offline   Reply With Quote
Old 06-27-2010, 09:10 PM   #9
mkturbo.com
iTrader: (24)
 
shuiend's Avatar
 
Join Date: May 2006
Location: Charleston SC
Posts: 13,775
Total Cats: 1,106
Default

Now for Ken just get get us some proper VVT code written for the MS3 and we will be golden.
shuiend is offline   Reply With Quote
Old 08-24-2010, 08:12 PM   #10
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
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   Reply With Quote
Old 08-25-2010, 02:59 AM   #11
Supporting Vendor
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,440
Total Cats: 198
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   Reply With Quote
Old 08-25-2010, 12:32 PM   #12
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Quote:
Originally Posted by shuiend View Post
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   Reply With Quote
Old 08-25-2010, 05:48 PM   #13
Supporting Vendor
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,440
Total Cats: 198
Default

I'll make it happen Ken. Any preferences?
Reverant is offline   Reply With Quote
Old 08-25-2010, 08:51 PM   #14
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
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   Reply With Quote
Old 08-25-2010, 09:00 PM   #15
Supporting Vendor
Thread Starter
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,440
Total Cats: 198
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 09:43 PM.
Reverant is offline   Reply With Quote
Old 08-25-2010, 09:25 PM   #16
Guest
iTrader: (6)
 
Join Date: Sep 2007
Location: Vaughan, On, Canada
Posts: 1,092
Total Cats: 0
Default

Quote:
Originally Posted by JasonC SBB View Post
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   Reply With Quote
Old 08-26-2010, 11:17 AM   #17
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Quote:
Originally Posted by Reverant View Post
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   Reply With Quote
Old 08-26-2010, 11:24 AM   #18
Junior Member
 
Join Date: May 2007
Location: Columbia, MD
Posts: 248
Total Cats: 0
Default

Quote:
Originally Posted by Reverant View Post
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   Reply With Quote
Old 08-26-2010, 11:36 AM   #19
mkturbo.com
iTrader: (24)
 
shuiend's Avatar
 
Join Date: May 2006
Location: Charleston SC
Posts: 13,775
Total Cats: 1,106
Default

Quote:
Originally Posted by muythaibxr View Post
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   Reply With Quote
Old 08-26-2010, 11:48 AM   #20
Junior Member
 
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   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
Prepping my '95 for track asmasm Build Threads 82 05-26-2016 05:37 PM
WTB MP62 (Hotside) (NB2) Rick02R WTB 3 01-03-2016 08:18 PM
MS PNP requires reading and following directions??? satisfied MEGAsquirt 141 10-06-2015 11:44 AM
Back to Stock Part Out!! Turbo Parts, MS2 Enhanced 01-05, Suspension, and MOAR! StratoBlue1109 Miata parts for sale/trade 16 10-02-2015 10:39 AM


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 04:10 PM.