Grinkle Posted April 30, 2018 Author Share Posted April 30, 2018 people want me to be spesific ok first I have a .py file that I think is a couple of DEF statements short of being a module once i have fixed that in the main file i can do the import but i think it needs a couple of lines like speed - servo_limits.speed min0 = servo_0_min max0 = servo_0_max min1 = servo_1_min etc etc max15 = servo_15_max ok help lets get past this first bit Link to post Share on other sites More sharing options...
Junctionmad Posted April 30, 2018 Share Posted April 30, 2018 Arduinos driving servos , nothing new here , loads of code around iPhone and android apps driving points , see enginedriver and wi throttle There are many cheap solutions available to drive servos, join MERG and discover them Disclaimer , I’m a MERG member Link to post Share on other sites More sharing options...
Junctionmad Posted April 30, 2018 Share Posted April 30, 2018 Ps try googling “arduino sg90 points”, videos, hints & tips , etc , all been done before 1 Link to post Share on other sites More sharing options...
Grinkle Posted April 30, 2018 Author Share Posted April 30, 2018 ok another pic all the parts layed out on the floor a closer look the parts explained a thing that looks like a laptop power supply = This is the power supply for the servos a thing that looks like a mobile phone power supply = This is the power supply for the ic's (plugs in the Pi board supplies power for the chips on the servo board) a thing that looks like an micro SD card = This is a micro SD card where the operating system and programs are stored there are two circuit boards one is a raspberry Pi zero (with pre soldered male headers) this is the brain the other circuit board is an Adafruit PWM/servo bonnet This can control the movement of up to 16 servos (when the Pi tels it to) the Pi can control up to 62 bonnets as well as act as an access point,dhcp server dns server and host apache all at the same time any more questions Link to post Share on other sites More sharing options...
Junctionmad Posted April 30, 2018 Share Posted April 30, 2018 I should point out that the devil is in the detail , cheap SG90 servos have many issues , twitching onpower up, twitching due to interference , the issue of full speed reset to default position etc. it’s a bit more complex that it initially appears. Nor is the Pi a great candidate , uncontrolled power down is an issue , as is the non real time non deterministic nature of Linux , equally it requires someone to be conversant with the Pi to simply operate points I suspect you have not examined the subject in any great depth because the solution you are proposing is rather over the top and not particularly suitable Link to post Share on other sites More sharing options...
Robin2 Posted May 1, 2018 Share Posted May 1, 2018 the parts explained How much did the different parts cost? I have built a few boards using Atmega 328 microprocessors that can each control up to 12 servos. The total cost of the board is about £6. I can control several of them from an Arduino Mega used to collect the data from the switches on the control panel. A Mega clone costs about £15. The role of the Mega could be replaced by a laptop or RPi with a suitable GUI program acting as the control panel. ...R Link to post Share on other sites More sharing options...
Grinkle Posted May 1, 2018 Author Share Posted May 1, 2018 I have listed the cost of the parts in a previous post the reason i used a RPi is because i needed a few for another project so my investment is small in this trial Just a some pre soldered pins on one of the Pi zeros and the Adafruit board someone pointed out that the Pi is over kill for this project but they are cheap and have WiFi (so no wires) since a RPi can be an access point it could host a GUI making it available to lots of different devices or you could run the GUI on a laptop, RPi, tablet, smart phone, etc (this would be better if you need to interface with multiple controllers each with its own ip address) I would like to create a system that anyone can plug together, copy an image to SD card, plug in power and be up and running A GUI can be as complicated as you wish to make it (see my earlier post about satellite imagery) the problems with RPi hard reset and twitchy servos have been addressed so many times and there are solutions Link to post Share on other sites More sharing options...
Robin2 Posted May 1, 2018 Share Posted May 1, 2018 I have listed the cost of the parts in a previous post So you did in Reply #8 - apologies for missing it I would like to create a system that anyone can plug together, copy an image to SD card, plug in power and be up and running What is stopping you? ...R Link to post Share on other sites More sharing options...
Grinkle Posted May 1, 2018 Author Share Posted May 1, 2018 only thin stopping me is I need some help with the python Link to post Share on other sites More sharing options...
Free At Last Posted May 1, 2018 Share Posted May 1, 2018 only thin stopping me is I need some help with the python Steady on now... Link to post Share on other sites More sharing options...
NinOz Posted May 1, 2018 Share Posted May 1, 2018 Can buy an arduino pro-mini and the 16 servo controller board for about 3 quid delivered. One arduino can control "N" servo controllers via I2C. Works ok. If you are into DCC then the arduino can be used as a decoder. Examples: https://www.aliexpre...iceBeautifyAB=0 https://www.aliexpre...iceBeautifyAB=0 CFJ Link to post Share on other sites More sharing options...
Robin2 Posted May 1, 2018 Share Posted May 1, 2018 only thin stopping me is I need some help with the python What help? ...R Link to post Share on other sites More sharing options...
Grinkle Posted May 1, 2018 Author Share Posted May 1, 2018 great and thanks that servo control board is the same thing at a fraction of the price only difference being it confects to a RPi with a few wires as for the arduino pro-mini I dont think I can give a good comment as I have never used one Does the arduino have WiFi? I think some people might be ok putting files on an SD card where as they might be put off by having to send the code to the hardware perhaps its easy I have never done it the problem still remains it needs a bit of code the code is probably already on the internet If any one can find it or write it please let us all know Link to post Share on other sites More sharing options...
Robin2 Posted May 1, 2018 Share Posted May 1, 2018 If any one can find it or write it please let us all know Are you going to tell us what it is that we should be trying to find? ...R Link to post Share on other sites More sharing options...
Stanley Melrose Posted May 1, 2018 Share Posted May 1, 2018 I may be wrong but I somehow feel there's something interesting in this thread but I cannot for the life of me figure out what it is. Until the next episode . . . Cheers, Stan Are you going to tell us what it is that we should be trying to find? ...R Link to post Share on other sites More sharing options...
RMweb Premium njee20 Posted May 1, 2018 RMweb Premium Share Posted May 1, 2018 Mmm, yes. I’m sort of interested, I think. Maybe. Link to post Share on other sites More sharing options...
Grinkle Posted May 1, 2018 Author Share Posted May 1, 2018 hi Stan keep watching this space I think what I need is a clever kid or his teacher to put me on the right track I have just ordered (from China) 3 more servo controllers @ £1.53 each the intention is to connect them to relay boards for frog polarity switching Link to post Share on other sites More sharing options...
Grinkle Posted May 1, 2018 Author Share Posted May 1, 2018 I am capable of in computer languages Unfortunately Python (the language of the servo boards) is not one of them I understand what these tings are capable of and what I would like to do What I need is an interpretor someone who understands both of us Link to post Share on other sites More sharing options...
Robin2 Posted May 1, 2018 Share Posted May 1, 2018 I am capable of in computer languages Unfortunately Python (the language of the servo boards) is not one of them There are hundreds or thousands of online tutorials about Python. If you know one language it should easy to use another. And what are the servo boards that need to be programmed in Python? If you are referring to a Raspberry Pi then you can program them in most languages - what languages are you familiar with? ...R Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted May 1, 2018 RMweb Premium Share Posted May 1, 2018 Mr Grinkle IMHO Arduinos are a better bet. There seems to be more project libraries out there. The whole thing is open source so clones abound at next to nothing each. If you are good at computer languages how are you at C++? Keith Link to post Share on other sites More sharing options...
NinOz Posted May 2, 2018 Share Posted May 2, 2018 great and thanks that servo control board is the same thing at a fraction of the price only difference being it confects to a RPi with a few wires as for the arduino pro-mini I dont think I can give a good comment as I have never used one Does the arduino have WiFi? I think some people might be ok putting files on an SD card where as they might be put off by having to send the code to the hardware perhaps its easy I have never done it the problem still remains it needs a bit of code the code is probably already on the internet If any one can find it or write it please let us all know The code to control the board from any arduino is fairly simple, IDE and library is available as well as examples (sort of C++). Mine is a little more complicated as it is DCC controlled and chats on Loconet. At runtime stores individual servo addresses, closed and thrown settings, last known location, etc. Programming the arduino is simple, single cable from usb port to arduino (can buy arduino with suitable cable). The only difficulty is remembering to ensure the correct USB port is selected in the IDE config. Link to post Share on other sites More sharing options...
DCB Posted May 2, 2018 Share Posted May 2, 2018 I would love to understand what the aim of all this is. Has anyone used servos successfully as point motors on say Peco 00 code 100 electrofrog? Because I would expect the over centre spring to cause them grief and without the spring points opening under trains would be an issue. More basic how do you select a route, do you have to select every point direction individually? Or how do you avoid powering up a stalled servo when the point is already thrown? Not an issue with solenoids but probably needs a polyswitch or pair of limit stop micro switches per servo. Can you make it as user friendly as a Capacitor discharge /diode matrix /solenoid set up (see pic) where just two prods sets up most routes? How exactly does one interface with the electronics to operate the points? Link to post Share on other sites More sharing options...
RMweb Premium Ian Morgan Posted May 2, 2018 RMweb Premium Share Posted May 2, 2018 DavidCBroad, to answer some of your questions: Many people are now using servos to operate points, partly for the cost saving (using Merg components, points can be motorised for less than £5 per point), and partly for the ability to operate points slowly, smoothly and quietly. This is especially true for handbuilt track which does not appreciate the aggressive clunk-clunk operation of traditional solenoid point motors. Servos are easily powerful enough to overcome an over-centre spring, but it is better to remove over-centre springs to allow for smooth, slow point operation. The servo gearing will keep the point blades hard against the stock rails, even if power is disconnected. Merg supply various kits for controlling servos. Some can be operated by simple SPST switches to connect an input to 0V, or an 'open collector' output of another electronic module. Merg also supply a module that connects to their CBus layout control bus that uses bus events to control up to 8 servos. Merg CBus is known to JMRI, so points can easily be controlled by JMRI, and then WiThrottle or Engine Driver on mobile devices. Servo control modules need to be configured to initially set the limits of throw and the speed of movement. Once configured, they will operate as required quite happily. There is no 'stall', or problem with points being set incorrectly. The servo will move to the position required by its input switch or event. Frog polarity can be switched by a microswitch activated by the servo arm, or using a relay activated by a module that detects the mid point of the servo movement. Merg modules can be set to stop sending control pulses to a servo one second after moving it. This can reduce servo 'chatter' if configuration of the end stops is not accurate. As I said earlier, the servo gearing will resist movement of the point blades even when the servo control pulses have stopped. Route selection is simple, using either a diode matrix from single push buttons, or setting up a single CBus event to operate any number of points (as I do on my layout). Using JMRI, authentic NX (Entry/Exit) route selection is possible. Link to post Share on other sites More sharing options...
RMweb Premium njee20 Posted May 2, 2018 RMweb Premium Share Posted May 2, 2018 There are other commercial solutions too - Peco do Smart Switch, which gets bad press and is vastly overpriced IMO. There's also Dave Fenton's Megapoints, which I personally use and rate highly. There are various 'add ons' for setting entire routes in one go, adding DCC compatibility etc. I'd not go back to solenoids any time soon. Link to post Share on other sites More sharing options...
NinOz Posted May 2, 2018 Share Posted May 2, 2018 I would love to understand what the aim of all this is. Has anyone used servos successfully as point motors on say Peco 00 code 100 electrofrog? Because I would expect the over centre spring to cause them grief and without the spring points opening under trains would be an issue. More basic how do you select a route, do you have to select every point direction individually? Or how do you avoid powering up a stalled servo when the point is already thrown? Not an issue with solenoids but probably needs a polyswitch or pair of limit stop micro switches per servo. Can you make it as user friendly as a Capacitor discharge /diode matrix /solenoid set up (see pic) where just two prods sets up most routes? How exactly does one interface with the electronics to operate the points? 1. The aim of OP was to describe a concept of using a Raspberry Pi to interface to a servo controller board to allow control of up to 16 servos acting as point motors. Just one of the many options to switch points. 2. I don't remember which specific points have been used with servos but given the number in use I assume the quoted point has likely been used. I doubt the type of point will make much difference. 3. Most people just rip the centreing spring out and rely on the servo gear train holding the point blades in place, takes a bit of force to move even an inactive servo output. Works OK. One can leave the spring in and just use a servo which has sufficient force to overcome resistance (my preferred option in N). 4. Routes would be taken care of in the micro processor via programming. Can be quite sophisticated. 5. Stalled servos are not a problem. Movement limits can be set and stored for each servo, actuating rod is usually spring steel so has a bit of give, servos are generally put to sleep at the end of movement. 6. Routes can be set up as you describe, the prods (or buttons) just tell micro which route is required, micro then tells servo controller which servos to move, the direction to move each servo and the sequence and timing of servo moves. 7. Interfacing is dependent on the installation and use. The simplest is just a small circuit to drive the servo (a dpdt relay, a 555 timer, two trim pots, few resistors and capacitors). Cheaper is to use a cheap small micro to drive a servo directly. Both of these could act and be setup rather like the solenoid setup as described. Can get fancy and go for a micro driving a couple of servos or, as in this thread, driving a servo controller board. My DIY has a micro(s) in the control panel which detects which route, lights or points are to be set, broadcasts such requests on Loconet, micros scattered about the layout monitor Loconet and react to their specific switch requests and switch their points or any other action required. Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now