Jump to content
 

geoff

RMweb Gold
  • Posts

    381
  • Joined

  • Last visited

Everything posted by geoff

  1. Bingo Ray. It is rotating back and forth between the two marks nicely now. I will let it run for a bit before I attempt the DCC bit. I will have to use a different DCC address but you have already told me where to alter the code for that so that will be the next task. Thank you so much for your patience and help. Geoff
  2. 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
  3. Ok Ray, I think I have sorted it. I set the turntable going and held the sensor in a slightly different position and the table rotated to it and then stopped and reversed. I will disconnect the motor, refix the sensor and give it another go. Geoff remix not remix
  4. 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
  5. 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
  6. 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
  7. 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.
  8. Will do Ray, at least I have a clue as what to look for now. I will report back tomorrow. Thank you again Ray. Geoff
  9. 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
  10. Ray, Robin, I have deleted the duplicated text in the programme and it has uploaded but my turntable is just gently oscillating back and forth a couple of degrees. Partial success I think, at least it is not rattling away on the stepper test which it was before. Geoff
  11. 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 // https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library // And AccelStepper with AFMotor support // https://github.com/adafruit/AccelStepper // 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: }
  12. Ray, Robin, does this screen shot give any clues to the error? Geoff
  13. Sorry Ray I still get an error as in post 427. Robin said that "redefinition of void setup()" means that you have two functions with the same name which is not allowed. Naturally I have no idea what that means. Geoff
  14. Ok Ray will do. Should I delete any other references to Turntable test? Thank you. Geoff
  15. 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
  16. Thanks Ray. I will work through those and report back on the outcome. Geoff
  17. Hello Ray, yes same again I am afraid. I seem to have messed up big time. Are these the screen shots you need? Thank you again for all your help. Geoff
  18. Me again Ray. I have done as you suggested but I still get the same outcome. Geoff
  19. 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
  20. 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
  21. 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
  22. 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!!!!! Up side of the slow lines part of the bridge. Underneath the arches ( With acknowledgement to Flanagan and Allen) 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. A promissory note ( a sort of IOU ) The instruction sheet. Geoff
×
×
  • Create New...