Jump to content
RMweb
 

geoff

RMweb Gold
  • Posts

    381
  • Joined

  • Last visited

Posts posted by geoff

  1. OK Geoff, Looks like the sensor is working ok so you should be able to get the voltage to drop to almost zero with the magnet on the turntable deck and the sensor on the outside of the well. Try with the sensor the other way around. Have another look at post 4 for reference. Are you using the PECO turntable?

     

    Ray.

    Crossed posts I think Ray. No my turntable is a SEF (Wills Finecast). I had the sensor printed side to the wall, as you did I believe, but as you will see from my previous post it just seemed to need repositioning. I will do that and report back.

     

    Geoff

  2. Ok, if you set the voltmeter to a DC range of 10volts or nearest equivalent and connect the negative probe to the GND connection and the positive probe to I/O3 on the Adafruit board you should see a reading of about 5 volts which should drop to near 0volts when the magnet is directly adjacent to the sensor. If this doesn't happen try turning the sensor around. If still no joy, remove the sensor and place a magnet directly on it and report back.

     

     

    Ray.

     

    Ray, I have checked the voltage which is 4.95v and while the turntable is rotating past the sensor this doesn't change. I removed the sensor and held the turntable deck with the magnet 2 or 3mm away from the sensor face which had been fixed to the outside of the well and the voltage dropped away to almost zero. 

     

    Geoff

  3. Ok, if you set the voltmeter to a DC range of 10volts or nearest equivalent and connect the negative probe to the GND connection and the positive probe to I/O3 on the Adafruit board you should see a reading of about 5 volts which should drop to near 0volts when the magnet is directly adjacent to the sensor. If this doesn't happen try turning the sensor around. If still no joy, remove the sensor and place a magnet directly on it and report back.

     

     

    Ray.

     

    Will do Ray.

     

    Geoff

  4. Hi Geoff.

    I won't be around much until tomorrow evening so here's a picture of my Stepper motor wiring. Assuming you have the same motor this is how it should be wired.

     

    attachicon.gifIMG_0117.jpg

     

     

    Ray

     

    PS, Just in case: Have you connected a 9-12 volt DC supply to the Power terminal of the Adafruit module

     

    Hello Ray,

    I have reconnected the motor so that my connections accord with yours and after moving the working programme back into the Adafruit library I have the turntable rotating slowly, round and round but with the programme uploaded it does not stop at the sensor. I have adjusted the magnet to be as close to the wall of the well as I dare, the well is vacuum formed plastic and quite thin. The green wire from the sensor is connected via the DCC interface board to I/O3 on the Adafruit shield as per the diagram you posted earlier in this thread. More head scratching I think.

    The attached photo was taken in the beginning of the construction and shows the motor wires incorrectly connected.

     

     

    Geoff

    post-224-0-71584600-1502285703.jpg

  5. There appears to be no sign of electrification at Sharnbrook that I could see.

    Last Thursday there was quite a lot of activity between Sharnbrook and Souldrop on the slow line which looked to be in connection with re-laying the second track. There are also pilings, on the up side at least, in places north of Bedford but they were installed in the original phase before the pause believe.

     

    Geoff

  6. Ray, I have a 12v supply to the adafruit board. I need to check the wiring of the motor, it is similar to yours but I cannot be sure of the exact order of the colours in relation to yours. I have just nipped up to the loft and checked it.The red and yellow are to M4 and the blue and green to M3. I see that differs from your wiring. I will swap them over tomorrow and see how I get on. When I have this all working how do I power the arduino without having the laptop hooked up to it?

     

    Geoff

     

    edit: the coax jack is not on the adafruit board, I used it to make an easy  connection from the power supply I am using.

  7. Hi Geoff.

     

    Yes, delete everything after stepper2.run();  and add a curly bracket so it looks like this:

     

    stepper2.run();

     

    }

     

    If this compiles without errors and still oscillates a few degrees we probably need to check the wiring of the stepper motor.

    Ray.

     

    Thanks Ray, that is what I had done and it compiled straight away but as you say left the turntable just oscillating a couple of degrees. I was really pleased to get that far and I cannot thank you and Robin enough. I have shut up shop for tonight but I will check the wiring tomorrow some time I hope.

    Thank you so much for all the time you have given to this. I am sure I will be back here tomorrow with more questions.

     

    Geoff

  8. Not to me. Can you post the complete program as an attachment so I can look at it in my text editor?

     

    ...R

     

    Here you go Robin. It is a copy and paste of Ray's programme from post 17 with the adjustment to the wording to include MS_ as suggested by Ray in post 425.

     

    Geoff

    PS I notice looking through it that the alteration to insert MS_ in the line "utility/Adafruit_PWMServoDriver.h"// Turntable test routine has not appeared even though I am sure I did it and saved it.

    //
    // Requires the Adafruit_Motorshield v2 library 
    // And AccelStepper with AFMotor support 
     
    // This sketch is for Adafruit Motorshield v2 only!
    // Will not work with v1 shields
     
    #include <AccelStepper.h>
    #include <Wire.h>
    #include <Adafruit_MotorShield.h>
    #include "utility/Adafruit_PWMServoDriver.h"
     
    Adafruit_MotorShield AFMStop(0x60); // Default address, no jumpers
     
    // Connect stepper with 200 steps per revolution (1.8 degree)
    // to the M3, M4 terminals (blue,yellow,green,red)
     
    Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200, 2);
     
    // you can change these to SINGLE, DOUBLE, INTERLEAVE or MICROSTEP!
     
    // wrapper for the motor! (3200 Microsteps/revolution)
    void forwardstep2() {  
      myStepper2->onestep(FORWARD, MICROSTEP);
    }
    void backwardstep2() {  
      myStepper2->onestep(BACKWARD, MICROSTEP);
    }
     
    // Now we'll wrap the stepper in an AccelStepper object
     
    AccelStepper stepper2(forwardstep2, backwardstep2);
     
     
    void setup()
    {  
      
      AFMStop.begin(); // Start the shield
      
      //configure pin3 as an input and enable the internal pull-up resistor
      pinMode(3, INPUT_PULLUP);
      //read the sensor (open collector type) value into a variable
      int sensorVal = digitalRead(3);
       
     
     
    // step forward to sensor index point
      while (sensorVal == HIGH) {
        sensorVal = digitalRead(3);
        forwardstep2();
          delay(50);
      }
      delay(5000);
      
    // set stepper speed, acceleration and position 
      stepper2.setMaxSpeed(50.0);
      stepper2.setAcceleration(10.0);
      stepper2.moveTo(800);  
      
    }
     
    void loop()
    {
        // Change direction at the limits
     
        if (stepper2.distanceToGo() == 0)
           { delay(5000);
      stepper2.moveTo(-stepper2.currentPosition());
           }
     
        stepper2.run();
    }void setup() {
      // put your setup code here, to run once:
     
    }
     
    void loop() {
      // put your main code here, to run repeatedly:
     

     

    }
  9. "redefinition of void setup()" means that you have two functions with the same name which is not allowed.

     

    ...R

     

    I am sure you are right Robin but it means nothing to me I am afraid. All I thought I had done was as Ray suggested in the posts above. Thank you any way for your contribution which may help Ray to help me. I am putting folk to a lot of trouble with this I am sorry to say.

    Thank you.

     

    Geoff

  10. OK Geoff.

    I can see what has happened. The turntable test routine is looking for a file 'Adafriut_PWMServoDriver.h' and the latest download reincarnation of the AdaFruit routines have renamed it to 'Adafriut_MS_PWMServoDriver.h'

     

    So you have two choices.

    1. change the line in the Turntable Test routine by inserting the '_MS' part to the include statement.

    2. rename the two files removing the '_MS' part of the filename from the utility folder

     

    I'd give 1. a try first. (You my have to also move the 'Utility' folder back to the Adafru...Library.)

     

    Ray.

     

    Thanks Ray. I will work through those and report back on the outcome.

     

    Geoff

  11. Thank you Ray . I will give that a go and report back. May I bother you with some further questions please. Currently when I power up the set up it launches into the stepper test and will continue indefinitely until I disconnect the power. How do I stop it? Also, should I succeed in getting this working how is the Arduino powered without the laptop hooked up to it?  Also, sorry about this, I have a spare wire connected to the DCC interface board which is connected to the circuit marked 'reset' on the diagram. Do I need this and if so how should it be connected to the Arduino, through a switch or directly to the board? Sorry to keep asking but this really is uncharted territory for me.

     

    Many many thanks.

    Geoff

     

    Me again Ray. I have done as you suggested but I still get the same outcome.

     

    Geoff

    post-224-0-09522500-1502200228_thumb.png

    post-224-0-32429700-1502200250_thumb.png

    post-224-0-27565700-1502200269_thumb.png

     

  12. Hi Geoff

    I've just checked the Arduino file structure of my PC installation.

    Try this.

     

    Move the Accelstepper-master directory and all its content up one level so its appears under the libraries directory and remove the -master from the directory name so is just 'Accelstepper'

     

    Ray.

     

    Thank you Ray . I will give that a go and report back. May I bother you with some further questions please. Currently when I power up the set up it launches into the stepper test and will continue indefinitely until I disconnect the power. How do I stop it? Also, should I succeed in getting this working how is the Arduino powered without the laptop hooked up to it?  Also, sorry about this, I have a spare wire connected to the DCC interface board which is connected to the circuit marked 'reset' on the diagram. Do I need this and if so how should it be connected to the Arduino, through a switch or directly to the board? Sorry to keep asking but this really is uncharted territory for me.

     

    Many many thanks.

    Geoff

  13. Hi Geoff.

    Sorry for not getting back sooner, been offline for a few days.

     

    Looks from your last screen shots that the Accelstepper.h file is missing. It's something i missed out when doing the original posts but was picked up by PhilNE in post 23.

     

    You need to download an install the files from here:

     

    https://github.com/a...it/AccelStepper

     

    Hope this helps.

     

    Ray.

     

    Hello Ray, far from you apologising it should be me for being so inept at this. I picked up on the file you mentioned and thought I had installed it but clearly there is something amiss still. Here is a screen shot of the list of files I have,

     

    Geoff

    post-224-0-80779900-1502195848.png

  14. Hello Ray and Ian,

    I have just started to move onto the next step and immediately I have run into a snag. The program for testing out the Hall effect switch arrangement will not upload.I would appreciate your further assistance as I am definitely hanging onto the life raft now!

    I have attached a screen shot of the arduino programme report.

     

    Thanks

     

    Geoff

     

    attachicon.gifScreenshot 2017-08-04 14.41.04.png

     

    Further to the above post, I have tried to solve this by hopefully ensuring I have all the correct files/ libraries set up but since I don't really know what I am doing it could all be wrong. However here are some further screen shots. I will be very grateful if someone can help me resolve this. 

     

    Thank you in anticipation.

     

    Geoff

    post-224-0-22474500-1502189252_thumb.png

    post-224-0-36386800-1502189097_thumb.png

  15. The siege of Kettering.

    As previously reported bridge strengthening works have closed one of the main routes into and out of Kettering for the duration of the school holidays. We are clinging on grimly in the face of overwhelming odds!!

    The work at the Northampton Road bridge.  I had seen what appeared to be a concrete pump reaching over the parapet of the up side but since I was driving I thought better of trying to take a photo with my phone. Some wouldn't!!!!!

     

    post-224-0-84804000-1502101235.jpg

    Up side of the slow lines part of the bridge.

    post-224-0-10777100-1502101274.jpg

    Underneath the arches ( With acknowledgement to Flanagan and Allen)

    post-224-0-00253800-1502101303.jpg

    Down side of the main line part of the bridge. The bridge actually comprises two brick arch structures from different times, one from the original line build and one from the widening to four tracks and the arches are of differing heights, much to the chagrin of unwary truck and bus drivers over the years.

    post-224-0-89796100-1502101326.jpg

    A promissory note ( a sort of IOU )

    post-224-0-13594100-1502101347.jpg

    The instruction sheet.

     

    Geoff

×
×
  • Create New...