geoff
-
Posts
381 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Gallery
Events
Exhibition Layout Details
Store
Posts posted by geoff
-
-
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
-
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
- 1
-
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
-
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
-
OK Geoff, progress with the stepper motor. Do you have a volt meter (multimeter)?
Ray.
Yes Ray.
-
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.
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
-
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.There appears to be no sign of electrification at Sharnbrook that I could see.
Geoff
-
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.
-
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
-
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
-
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
-
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 objectAccelStepper stepper2(forwardstep2, backwardstep2);void setup(){AFMStop.begin(); // Start the shield//configure pin3 as an input and enable the internal pull-up resistorpinMode(3, INPUT_PULLUP);//read the sensor (open collector type) value into a variableint sensorVal = digitalRead(3);// step forward to sensor index pointwhile (sensorVal == HIGH) {sensorVal = digitalRead(3);forwardstep2();delay(50);}delay(5000);// set stepper speed, acceleration and positionstepper2.setMaxSpeed(50.0);stepper2.setAcceleration(10.0);stepper2.moveTo(800);}void loop(){// Change direction at the limitsif (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:} -
-
Ok Ray will do. Should I delete any other references to Turntable test?
Thank you.
Geoff
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
-
Hi Geoff, looks like you've lost the program. Go back to post 17, copy paste the code into a new file and edit the include line as 1. above i.e. insert '_MS' and save.
Hope this helps.
Don't worry we'll get there............
Ray.
Ok Ray will do. Should I delete any other references to Turntable test?
Thank you.
Geoff
-
"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
-
-
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
-
Hi Geoff.
Having just looked at my PC i'm not so sure about the above.
If you still get the same error or similar message can you post a screen shot of the 'utility' folder contents.
Ray.
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
-
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
-
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
-
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
-
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
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
-
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
DCC Controlled (PECO) Turntable Project using a Arduino Uno
in DCC Discussion Topics (not questions)
Posted
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