Announcement

Collapse
No announcement yet.

Medium Pimpin' - 1995 E300 diesel build

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bravo good sir. I am jealous of your free time to tackle a project of this magnitude:
    1. Building an Air system from scratch? Check.
    2. Learning C++? Check.
    3. Building a keyless entry system and custom air ride control from scratch? Check.


    Hopefully one day I will be able to simply refer to this thread, purchase necessary pieces, and shamelessly copy all of your hard work.

    Comment


    • Digging this so far, and awesome attention to detail man, something alot of people forget about when modifying cars

      Comment


      • good ol' c++ I actually read all your code.And enjoyed it. How come no Endif ? I went to school for programming a few years back Only took a couple C++ classes mostly all C# ASP.NET experience here. Did You know kids in india are taught c++ at a grade school level. Imagine if US schools taught C++ to elementary school children! LOL anyway.... Love the work going into this dude!
        C280 Build Thread
        C43 ///AMG Build Thread
        E320 Wagon Build Thread


        Follow me on Instagram:@SD_210

        Comment


        • Originally posted by DER E30 View Post
          THis is gonna be sweet!

          Should do puddle lights or something also powered by the relays when you air up and down.
          That's actually a great idea! Since this build has some obvious VIP-style influences, that would be a good detail to add. I've got an extra couple of relays on my relay board that I could easily put to use.

          Originally posted by speakerboy View Post
          Bravo good sir. I am jealous of your free time to tackle a project of this magnitude:
          1. Building an Air system from scratch? Check.
          2. Learning C++? Check.
          3. Building a keyless entry system and custom air ride control from scratch? Check.


          Hopefully one day I will be able to simply refer to this thread, purchase necessary pieces, and shamelessly copy all of your hard work.
          Ha! I’d be flattered. There is just so little information on building W124s on the Internet (at least in English), it’s the least I can do to share my trials and tribulations for those to come.

          Originally posted by tyler589 View Post
          Digging this so far, and awesome attention to detail man, something alot of people forget about when modifying cars
          Thanks so much! Lots more to come!

          Originally posted by SD202 View Post
          good ol' c++ I actually read all your code.And enjoyed it. How come no Endif ? I went to school for programming a few years back Only took a couple C++ classes mostly all C# ASP.NET experience here. Did You know kids in india are taught c++ at a grade school level. Imagine if US schools taught C++ to elementary school children! LOL anyway.... Love the work going into this dude!
          Why no endif? Probably because I don’t know what I’m doing . If my understanding is correct, endif is only used as part of a preprocessor directive, as in an #if / #endif block for conditional compiling or whatever. Regular if statements can be killed with a closing curly brace. That might be wrong, being that the extent of my programming experience is limited to terrible high school projects in long-dead languages that mostly didn't work.

          Incidentally, I remember being taught BASIC in grade school, probably on an Apple II. Most of our programs consisted of something like

          10 PRINT “DICKS”
          20 GOTO 10

          We thought we were pretty. fucking. hilarious.



          Comment


          • Might just have to snatch up that C code and also do a DIY keyless entry

            But why'd you opt for initializing certain variables instead of #define though?

            Comment


            • Originally posted by Loch Ness Dongster View Post
              Might just have to snatch up that C code and also do a DIY keyless entry
              Steal it, modify it, make it better! I will say, if you're just looking for keyless, it's a lot cheaper to just get an off-the-shelf unit off eBay or wherever.

              Originally posted by Loch Ness Dongster View Post
              But why'd you opt for initializing certain variables instead of #define though?
              Because I don't know what I'm doing

              You're right, I don't need to treat all those constants at the top as variables. From what little I've read, #define is largely a stylistic holdover from C which didn't have constants. At least according to the Arduino documentation, const is preferred these days, since #define has the pitfall of #define foo 0 overwriting foobar as 0bar. Mostly I'm trying to avoid using preprocessor directives since I'm not very familiar with them.

              I will change those constants at the top of the code to actual constants, though!

              EDIT: Just went through and constant-ized all the constants at the top of the code and saved 120 bytes, which is actually pretty significant on a 2.4KB program. Yay! Thank you, Mr. Dongster! The code in the post above should be updated in a second.
              Last edited by Oh Damn, it's Sam; 04-30-2014, 08:26 PM.



              Comment


              • When it comes to programming, it's all about efficiency Although when the Arduino compiles your code, it will automatically optimize your code. Just in this case, the const is a sure fire way to prevent any of your code itself from accidentally modifying those variables. Also, using preprocessor #define is just a stylistic habit for me. It essentially does the same thing.

                But anyways, I have an Arduino Uno and also a a club lab here at my Uni so when I have some time, I'm probably going to try and tinker/optimize with your code and see where I get. Maybe I'll use this for a class project

                EDIT: Actually, using #define might make the code run faster as what happens is that no variables are initialized, rather the variables used in the loop are then referred to the value for the said variable, thus may raise efficiency. If you can, try it and let me know if it made any difference :O
                Last edited by Loch Ness Dongster; 04-30-2014, 09:01 PM.

                Comment


                • Originally posted by Loch Ness Dongster View Post
                  But anyways, I have an Arduino Uno and also a a club lab here at my Uni so when I have some time, I'm probably going to try and tinker/optimize with your code and see where I get. Maybe I'll use this for a class project
                  Do it! I'd love to see what you come up with!

                  Originally posted by Loch Ness Dongster View Post
                  EDIT: Actually, using #define might make the code run faster as what happens is that no variables are initialized, rather the variables used in the loop are then referred to the value for the said variable, thus may raise efficiency. If you can, try it and let me know if it made any difference :O
                  So, to test this, I copied the program, changed all the const ints to #defines, and added a digitalWrite to kick on an LED as soon as the loop void started. I then ran both the const int version and the #define version with a video camera watching at 30 fps. For the #define version, which should be more efficient as you suggest, I measure 1.47s from Arduino power-up until the loop void is reached. For the version where I initialize all those constants, which should be less efficient, I get... drumroll please... 1.47s. The two were frame-for-frame identical in speed.

                  To test whether using #define was any faster in the main loop than constantly pulling constants from memory, I asked each program to dump its timer (the millis() function) over the serial port. No doubt this slows the program somewhat, since the serial port on an Arduino is sloooooooow, but it should be the same amount of slowing for both programs. I let each program dump to the serial monitor for about 30 seconds, copied the contents of the serial monitor to an Excel spreadsheet, and averaged the lengths of time between each timer output. Millis() only has a 4ms resolution, so there's error in each measurement, but averaged over approximately 3500 measurements, the error should average out. The resultant should be the average amount of time the program takes to complete the main loop of the program, listening for remote inputs and then not doing anything since there aren't any. This pulls a few constants from memory (4 of the 15 to be exact), so if there's a difference between methods, it should show.

                  The results are as follows: for the #define version, the average loop speed was 7.0703ms. For the version with constants, the loop speed was 7.0688ms. In fact, the two timer dumps are line for line identical with the difference in times a result of the fact that I killed the serial dump on the version with constants about 154ms before the #defines version. It appears the two are precisely the same in terms of speed.

                  I'm guessing that, while #defines has some obvious and non-trivial efficiency advantages, the program is so simple and fast that they're just not showing in testing.
                  Last edited by Oh Damn, it's Sam; 04-30-2014, 11:25 PM. Reason: jesus christ, you'd think I could speak english



                  Comment


                  • Originally posted by Oh Damn, it's Sam View Post
                    Do it! I'd love to see what you come up with!



                    So, to test this, I copied the program, changed all the const ints to #defines, and added a digitalWrite to kick on an LED as soon as the loop void started. I then ran both the const int version and the #define version with a video camera watching at 30 fps. For the #define version, which should be more efficient as you suggest, I measure 1.47s from Arduino power-up until the loop void is reached. For the version where I initialize all those constants, which should be less efficient, I get... drumroll please... 1.47s. The two were frame-for-frame identical in speed.

                    To test whether using #define was any faster in the main loop than constantly pulling constants from memory, I asked each program to dump its timer (the millis() function) over the serial port. No doubt this slows the program somewhat, since the serial port on an Arduino is sloooooooow, but it should be the same amount of slowing for both programs. I let each program dump to the serial monitor for about 30 seconds, copied the contents of the serial monitor to an Excel spreadsheet, and averaged the lengths of time between each timer output. Millis() only has a 4ms resolution, so there's error in each measurement, but averaged over approximately 3500 measurements, the error should average out. The resultant should be the average amount of time the program takes to complete the main loop of the program, listening for remote inputs and then not doing anything since there aren't any. This pulls a few constants from memory (4 of the 15 to be exact), so if there's a difference between methods, it should show.

                    The results are as follows: for the #define version, the average loop speed was 7.0703ms. For the version with constants, the loop speed was 7.0688ms. In fact, the two timer dumps are line for line identical with the difference in times a result of the fact that I killed the serial dump on the version with constants about 154ms before the #defines version. It appears the two are precisely the same in terms of speed.

                    I'm guessing that, while #defines has some obvious and non-trivial efficiency advantages, the program is so simple and fast that they're just not showing in testing.
                    Ah, so it mostly is a stylistic choice then. That's actually good to know especially for future projects. Your claim that the program is too simple to be affected by the code sounds about right. Thanks for testing it out!

                    Comment


                    • So, Leavenworth's coming up, and it sounds like I'm going, so aside from it officially being time to start spamming my Instagram feed with #leavenworthprep hashtags like all you SoWo assholes did a few weeks back, it's actually time to get something done on the big lumbering beast.

                      Some of you may remember that back in the Paleozoic era I got myself a set of wheel spacers, but needed to roll my fenders to fit them. Well, I finally got around to rolling all four today. Having never rolled fenders before (can you believe it?), I initially wanted to get my hands on one of the Eastwood rollers, but Tonys18t's thread on the subject convinced me otherwise. I guess the squared-off fender openings on the W124 don't play well with the Eastwood roller, which makes sense.

                      Instead, I said fuck it and rolled 'em with a deadblow hammer and a pair of vice grips. I got a little paint cracking on the left rear fender, which I expected, since that side has been somewhat poorly repainted, and the paint is thus very thick there. Other than that, I accomplished a fairly tight roll without managing to bacon up my fenders. Yay me!

                      First, since I'm installing spacers, I had to get longer lug bolts, which I have previously ranted at you all about. After Baxter Auto Parts fucked up my order and wouldn't help me get the right bolts, I ordered some from Otis Inc., who were just completely awesome, and actually quite a bit cheaper than anything local:



                      I now have no less than three sets of lug bolts for the car, 24mm cone set for the front wheels, 39mm cone seats for the rears, and whatever ball seat for the stock spare.

                      The spacers I snagged off Amazon fit perfectly, and thankfully come with a hubcentric lip for the wheels to rest on. Very nicely-made, and very inexpensive:



                      Here's a couple before and after shots so you can see the difference the spacers make. Please ignore any water spots and/or spider webs:

                      Before:



                      and after:



                      I probably could have gotten away with a 20mm spacer in reality, and I may yet go that direction, but that would require a fender pull. Since I don't know how much of my left rear fender is body filler (I'm guessing the amount is more than zero, since that side's been resprayed), I'm hesitant to do a pull until I can afford to respray the car. Nevertheless, it looks MILES better than it did, and I'm super happy with the way the car sits with the spacers.

                      And a gratuitous ghetto booty shot for y'all:
                      Last edited by Oh Damn, it's Sam; 05-27-2014, 03:47 PM. Reason: fucking flickr



                      Comment


                      • Wow, those spacers really improve the fitment.

                        I'm dieing to see that arduino setup in action

                        𝔣𝔬𝔩𝔩𝔬𝔴 𝔪𝔢
                        @𝔳𝔦𝔳𝔢_𝔪𝔢𝔪𝔬𝔯_𝔩𝔢𝔱𝔦

                        Comment


                        • Originally posted by rice4life View Post
                          I'm dieing to see that arduino setup in action
                          Meeeee tooooooo! It's coming soon, I promise!

                          One more pic to show the current fitment:


                          Need to order some R129 top mounts to get the front just a hair lower, but I'm getting to where I'm very happy



                          Comment


                          • Comment


                            • 1995 Mercedes-Benz W124 E320

                              Comment


                              • btw, what offset and width are your wheels? Thanks!
                                1995 Mercedes-Benz W124 E320

                                Comment

                                Working...
                                X