doug72 Posted March 25, 2020 Posted March 25, 2020 (edited) Is this sensor momentry or ON / OFF ? Want use it to start the program when GBC Train docks and stop program as train departs or should I use the colour sensor ? Complete novice at programming Have rebuilt & improved my Transfer Crane GBC train module using EV3 motors. I hope to use it to learn how to make it run with EV3. Large motor 1 = Raising & lowering the ball carrier hopper lifting frame Large motor 2 = Traverse lifting carriage between Train and Ball loading point. Medium Motor = Operate train trip reverser. Touch Sensor = start program as train docks & stop programs as train departs. N.B. Train will run continuously while in the dock but wil not power the normal reverser Edited March 25, 2020 by Doug72 Quote
Coder Shah Posted March 30, 2020 Posted March 30, 2020 The sensor can detect if it's pressed(on), released(off) or bumped(momentarily on). Quote
dr_spock Posted March 30, 2020 Posted March 30, 2020 https://ev3-help-online.api.education.lego.com/Retail/en-us/page.html?Path=blocks%2FLEGO%2FTouchSensor.html Quote
doug72 Posted March 31, 2020 Author Posted March 31, 2020 (edited) EV3 Program for GBC Transfer Gantry Crane I have finally had a go at programing the EV3 using Mac OS Catalina 10.15.4. Have manually tested the module to determine the number of reverlutions required for each step. Built a test rig and made a program to run it before install the motors on the module. Touch Sensor: mounted so that the train activates the switch so that the internal spring does not push train backwards in the dock. Complete novice at this but see attached program block which gives the steps required. However I can only get it to operate for one cycle and have to download the programe to start again. So far unable to find the correct block to activate the program the next time the touch sensor is activated. Any help would be appreciated - thanks in advance. Motor A = raise & lower the ball carrier. Motor B = traversing the carriage from train to loading point & back. Motor C = activates the train reverser trip to release the train with 30 balls. Edited March 31, 2020 by Doug72 Quote
dr_spock Posted March 31, 2020 Posted March 31, 2020 I think you have to stick every after the when program starts block into a loop to repeat the sequence. https://cs.harvard.edu/malan/scratch/loops.php Quote
doug72 Posted March 31, 2020 Author Posted March 31, 2020 (edited) 3 hours ago, dr_spock said: I think you have to stick every after the when program starts block into a loop to repeat the sequence. https://cs.harvard.edu/malan/scratch/loops.php Thanks for your help, I have tried various ways of putting the "forever block" into my program but can't get it work. Not sure what you mean by "stick every time". I need the train to start the program every time it enters the train dock and stop the program until train arrives again. Now mounted the motors onto the transfer Crane module and adjusting the various settings to lift ball hopper on & off the train. Meanwhile its my LXXIII birthday today and I have just received a very large Box from Amazone containing a 42100 set which my son has given me. I will have plenty of time to build it and learn how to control, as in lock down possible for up to 3 months !!!!! That link you provided looks to be very useful for learning EV3 using Mac OS. Edited March 31, 2020 by Doug72 Quote
dr_spock Posted March 31, 2020 Posted March 31, 2020 Sorry about that, I meant to say "stick everything after the when program starts..." That way it'll run that segment of code in a continuous loop. It'll wait for the button press and do your sequence of steps and then go back to the top of the loop and wait for the button press again. Probably easier to explain in person but that's not happening. Happy Birthday! Have a good one. Quote
doug72 Posted March 31, 2020 Author Posted March 31, 2020 (edited) 3 hours ago, dr_spock said: Sorry about that, I meant to say "stick everything after the when program starts..." That way it'll run that segment of code in a continuous loop. It'll wait for the button press and do your sequence of steps and then go back to the top of the loop and wait for the button press again. Probably easier to explain in person but that's not happening. Happy Birthday! Have a good one. PROBLEM SOLVED. I have changed the start block to "When sensor 1 pressed" and works OK every time when pressed. See revised program, I just have to set various settings now to line up with the train dock and loading point and set speeds for each step. Edited March 31, 2020 by Doug72 Quote
doug72 Posted April 1, 2020 Author Posted April 1, 2020 (edited) GBC Train Transfer Gantry Crane using EV3 (WIP) Now adapted my transfer crane module to be controlled by an EV3 unit. This was my first attempt at programming and took a lot of trial & error before success using EV3 for Mac OS Catalina. Train arriving activates the touch sensor and starts the sequence of movements:- Lift empty ball hopper off the train. Transfer to loading point and lower. Load balls up to 30 per trip. Raise loaded ball hopper and transfer back to over the train. Lower back onto the train unit. Now devised a way to release the train using an EV3 Medium motor to activate the reverser to release train. Motor set to turn the trip rotor for 180 degs, which gives a double hit to ensure the train leaves the dock. At the moment the train motor continues to run throughout the sequence and need to find a way to stop train motor after it docks. I had to alter the program in the last post slightly for the medium motor. Possible could use a cam system driven by EV3 medium motor to push the trip bar just enough to stop the train motor running. When the ball hopper is back on the train move the trip beam to full travel to start train to leave the dock. Photos and possibly a short video tomorrow. Edited April 1, 2020 by Doug72 Quote
doug72 Posted April 2, 2020 Author Posted April 2, 2020 Some small modifications to stop train motor when it docks and starts the programe plus a short video with crash at the end !! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.