AndyID Posted August 21, 2020 Author Share Posted August 21, 2020 2 hours ago, Trofimow said: Well, the parts arrived, so I've done a test using AndyID's drawing in the first post. I use the servos in question to mount CCTV cameras for fiddle yard monitoring, controlled via arduinos. ANY unwanted servo movement is immediately noticeable on the picture. Preliminary results are that servo twitch is not completely eliminated, but is greatly reduced, probably by better than 80%, certainly enough of an improvement to be worth fitting to all the cameras. I'm wondering if it would be worthwhile doing the same between the control output and the long wires, so having the opto isolation at both ends. I'll give this a try when time permits. Hi, Is it twitching due to some source of electrical interference? It could be that what you are seeing is a small amount of "jitter". The way the servos work there is always a small amount of internal quantization noise that tends to make the servos hunt by a very small amount every so often. if it's jitter you can stop it by disabling the pulse input to the servo except when you want to alter its position. You can disable the input by holding it high or low. High has more noise immunity but low should be ok with optoisolators. Andy. Link to post Share on other sites More sharing options...
AndyID Posted September 1, 2020 Author Share Posted September 1, 2020 On 09/08/2020 at 13:39, AndyID said: Of course there's also a way to eliminate the long wires between the controller an the servo. If you don't mind adjusting the point throw by mechanical means you can use a simple pulse generator to drive as many servos as you like. The pulse generator continuously outputs pulses of two widths and you simply select which one to drive the servo for the two servo positions. I've programmed an ATtiny44A as my pulse generator. (Code available on request.) Here I'm using one pole (RLa) of a two pole changeover relay to select the servo pulse width. The other pole (RLb) provides a convenient means to control the point's frog polarity. Obviously the point control switch can be as far away from the point as you like. ATtiny44A's are very inexpensive (about $1 here) so they can be distributed liberally around the layout to keep the servo leads short. The relays are not expensive either (less than $1) RelayVersion1.pdf 38.98 kB · 8 downloads More mucking around. Attached is the pulse generator assembler code for an ATtiny44A. It should open with Wordpad. This version swings the servo 90 degrees but the pulse rate is slowed considerably, (You can adjust it by changing the value that's loaded into ICR1H). That slows the motion quite a bit and also stops the servo chattering if it can't quite get to where it wants to go. You can soften the pulses further by inserting a diode in the servo's ground connection. If you short pin 13 of the ATtiny44A to ground the servo will move half-way between the two extremes. That's for setting up the mechanism that connects the servo to the points' tiebar. Servo30Aug.ino Link to post Share on other sites More sharing options...
RMweb Gold Trofimow Posted September 1, 2020 RMweb Gold Share Posted September 1, 2020 On 21/08/2020 at 20:23, AndyID said: Is it twitching due to some source of electrical interference? It could be that what you are seeing is a small amount of "jitter". The way the servos work there is always a small amount of internal quantization noise that tends to make the servos hunt by a very small amount every so often. if it's jitter you can stop it by disabling the pulse input to the servo except when you want to alter its position. You can disable the input by holding it high or low. High has more noise immunity but low should be ok with optoisolators. There's both, but noise is by far the biggest contribution. However, your comment about disabling the pulse input provoked a re-appraisal. Most of the time the cameras are in one position covering the point ladders at the entrance and exit of each set of storage loops. They can be panned to look the other way, but this is (hopefully) a rare requirement, only necessary in the event of a stuck or derailed train out of shot. Since they are static most of the time, I'm wasting my effort looking for a technical solution when the simplest option will do what is required. Consequently the servo power is now disconnected by default and each monitoring panel has been given a "pan enable" push button which tempoarily restores the power when needed. Now there's no twitching at all! 1 1 Link to post Share on other sites More sharing options...
Junctionmad Posted September 2, 2020 Share Posted September 2, 2020 (edited) I’ve completely switched to the “ opto at servo “ approach and this has eliminated any noise based twitching ,I see no utility in an opto at the pulse sender. the technical advantage is improved Common mode rejection , and primarily a dramatic decrease in the input resistance of the servo control input. This is the primary cause of interference pickup as the long control wire coupled with >10Mohm CMOS input of the servo control acts like an antenna remaining sources of twitching are largely from two areas , startup conditions and or internal servo issues. startup twitches can be eliminated by pull up or down resistors , and or controlled power up sequences , in my case these have been eliminated by software this leaves internal servo issues , I have seen servos make what’s seems like calibration movements ( digital servos ) from time to time. This is usually a movement to a fixed point and then back to the new commanded position. this was particular to a brand of micro digital servos and was not present in other brands removing the pulse sequence, after movement has completed, has some utility , but only works for analog servos. Digital servos will continue to “ hunt” for the last commanded position even if the pulse is removed of course all this assumes the basic generation of the pulse timing is consistent , I have seen ( and measured ) some inconsistent timing pulses where for example the pulse timing was interrupt based and the priority of the interrupt was too low or where timing was “‘polled “ based and the loop timing consistency was contaminated by other frequent interrupts these issues are software ones and need fixing anyway good servos will have a defined “ dead band “ so once the signal jitter is well within the minimum dead band , the servo “ should” stay motionless dave Edited September 2, 2020 by Junctionmad Link to post Share on other sites More sharing options...
Crosland Posted September 2, 2020 Share Posted September 2, 2020 6 hours ago, Junctionmad said: removing the pulse sequence, after movement has completed, has some utility , but only works for analog servos. Digital servos will continue to “ hunt” for the last commanded position even if the pulse is removed Another problem is the linkage to the point/signal, etc., and the servo position setting. I always use something like an omega loop to ensure that the servo can get all the way to the commanded position without continuously driving against the mechanism. 1 Link to post Share on other sites More sharing options...
Junctionmad Posted September 2, 2020 Share Posted September 2, 2020 5 hours ago, Crosland said: Another problem is the linkage to the point/signal, etc., and the servo position setting. I always use something like an omega loop to ensure that the servo can get all the way to the commanded position without continuously driving against the mechanism. For points I find I have room for Z loops ( I have a Z forming pliers ) for signals even in O gauge I find it difficult to find linkage space for Z loops so I arrange the link to pop out of the servo arm of over driven Link to post Share on other sites More sharing options...
AndyID Posted September 2, 2020 Author Share Posted September 2, 2020 38 minutes ago, Junctionmad said: For points I find I have room for Z loops ( I have a Z forming pliers ) for signals even in O gauge I find it difficult to find linkage space for Z loops so I arrange the link to pop out of the servo arm of over driven Another way to do it is to mount the servo under the baseboard but allow the servo body to rotate and limit the rotation with a compliant "torque arm" which might just be a thin strip of wood. Link to post Share on other sites More sharing options...
Trainshed Posted February 20, 2021 Share Posted February 20, 2021 (edited) Hi all, My problem was the servos twitching when the 5V power was switched on. My latest creation seems to have eliminated this... When the power is applied, only 3V passes to the servos. The relays then energise and switch out the diodes one at a time until the full 5V is applied to the servos. It seems to have worked, as normally all the servos on my layout (approx 60) twitch a few degrees when the power is turned on. With the circuit attached, I can't hear any servos twitching. Edited February 20, 2021 by Trainshed Wrong image attached Link to post Share on other sites More sharing options...
dasatcopthorne Posted February 20, 2021 Share Posted February 20, 2021 I will just add that I am working my points using servos on a DCC layout. I buit the MegaPoints control board kit available from MERG. I have had no trouble at all from twitching but I did use the recommended Analog Servos from HobbyKing. The HK15178 servo. Dave. Link to post Share on other sites More sharing options...
aleopardstail Posted April 2, 2021 Share Posted April 2, 2021 put the controller nearer the servo, then talk to the controller over something like RS-485 or something else that can handle the noise that and try to limit the noise in the first place 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