The latest madcap idea from S2central !

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mark_s2
    Account Disabled
    • Jul 2006
    • 274
    • Home: United Kingdom Current: England

    #16
    'From the sinewave I can generate a square wave using a fairly simple circuit - that gives me nice clean edges to drive counters which then trigger a crank reference pulse every 135 teeth and camshaft ref every 270 teeth. If I can't generate a suitable crank ref pulse I am just going to have to sample it with an ADC, write to ROM and play it out thru a DAC at the right time.' - why not use a PIC?

    Comment

    • SteveH
      Super Moderator
      • Jul 2003
      • 4460
      • Country: United Kingdom

      #17
      Heath + Robinson

      Paul, you must have too much time on your hands
      91 Modded 3B
      14 A6 Avant Black Edition

      Comment

      • S2central.net
        Retired OG Mod
        • Jul 2003
        • 16590
        • Country: Northern Ireland

        #18
        The internet is a wonderful invention ... just found some crankwheelpulser software hosted on the megasquirt site and I have it emulating the flywheel teeth signal and camshaft pulse with the correct timing. Piccies to follow... Oh and I am hoping to be PIC free on this stuff - I can't be bothered learning my way round another controller - and getting all the right tools to write software for it. This is an old school invention - its like a little science project - I had my 7yr old son helping me tonight - holding scope probes and listening to the waveforms... Its like Shamu meets Flipper !
        Paul Nugent
        Webmaster http://S2central.net
        Administrator http://S2forum.com

        1994 S2 Coupe ABY - aka Project Lazarus
        2001 A6 allroad 2.5TDi - family tank
        2003 S4 Avant 4.2 V8 - daily burble

        Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

        There are only 10 kinds of people that understand binary - those that do, and those that don't

        Comment

        • S2central.net
          Retired OG Mod
          • Jul 2003
          • 16590
          • Country: Northern Ireland

          #19
          I'll need to look at the source code for that CWP utility though - it generates a CMP pulse of approx 4 teeth wide - I need it to be more like 16 teeth... Maybe easier to build my own timer & counter though, cos I need that anyway to simulate the crank ref pulse - and have that arrive reliably within the CMP window.
          Paul Nugent
          Webmaster http://S2central.net
          Administrator http://S2forum.com

          1994 S2 Coupe ABY - aka Project Lazarus
          2001 A6 allroad 2.5TDi - family tank
          2003 S4 Avant 4.2 V8 - daily burble

          Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

          There are only 10 kinds of people that understand binary - those that do, and those that don't

          Comment

          • S2central.net
            Retired OG Mod
            • Jul 2003
            • 16590
            • Country: Northern Ireland

            #20
            Some of this evenings findings recorded for posterity... I'll take a look at modifying the C source for this - the more I think about it, the better it would be to simulate RPM and CPS. I might need help from some gamely software folk on here - I'm not so hot on C and I've never programmed on a PC environment before. If thats a dead-end then its a good source of the RPM signal and I can do the rest in simple hardware.

            Can't upload it - stupid file size limits... Will fix and retry later.
            Paul Nugent
            Webmaster http://S2central.net
            Administrator http://S2forum.com

            1994 S2 Coupe ABY - aka Project Lazarus
            2001 A6 allroad 2.5TDi - family tank
            2003 S4 Avant 4.2 V8 - daily burble

            Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

            There are only 10 kinds of people that understand binary - those that do, and those that don't

            Comment

            • Nuvo
              S2Forum Possessed
              • Nov 2003
              • 3825

              #21
              I can take a look at the code if you like.

              Comment

              • S2central.net
                Retired OG Mod
                • Jul 2003
                • 16590
                • Country: Northern Ireland

                #22
                I've found the section of code that needs tweaked. Will ping back ASAP.
                Paul Nugent
                Webmaster http://S2central.net
                Administrator http://S2forum.com

                1994 S2 Coupe ABY - aka Project Lazarus
                2001 A6 allroad 2.5TDi - family tank
                2003 S4 Avant 4.2 V8 - daily burble

                Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

                There are only 10 kinds of people that understand binary - those that do, and those that don't

                Comment

                • S2central.net
                  Retired OG Mod
                  • Jul 2003
                  • 16590
                  • Country: Northern Ireland

                  #23
                  @Nuvo - here's the section of code that needs tweaked... You need to download the CWP source from http://www.megamanual.com/router/crankwheelpulser.htm first of all...

                  Then find the CrankWheelPulserDlg.cpp file

                  And circa line 600 is this section of code which writes the CMP signal.

                  // Write the cam sync
                  if(icamsync == 2) // Generate CAM channel (right) if selected
                  {
                  camangle = camangle + angledelta;
                  if(camangle >= 720.) camangle = camangle - 720.; // cam pulse width = 10 degrees
                  cbuf = 0;// cam no pulse
                  if(camangle > camchk && camangle < camchk + 10.) cbuf = 255;// cam pulse
                  fputc(cbuf, fp);// cam
                  }

                  The 720 refers to crankshaft degrees so thats correct of course.

                  Q1 - Can you please change that '10' to a '40' to create a wider pulse and recompile into PC executable ?

                  Q2 - Rather than have it generate the CMP signal, could you change the 720 to 360 so we get a pulse every crank rotation and create a pulse structure such that the signal contains the value 128 forever except one tooth width at 255 followed by a tooth width at 0 and recompile that ?
                  Paul Nugent
                  Webmaster http://S2central.net
                  Administrator http://S2forum.com

                  1994 S2 Coupe ABY - aka Project Lazarus
                  2001 A6 allroad 2.5TDi - family tank
                  2003 S4 Avant 4.2 V8 - daily burble

                  Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

                  There are only 10 kinds of people that understand binary - those that do, and those that don't

                  Comment

                  • S2central.net
                    Retired OG Mod
                    • Jul 2003
                    • 16590
                    • Country: Northern Ireland

                    #24
                    File attached with waveforms & some info from last nights initial tests.
                    Attached Files
                    Paul Nugent
                    Webmaster http://S2central.net
                    Administrator http://S2forum.com

                    1994 S2 Coupe ABY - aka Project Lazarus
                    2001 A6 allroad 2.5TDi - family tank
                    2003 S4 Avant 4.2 V8 - daily burble

                    Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

                    There are only 10 kinds of people that understand binary - those that do, and those that don't

                    Comment

                    • Nuvo
                      S2Forum Possessed
                      • Nov 2003
                      • 3825

                      #25
                      Okay Paul, I'll get back to you when I get a chance to look a this.

                      Have I understood you correctly that you want a single binary with both these changes? Or do you want two binaries, one containing changes as described in Q1 and a second file with the changes listed in Q1 and Q2?

                      Comment

                      • S2central.net
                        Retired OG Mod
                        • Jul 2003
                        • 16590
                        • Country: Northern Ireland

                        #26
                        Oh yeah - two separate bins please - cool !
                        Paul Nugent
                        Webmaster http://S2central.net
                        Administrator http://S2forum.com

                        1994 S2 Coupe ABY - aka Project Lazarus
                        2001 A6 allroad 2.5TDi - family tank
                        2003 S4 Avant 4.2 V8 - daily burble

                        Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

                        There are only 10 kinds of people that understand binary - those that do, and those that don't

                        Comment

                        • Nuvo
                          S2Forum Possessed
                          • Nov 2003
                          • 3825

                          #27
                          Okay, here is the first build with your change request in Q1. I'll take a look at Q2 when I have a bit more time.
                          Attached Files

                          Comment

                          • S2central.net
                            Retired OG Mod
                            • Jul 2003
                            • 16590
                            • Country: Northern Ireland

                            #28
                            Nice one NUvo... Just tried it and the CMP pulse is definitely wider - circa 8ms at idle which is right ball park. I need to do more detailed timings off the car though.

                            However - that build is broken somehow as it didn't generate the RPM signal here - just the CMP. Weird... I see you started to add some extra radio buttons... Maybe this is WIP for something
                            Paul Nugent
                            Webmaster http://S2central.net
                            Administrator http://S2forum.com

                            1994 S2 Coupe ABY - aka Project Lazarus
                            2001 A6 allroad 2.5TDi - family tank
                            2003 S4 Avant 4.2 V8 - daily burble

                            Purveyor of HomeFries and Exclusive agent for Samco hose kits (S2/RS2)

                            There are only 10 kinds of people that understand binary - those that do, and those that don't

                            Comment

                            • Nuvo
                              S2Forum Possessed
                              • Nov 2003
                              • 3825

                              #29
                              Originally posted by S2central.net
                              Nice one NUvo... Just tried it and the CMP pulse is definitely wider - circa 8ms at idle which is right ball park. I need to do more detailed timings off the car though.
                              That's a good start.

                              Originally posted by S2central.net
                              However - that build is broken somehow as it didn't generate the RPM signal here - just the CMP. Weird... I see you started to add some extra radio buttons... Maybe this is WIP for something
                              Hmm that is odd, I haven't made any other changes to the code or the interface.
                              The only other change I made was the way in which the MS Foundation Class library is linked. This was a consequence of the comiler I am using.
                              I retrace my steps and see if I can fix that.

                              Comment

                              • robert_n
                                S2Forum Addict
                                • Aug 2008
                                • 357
                                • Home: Scotland Current: England

                                #30
                                There is a whole industry based around this so you should be able to source info about how to set up a model for this (or get a free one). In my work all of the models (be it engine/suspension/whole car etc) are set up in a Simulink (Matlab environment) and there are many commercially available and some free (i think) models for environments like this. It can be a really powerful tool for testing ecus. The style of modeling used is ideal as you can change parameter sets to change engines etc. I am not sure what hardware you would use with a system like this for private use though as all our stuff costs a fortune.

                                Comment

                                Working...