Shop OBEX P1 Docs P2 Docs Learn Events
Go-Cart Project — Parallax Forums

Go-Cart Project

JafarJafar Posts: 3
edited 2004-12-28 21:38 in General Discussion
Hi.

I'm new to the microcontroller world.· I have a BS2 and I've been experimenting with it for a while.

I'm a formula 1 fan and I love the technology that they implement on their racecars including the steering wheel.· I would like to create an add-on to the·steering wheel of my go-cart, that displays the RPM or speed on a LCD screen.·

Since I am new to this kind of stuff, I don't think I know what I'm looking for.· I've researched sensors among other things but I cannot tie it to the microcontroller.

Any suggestions or information that you may have will be greatly appreciated.

I hope that this project will lead to further projects that I can do in the future.

Thank You,
Jafar Mohammed

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Aerospace Engineering Student,
Embry-Riddle Aeronautical University

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-21 18:11
    There are days when I wish I hadn't sold my go-kart.... I, too, am an F1 fan.

    The saftest thing to do, I think, is use some sort of inductive coil on the sparkplug line. The output will require conditioning to make it clean and squre before taking it into the BASIC Stamp.

    Since you're new to microcontrollers, this might not be the best starter project. You should consider working your way competely through "What's A Microcontroller?" so that yu get a firm handle on BASIC Stamp programming and interfacing. After that, you'll be about ready to tackle your go-kart tach.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Paul BakerPaul Baker Posts: 6,351
    edited 2004-12-21 18:55
    Jon's suggestion will likely be your cheapest avenue, here is a general waveform for a sparkplug: http://www.interro.com/wav.htm#9·this is the voltage on the line. An inductive coil waveform would be the derivative of this waveform.

    Like he said signal conditioning will be required, there are several methods to do this. One method is feeding the singal to an op-amp configured as an integrator, the front end will require signal clamping (both positive and negative)·to keep the spike within the range of the op amp, the time constant of the integrator will depend on your inductive coil. Schmitt trigger the output to "square it up" and then to a astable monovibrator, finally feeding this to the basic stamp. An optoisolator between the·analog and digital portions will reduce the likelyhood of frying your digtal components·while your fine-tuning your system. Also keeping your digital components away from the engine block will reduce RFI, other system noise may also need to be accounted for. Like Jon said this is not a beginner project unless you already have experience working with engines and analog circuits. Also an oscilloscope is pretty much required for this project since each stage will require testing and fine tuning.

    Some of the stages could be eliminated or shortcuted·(such as the astable monovibrator if you find the schmitt trigger waveform is sufficiently long enough for the basic stamp to accurately count the pulses).

    Paul

    Post Edited (Paul Baker) : 12/21/2004 7:01:27 PM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-21 19:47
    Hey,

    the reason why I bail in here is not because I own a go-kart, although I like driving them. BUT, I'm a F1 fan too - no wonder when the world champion is a German smile.gif .

    Might be interesting for you that some modern spark coils have their own microcontrollers (I wrote an application for such a controller a couple of months ago).

    Another information: I'm in eMail contact with a Ferrari engineer who works in Rubens Baricello's team - he privately develops projects for the SX controller - so maybe, one day the Ferrari cars will have some of the "Ferraris of microcontrollers", i.e. SXes under the hood.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,


    G
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-21 21:07
    That would be very cool, SXes in F1 cars. Would also be cool to have an American driver in F1. Not all of us on this side of the Atlantic believe that racing means turning left (ala NASCAR)....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • JafarJafar Posts: 3
    edited 2004-12-21 22:57
    Thanks alot for the suggestions!

    However, they are a bit over my head (right now). I will ask my professors about this.

    I knew this was going to be hard, but wow - this is really difficult. Perhaps I need to research a few examples dealing with projects similar to this. I guess this is not as simple as putting a magnet on a bicycle wheel and have it pass by a sensor which is connected to an output unit.

    Again, thank you very much. I now have an angle of attack.
    - Jafar

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Aerospace Engineering Student,
    Embry-Riddle Aeronautical University
  • Paul BakerPaul Baker Posts: 6,351
    edited 2004-12-22 15:50
    I will be regaining my home internet access tomorrow. If I have time before my flight on Friday, I will draw up the example circuit, and give a general theory of what each stage does,· how to test and fine tune the circuit. If you have taken Circuits 2 and have access to an oscilloscope you can do this project with not too much difficulty. I use the bare SX chip and not the basic stamp, so I can point you in the right direction software-wize but will not be able to definitively help you in that respect.

    Paul

    Post Edited (Paul Baker) : 12/22/2004 3:53:04 PM GMT
  • JafarJafar Posts: 3
    edited 2004-12-22 16:51
    Thank You very much Paul.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Aerospace Engineering Student,
    Embry-Riddle Aeronautical University
  • BriefmarkBriefmark Posts: 10
    edited 2004-12-23 00:26
    I'm a big F1 fan too (Schumi is my man!).· My son, (www.kartboy.com) used to race karts, and used a bicycle computer on his kart, and it worked quite well, but it would be much more fun to make a display with a Stamp.· Maybe you could also display things such as cylinder head temperature as well RPM and speed.· You might want to consider a display with large characters, since it is hard to read a small display with all the bouncing you do in a kart.· Good luck with your project, and keep us posted on your progress.

    Fred

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Paul BakerPaul Baker Posts: 6,351
    edited 2004-12-23 21:44
    Ok here is the example circuit I promised. First off a caviat, this circuit is produced from theory, not practice, therefore I cannot gaurentee its functionality. I suggest that you take the circuit to a professor of yours to check it over before you proceed. I also invite any forum members to comment on it and suggest improvements. The portion I am least confident about is the coupling of the inductor to the amp. Since I have not provided a signal reference to the coil by tying one end to ground, this may cause unintended noise on the circuit. With all that said, let's continue on.

    The circuit can be subdivided into four sections, the signal source, the integrator, the comparator and the pulse driver.

    The signal source:
    The central element is the inductor, which is little more than wire wound arround the spark plug wire (long rectangle). This will generate a current whenever there is a change of·voltage in the spark plug wire (technically its di/dt but due to Ohms law I can get away with saying this). The more windings the greater the current. For a discussion of inductors and thier behavior in the presence of a magnetic field visit: http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/magcur.html#c1 and http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/bcursrc.html#c1
    So whenever the voltage spike of the spark plug occurs (as shown in the graph in my previous post) the inductor will generate a current pulse in one direction followed by a current pulse in the opposite direction. The total charge conveyed immediately after the spike will be slightly in the original pulse direction since the voltage does not return to 0 in the spark plug wire. After this the inductor will not induce further current since the voltage is essentially constant on the spark plug wire, when the sustain voltage on the spark plug wire ceases, the inductor will react again to bring the total current over the entire spark plug energization cycle to 0. The two diodes immeadiately after the inductor are signal clamps to prevent the voltage presented to the integrating op amp (op1) within reasonable levels, whenever the voltage difference between the two terminals of the inductor are more than approximately 0.7V one of the diodes will conduct ensuring that the voltage difference does not exceed that value by much more.

    The integrator:
    R1-R4, C1 and OP1 is the next functional block and it behaves as an integrator. This essentially restores the two current pulses into a waveform resembling the voltage pulse on the spark plug wire (the inductor measures the differential of the voltage on the spark plug, the first opamp integrates it back). For a very brief overview of opamps used as integrators visit: http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/opampvar4.html#c1 (I said it was brief [noparse]:)[/noparse] The values of R1-R3 are not critical, they should neither be too high nor too low, however they should be in the ballpark of the mid-value of the R4 potentiometer. R1, R4 and C1 dictate the time constant of the integrator (1/RC) R1 dictates how fast C1 is charged, R4 (and R1 during the negative current pulse) dictates how fast C1 is discharged. R1 should be low enough to provide a speedy response so choosing a time constant which is as fast or faster than the current pulse duration is needed. You may want to have R1 be a potentiometer as well so you can be sure to tune the circuit properly.

    The comparator:
    The output of the integrator can change slowly (comparatively) this is undesirable for input to a digital circuit since the voltage can drift through voltages which are not supposed to be present in a digital circuit. The output of the integrator needs to be "squared up" meaning that the value is either true or false (5V or 0V for the basic stamp), this is where the second op amp comes in. R5 and OP2 form a comparator, whenever the output of the integrator (tied to the negative terminal of OP2) is greater than the positive terminal of OP2 the output of OP2 will be near the negative supply, whenever the negative input is less than the positive input the output of OP2 will be near the positive supply. R5 sets what this threshold of switching is. Visit http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/opampvar8.html#c1 for a discussion of op-amps used as comparators. (BTW the comparator is performing the same function as my original post's schmidt trigger (sans hysterisis), while allowing flexibility of the switching voltage level.

    The pulse driver:
    The output of the comparator (now in proper digital form) may present pulses which are so short in duration that the basic stamp may not be able to properly notice every pulse. So we need a method of extending the length of the pulse to ensure the basic stamp recognizes each and every pulse. The 555 is a timer circuit which can be configured in a variety of ways. Here we are using it as an astable monovibrator (or a one-shot). Whenever the signal of pin two goes low, an output pulse on pin 3 is generated, but instead of lasting for the duration of the trigger pulse, it lasts as long as the time constant of R6 and C2 dictates. http://homepages.westminster.org.uk/electronics/555.htm#monostable does a fairly good job at explaining its function so I won't go into further detail about its operation.

    The programming of the basic stamp I leave to you, seek help in the forum dedicated to the basic stamp if you have any questions regarding the programming portion of the project.

    Parts selection:
    I cannot give you definitive choices on parts, you'll likely want to get a dual op amp package for both the op amps, youll run them at 5V for the positive supply and 0V for the negative supply. You'll want to choose an opamp for OP1 (and OP2 if you get a dual package) which can handle brief periods of the input terminal being either above (and especially) below the power supply rails (the diodes will protect the terminals from being zapped but will not prevent them from exceeding the power supply rails).

    Testing and fine tuning:
    First you need an oscilloscope and you may want a multimeter as well. Start by making the inductor by wrapping wire around the spark plug wire, hook one end of the inductor to the chassis of the go cart and the oscilloscope probe to the other end, start at a high voltage level of the oscilloscope and start the go cart, You should see a train of spikes on the oscilloscope. You may need to experiment with the number of windings, remember the more windings, the more current, the easier the circuit will notice the signal.

    Next construct the integrator (including the signal clamp diodes), hook the oscilloscope probe to the output of the opamp, you want to see a signal which closely resembles the the graph of the spark plug wire. If the signal is weak, try lowing R1 and R4, if you see anomalies (spikes that shouldn't be there) try raising R1 and R4. Try moving the diode clamps to the other side of R1 and R2 and see if that improves the signal. Finally if you can't seem to get what you want, try single ending the inductor by tying one end to ground, removing R2 and attaching one diode to ground and the other to 5V make sure that you put them in proper polarity otherwise you will short your powersupply, diode tied to ground should flow when signal line drops below ~-0.7V and the diode tied to 5V should flow when signal line is above ~5.7V.

    After you have a waveform which resembles the voltage waveform of the spark plug line, construct the comparator, place your oscilloscope probe on the output of the comparator. You should see an inverted waveform (mostly near 5V with occasionally dips near 0V), adjust R5 to where you can maximize the width of the low pulses, then edge slightly towards minimizing them to give some room for drift in the circuit. The given discussion on the 555 is pretty good so I'll leave the explanation of that to them. Just be sure not to make the R6-C2 time constant too long since the 555 needs to reset between trigger pulses, higher RPMs = more frequent pulses so account for this since if your testing at idle RPMs you may lose pulses when on the track if you make your 555 time constant too large. Finally I strongly suggest placing an optoisolator between the output of the 555 and the basic stamp. All the parts relied upon in this circuit are fairly inexpensive so frying them will not be a big deal, but frying your basic stamp will be.

    Happy experimenting,
    Paul

    One final note, do not forget to place a bypass capacitor between the supply and ground of each chip.

    Post Edited (Paul Baker) : 12/29/2004 11:42:15 PM GMT
  • um..., Hium..., Hi Posts: 64
    edited 2004-12-28 21:38
    just get an My-chron or some thing and hack it they are available here http://www.aim-sportline.com/, I race go-karts i am in the Jr. super sportsman class and the Jr. sportsmann class my web site is www.mathesonmotorsports.com, the site is kind of chesey site but my mom did it using one of thoise cheasy page creators

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wish i knew how to put a pic here! Oh, well!
Sign In or Register to comment.