It is currently Tue Sep 25, 2018 7:33 am

Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Code questions
PostPosted: Mon Nov 25, 2013 8:20 pm 
User avatar

Joined: Mon Nov 25, 2013 7:56 pm
Posts: 1
Hello there,

I'm a student automotive electronic engineering from Belgium.
For my school project, I need to make an embedded system (use an already existing or develop a new one, and program it) that generates signals (that normally come from engine sensors) to send them to the ECU.

While searching for information and tips and code, I came across this project and this forum. I like this project very much, because it's very interesting to see other people make custom build ECU's and engine signal generators.

Now I'm a bit stuck on my project and I was wondering if anyone of you might help me out a bit. :)
My main problem is that I know the wide basics of various programming languages, but I feel like I don't know enough of 1 particular language to be able to program my complete project. A lack of practical experience is working against me as well :)

I can generate my desired signals quite easily using LabView, but the problem there is that I don't know how to 'export' my program to an embedded system. If my research on LabView is right, I think it's not possible to program a microcontroller with my LabView program (besides the way too expensive NI products like compactRIO for example). If it Would be possible, another obstacle is that it's very hard for me to 'calculate' what type of microcontroller/embedded system to use or which one can handle my program.

So I'm trying to program it in another language now, in C language.
But I'm having problems with the crankshaft signal that I have to generate. I accually have no idea how to program this in C... Since it's a sine wave (and not a square wave) with missing teeth profile, I really don't know how to generate this signal.

I read here on this forum that you guys are programming/have programmed a similar device that emulates engine sensors, is that correct?
How did you approach the crankshaft VR sensor signal?

Any help would be very much appreciated!!!

I'm also looking for the microcontroller/embedded system I would use, so any tips would be very welcome :)

My device will have 1 analog input (from the throttle position, varying between 0 to 5 V), 4 analog outputs (varying between 0 to 5 V) and 1 digital output with a constant duty cycle for the camshaft position sensor.
All output signals will vary in amplitude and/or frequency, depending on the given input signal.

Thank you VERY much in advance,
kind regards,

 Post subject: Re: Code questions
PostPosted: Mon Nov 25, 2013 10:20 pm 
User avatar

Joined: Sat May 11, 2013 9:45 am
Posts: 729
Location: PA, USA

The easiest might be to just take our code and modify? Its open source so borrow away. the board is $99

another option is this project:

The board is $15 i think.

or this project:

that just uses labview :)

no idea how to turn labview into C.........

We do generate a test crank signal, but it's a square wave like from a hall sensor or what you get sending a VR to something like a max can't hook a VR up without a pre-conditioning circuit.

 Post subject: Re: Code questions
PostPosted: Mon Dec 02, 2013 12:09 am 
User avatar

Joined: Sat May 11, 2013 9:52 am
Posts: 304
Location: Over here, doing 'over here' things.
So, you're looking to simulate a VR sensor's output? Shouldn't be too difficult.

Where you might have problems is approximating the range of voltages a VR sensor can generate as the voltage output of a VR will increase with RPM, and that swings both negative and positive.

PWM into an RC filter, then into an op-amp configured properly might work for that; think convert DC to AC with a virtual ground on the op-amp?

/me goes off to the corner feeling like Jerry Springer with a mullet.

My O5E candidate: 1982 Honda CX500TC motorcycle.

 Post subject: Re: Code questions
PostPosted: Mon Dec 02, 2013 10:39 am 
User avatar

Joined: Fri Nov 29, 2013 8:44 pm
Posts: 2
Here is some 9S12 code I hacked together from years ago. Not very clean nor fancy, but did the job at the time. It should load in CodeWarrior and compile.

ENG_Sim.rar [237.34 KiB]
Downloaded 313 times
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Theme designed by © 2008
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All times are UTC - 5 hours [ DST ]