Jump to content
 

jbsorocaba

Members
  • Posts

    34
  • Joined

  • Last visited

jbsorocaba's Achievements

4

Reputation

  1. Hi guys DCC++ work very well and yo can find more project on Bodnar site. Last month i build a DCC++ wireless to work with Roco IOS application and tyhis way you can controll your trains with your smatphone Arduino has now a Mega with wifi ( https://robotdyn.com/mega-wifi-r3-atmega2560-esp8266-flash-32mb-usb-ttl-ch340g-micro-usb.html ) and with a motor shield or ethernet shield you can build a wireless system or ethernet syste wit a router check this here: http://www.scalatt.it/forum/viewtopic.php?f=117&t=15263&hilit=z21+zentrale
  2. Hi ianjeffery I made a system like this for my turntable and a traverser with 4x4 keyboard. This is very interesting because you have a touch screen that gives a more beautiful layout, and dont have contacts like keyboard. Could you please if possible share with us the sketch of this interface..?
  3. Using thrust bearings on spindles, nema 17, I think will be enough.
  4. For vertical storage, I think that is better 2 spindles, driving with a stepper motor ( nema 23 ) and 4 nuts, to have the weight over the spindles. The stepper motor only make the rotation of the spindles via toothed belt.
  5. Hi Deev Sorry but I dont know how to upload videos on You Tube. However, I have a little site about model railroad (google sites - restricted access) and you can see a little movie that I made last month when I was making the setup. I have some others project there, but unfortunately they are in portuguese. Sorry..!! site: https://sites.google.com/site/dcceferromodelismo/videos
  6. Hi Deev Long time since my last post Some years ago, I saw your first post here showing a german traverser, and you wrote:" I want one." and I said to myself " I want one too" So, after long time and a mixture of sketchs last year, I finished my first traverser wit 8 tracks. I am posting here some pictures during the setup, to show a little of my project. Unfortunately the traverser is not installed because I must to make some arrangement in layout to acomodate the traverser. I want to post a movie here, but I dont have permission..!!!
  7. Hi guys I am introducing a keyboard and LCD for control of this turntable, using a sensor as a reference, connected to the Arduino pin 3 as partial sketch below. I would like to send a message to the LCD when the turntable reach the sensor so that I know that truntable stopped. I already burned the neurones but did not get anything until now. Can someone please give me a help. Tks //... void setup(){ Serial.begin(9600); // sets up Serial library at 9600 bps for a serial monitor connected to the Artduino Serial.println("Stepper test for turntable"); // prints the comment between the "" on the serial monitor when starting. lcd.begin(20,4); // initialize the lcd for 20 chars 4 lines, turn on backlight for(int i = 0; i< 3; i++) // ------- Quick 3 blinks of backlight ------------- { lcd.backlight(); delay(250); lcd.noBacklight(); delay(250); } lcd.backlight(); // finish with backlight on lcd.print(" MOVING"); lcd.setCursor(0,1); lcd.print(" TO TRACK 1 "); AFMS.begin(); // create with the default frequency 1.6KHz Astepper1.setMaxSpeed(50.0); // sets the maximum rotational speed of the stepper in steps per second. // (the value of 50 will rotate the turntable for a full revolution // in about 3200/50 seconds (i.e around 64 seconds). Astepper1.setAcceleration(10.0); pinMode(3, INPUT_PULLUP); // INPUT PARA O SENSOR DE PARA INICIAL. ADICIONADO NESTA VERSÃO int sensorVal = digitalRead(3); //read the sensor (open collector type) value into a variable while (sensorVal == HIGH) { // if near reference point move away sensorVal = digitalRead(3); forwardstep1(); delay(50); Astepper1.setCurrentPosition(0); //adicionado para posição zero ref. a todos } while (sensorVal == LOW) { // step forward to sensor index point sensorVal = digitalRead(3); backwardstep1(); delay(50); } } //..........................................................
  8. Hi gcodori Thank you so much for the informations. I will see the sites. Cheers
  9. Hi Unfortunately my system is Xpressnet and I think this will not work. I still waiting for a help Tks
  10. Hi All Is there a way to use a Arduino keyboard 4x4 as a alternative command station ( turnout command from the hand controller ) Some times is very difficult to control 2 or more locos, and the turnouts from the hand controller. Could somebody help me to change the sketch tks JB.
  11. Hi nairepooc Welcome to the club. This was a great project, that made me to build a turntable, and a traverser to have a hidden yard. Please post here as you have progress. JB
  12. Hi guys I am trying to insert servo in a Pandassum sketch, ( # 38 ) to use in my traverser, and the servo will lock the table in position. At the time, I got the servo release and after reaching the sensor it returns the starting position (brake) during startup. The stepper also release during this process and after selecting the track. What I'm not getting, is to release the servo at the moment of selection the lanes. The stepper start but the servo ( brake )continues to operate. Any help will be appreciated. Sorry for my english.. The sketch: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include <DCC_Decoder.h> #include <AccelStepper.h> #include <Wire.h> #include <Adafruit_MotorShield.h> #include "utility/Adafruit_PWMServoDriver.h" #include <Servo.h> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Defines and structures // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #define kDCC_INTERRUPT 0 typedef struct { int address; // Address to respond to } DCCAccessoryAddress; DCCAccessoryAddress gAddresses[1]; const unsigned long releaseTimeout_ms = 2000; boolean isReleased = false; //Servo Stuff Servo brakeservo; // create servo object to control a servo const int servoBrake = 90; //value for brake position const int servoRelease = 5; //value for release position ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Adafruit Setup // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 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); } void release2() { myStepper2->release(); // COMANDO PARA LIBERAR SERVO E MOTOR } // Now we'll wrap the stepper in an AccelStepper object AccelStepper stepper2 = AccelStepper(forwardstep2, backwardstep2); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Variables // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// long lngMotorPos; long lngTargetPosition; const long lngOneRev = 3200; // Essa é a linha de programação do curso: 400 é 45 graus - 3200 DÁ UMA VOLTA int intPos = 0; //set initial LED value ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // SETUP FOR LED DISPLAY // Bits representing segments A through G (and decimal point) for numerals 0-9 // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// const byte numeral[10] = { //ABCDEFG /dp B11111100, // 0 B01100000, // 1 B11011010, // 2 B11110010, // 3 B01100110, // 4 B10110110, // 5 B00111110, // 6 B11100000, // 7 B11111110, // 8 B11100110, // 9 }; // pins for decimal point and each segment // dp,G,F,E,D,C,B,A const int segmentPins[8] = { 7,11,10,9,8,6,5,4};//defines Arduino pins for each segment const int segmentSpin[6] = { 4,5,6,8,9,10};// used to "rotate" the segments while motor is moving to sensor position ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Decoder Init // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void ConfigureDecoder() { gAddresses[0].address = 200; gAddresses[1].address = 201; gAddresses[2].address = 202; gAddresses[3].address = 203; gAddresses[4].address = 204; gAddresses[5].address = 205; gAddresses[6].address = 206; gAddresses[7].address = 207; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Basic accessory packet handler // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void BasicAccDecoderPacket_Handler(int address, boolean activate, byte data) { // Convert NMRA packet address format to human address address -= 1; address *= 4; address += 1; address += (data & 0x06) >> 1; boolean enable = (data & 0x01) ? 1 : 0; // Check for DCC imput & determine entered address switch (address) { //Set target position based on address selected case 200: lngTargetPosition = lngOneRev*0; // ESSE VALOR FOI ALTERADO PARA QUE O ENDEREÇO 200 SEJA PONTO DE REFERENCIA - ERA 1 AQUI intPos=1; break; case 201: lngTargetPosition = lngOneRev*1; intPos=2; break; case 202: lngTargetPosition = lngOneRev*2; intPos=3; break; case 203: lngTargetPosition = lngOneRev*3; intPos=4; break; case 204: lngTargetPosition = lngOneRev*4; intPos=5; break; case 205: lngTargetPosition = lngOneRev*5; intPos=6; break; case 206: lngTargetPosition = lngOneRev*6; intPos=7; break; case 207: lngTargetPosition = lngOneRev*7; intPos=8; break; default: //nothing selected lngMotorPos=stepper2.currentPosition(); Serial.println(lngMotorPos,DEC); } if ( enable ) { Serial.print("Motor at: "); lngMotorPos=stepper2.currentPosition(); Serial.println(lngMotorPos,DEC); Serial.print("Moving to: "); Serial.println(lngTargetPosition); showDigit(intPos); stepper2.moveTo(lngTargetPosition); while (stepper2.currentPosition() != lngTargetPosition) // move to target position stepper2.run(); digitalWrite(segmentPins[0],0); /////////////////////////////// NEW ////////////////////////////////// { long lngTargetPosition; } //Set the servo brake brakeservo.write(servoBrake); delay(750); //release the motor release2(); Serial.println(" Brake Set & Motor Released "); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// } else { // stepper2.moveTo(2000); lngMotorPos=stepper2.currentPosition(); Serial.println(lngMotorPos,DEC); delay(1000); // showDigit(intPos); } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Setup // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void setup() //runs once to determine start position when sensor reached. { Serial.begin(9600); AFMStop.begin(); // Start the shield //servo brake release before stepp moves brakeservo.attach(10); // attaches the servo on pin 10 to the servo object brakeservo.write(servoRelease); delay (30); //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); //set stepper motor speed and acceleration stepper2.setMaxSpeed(100.0); stepper2.setAcceleration(20.0); for(int i=0; i < 8; i++)//assign pins for led display { pinMode(segmentPins, OUTPUT); // set segment and DP pins to output } showDigit(10); Serial.println("At switch off segments"); delay(1000); // if near reference point move away Serial.println("Check for reference point"); // sensorVal = digitalRead(3); // RETIRADO MOMENTANEAMENTE ATE CONCLUSÃO FINAL while (sensorVal == LOW) { sensorVal = digitalRead(3); Serial.println("At Sensor"); Serial.print("Motor at: "); lngMotorPos=stepper2.currentPosition(); Serial.println(lngMotorPos,DEC); intPos=0; showDigit(intPos); forwardstep2(); delay(50); } // step forward to sensor index point // sensorVal = digitalRead(3); //RETIRADO TEMPORARIAMENTE while (sensorVal == HIGH) { sensorVal = digitalRead(3); Serial.println("Moving to sensor"); lngMotorPos=stepper2.currentPosition(); Serial.println(lngMotorPos,DEC); intPos=0; showDigit(intPos); backwardstep2(); delay(50); } //when home- sets brake delay (500); brakeservo.write(servoBrake); //release the motor release2(); Serial.println(" Brake Set & Motor Released "); digitalWrite(segmentPins[0],0); //DP off //digitalWrite(segmentPins[1],1); for(int i=0; i < 7; i++) //Switch on segments { digitalWrite(segmentSpin,1); delay(50); digitalWrite(segmentPins[0],1); //DP on //digitalWrite(segmentPins[1],1); } DCC.SetBasicAccessoryDecoderPacketHandler(BasicAccDecoderPacket_Handler, true); ConfigureDecoder(); DCC.SetupDecoder( 0x00, 0x00, kDCC_INTERRUPT ); } void showDigit( int number) //display number on seven segment display { boolean isBitSet; for(int segment = 0; segment < 8; segment++) //was 1 { if( number < 0 || number > 9){ isBitSet = 0; // turn off all segments digitalWrite( segmentPins[segment], isBitSet); } else{ // isBitSet will be true if given bit is 1 isBitSet = bitRead(numeral[number], segment); } isBitSet = ! isBitSet; // remove this line if common cathode display digitalWrite( segmentPins[segment], isBitSet); } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Main loop // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void loop() { static int addr = 0; //////////////////////////////////////////////////////////////// // Loop DCC library DCC.loop(); //////////////////////////////////////////////////////////////// // Loop Stepper stepper2.run(); } /////////////////////////////////////////////// END ///////////////////////////////////////////////////////////////////////////
  13. Jonathan Thank you so much to post the revision 17 here. This is what I was working for to merge 2 or 3 options in one sketch. I hope someone can still contribute to the enrichment of this work, and very rich in informations. I would like to thank to Ray to begin this project in a so detailed manner and to all that had give your contribution. It was a fun and brilliant project. Sorry for my english. JB
  14. Deev The sketch is working fine. I am having problem with my command ( Roco ) because when I choose the address 711 I dont have response of the traverser. I must use address 715 in my command, to have the position of address 711. i dont know what is happening, but the important thing is that the sketch is working,,, I must now adjust some parameters, to have the correct position of the tracks and something that show me where I am ( track ) when I start. But it is very easy,if i use a led panel. Again, thank you so much for expend time with me. Merry Christmas Cheers
×
×
  • Create New...