Jump to content
 

Experiences with CMME Arduino DCC 16 Servo Decoder for driving Semaphores...


Recommended Posts

I have come across the Chesterfield Model Making & Minature Electronics ("CMME") Arduino-based DCC 16 Servo Decoder:

 

https://chesterfield-models.co.uk/product/arduino-dcc-sniffer-relay-servo-decoder-all-in-one-copy/

 

This seems like a very cost-effective servo controller (£22 at the moment) and claims to implement a semaphore bounce effect.

So it seems as if it could be a useful controller for servo-driven semaphore signals. It is significantly cheaper per servo than commonly available alternatives such as Megapoints, Digikeijs, GF Controls, etc.

 

The underlying hardware seems fairly standard (Arduino + 16-way servo controller board are both generally available), but I'm not so sure about the software and configuration process.

 

Does anyone have experience of using this servo decoder?

 

Yours,  Mike.

Edited by KingEdwardII
Changed title to cover my own experiences with this equipment, since no-one else seems to have experience to share...
Link to post
Share on other sites

Hi Mike,

 

I have just come across this post.

 

I along with Rickard manage CMMME. 

Re the configuration, this is done via the Arduino web editor and uploaded to the Arduino from your computer.

Below shows the servo array and the configuration options:

 

image.png.d030ac327b198ce9b05512fea34cd4de.png

 

I'm happy to answer any questions you may have.

Link to post
Share on other sites

Thanks Sam - I shall talk with you via email.

 

I was hoping that other folk might have actually got some experiences to relate of implementing one of these DCC servo controllers on their layout, which was the reason for me posting here.

 

I like the technology approach you are using, but that isn't the same thing as the implementation on a real layout. I am hoping to gain some insights.

 

Yours, Mike.

  • Like 1
Link to post
Share on other sites

  • KingEdwardII changed the title to Experiences with CMME Arduino DCC 16 Servo Decoder for driving Semaphores...

Originally I hoped this thread would gather some experiences from folk who had used the CMME Servo Controller to drive their semaphore signals. Since no experiences were forthcoming, I decided to change tack and describe my experiences with the CMME Servo Controller - since I took the plunge and purchased one.

 

I bought the controller online. It is contained in a neat 3D printed box:

Servo_Controller_Exterior_1.jpg.df5db44ca65477791a4ddac29cc2c78a.jpg

 

The scale shown on the cutting board is in inches. The box has retaining holes for screws so that it can be installed in the most convenient location, including under the baseboard. The interior is clean and neat:

Servo_Controller_Interior_view_4.jpg.ccfa7f168f18e121e52c7a6401f925ab.jpg

There are 3 external connections:

  • 5V DC, for both driving the servo controller itself and for powering the servos
  • DCC - for DCC accessory commands
  • USB connection to connect to a computer when configuring the servo controller

Finally, there are the 16 3-pin connectors for the servos.

 

The small circuit board in the top right is an Arduino Nano, while the circuit board bearing the servo connectors is an Adafruit 16 channel servo shield.

  • Like 1
Link to post
Share on other sites

The next step is to attach the necessary connections:

  • DCC bus, in my case a link from the DCC accessory bus
    This is only used for signalling, not for power.
     
  • 5V DC power supply
    This powers the servo controller itself and also the servos.
    I have used an adapted USB power supply, since I had some going spare. 
    The power output is up to 2.0A, which should be more than enough. If not, I have an alternative available with 3.0A output.
     
  • USB connection
    This connects to either my Pi400 or my MacBook Pro - the connector on the servo controller is a USB mini, so I used a USB-A to USB-mini cable that I had in my bits box.

Then I was ready to attach the first servo. For simplicity I attached this to the servo 1 connector. Connection is using the 3 wire cable square pin adapter which is pretty well universal for mini and micro servos. The servos have a standard cable that is about 250mm long - for placements around the layout, it is necessary to use extension cables, which are available to order in a range of sizes from 300mm to well over 1000mm.

 

All the connectors are shown in the picture here:

 

Servo_Controller_servo_1_attached.jpg.755410e3da0849183bc8835f56a7f1dc.jpg

 

I am using the HXT900 servos from HobbyKing - a bit cheaper than the commonly used Tower SG90, but having a good reputation for reliability:

 

HXT900_single_arm_side_view.jpg.b0f53381cbec94c6e334e31cf62ed095.jpg

 

The squares on the cutting board are 1/2inch, so you can appreciate that these servos are quite small.

 

The servo comes with multiple arms - I chose to use the simple single arm, which I think is most suited for operating the wires for semaphones. This is attached with a simple screw and the angle of attachment is easily adjusted to suit.

Edited by KingEdwardII
Correct spelling
  • Like 1
Link to post
Share on other sites

Now we're ready to operate the servo.

 

First power up the Servo Controller by applying the 5V and then enable control via DCC by connecting the DCC to the output of the DCC controller (Digikeijs DR5000 in my case):

 

Servo_Controller_power_applied.jpg.fe8b27f2165f787baec2f2dee312afc0.jpg

 

A green LED lights up on the Arduino Nano board and a red LED lights up on the servo shield board.

 

I used the Turnout Control panel on JMRI on my Pi400 to issue DCC commands to the Servo controller. The default DCC address for Servo 1 is simply 1 (Servo 2 has address 2 and so on). The defaults can be changed - I'll describe how to do this later.

 

Enter address 1 into the Turnout Control panel and then select the Closed button. This causes the servo to turn through 180 degrees anticlockwise. Then clicking the Thrown button causes the servo to turn back through 180 degrees clockwise. The extent of the motion is again the default and this can be changed through configuration - I'll describe how to do this later.

 

Servo_at_0_Degrees.png.49e74e3185cb612a4ca624664da863f5.png

 

Servo_at_90_Degrees.png.a10cae1dd254df59b830aa070fe5c122.png      Servo_at_180_Degrees.png.0c27d9c5e991a8fb429c1e2551769b5e.png

  • Like 1
Link to post
Share on other sites

OK, so far I have got the Servo controller connected and working and I am able to drive a servo using DCC accessory (turnout) commands.

 

The next steps are to configure the Servo controller for two aspects:

  • The DCC address for the servos
  • The sweep angle of the servos

Setting the DCC address enables us to assign addresses for the servos that fit into the overall DCC address scheme and also enables each Servo controller unit to have its own unique addresses.

 

Setting the sweep angle for each servo enables us to adjust the throw to suit the semaphore signals. The default 180 degree sweep is going to be much too large as you can appreciate from the distances involved in the pictures at the end of the last posting. The distance required is going to be of the order of 3 to 5 mm.

 

Configuring the CMME DCC Servo controller is somewhat different to other DCC units I have used. Configuration is not done by setting DCC CV values as might be the case for other DCC controllers.

 

The CMME Servo controller is driven by software running on the Arduino Nano board that is part of the controller - by a small program called a Sketch in the terminology used in the Arduino world. To configure the Servo controller, parameters in the sketch are modified as required and an updated sketch is loaded into the Arduino Nano. This is the purpose of the USB connection to the Servo controller, which needs to be connected to a computer of yours that is configured to run software that can be used to:

  • Edit the sketch
  • Validate the updated sketch
  • Load the updated sketch to the Servo controller

There are multiple software packages available that can do this - I am going to describe using one of thee packages - the package recommended by CMME themselves. However, if you are an expert in Arduino programming and prefer a different software package, there is nothing stopping you using your favourite tool.

 

The chosen software package is called Arduino Create. This is a web based ("cloud") system, where most of the work is done using a web browser and the tools and files are held by a central web server - and thus work the same whatever computer you are using (i.e. its the same whether you're using Windows, a Mac or a Linux machine like a Pi). However, there is one component that must be installed and run on your computer locally. This is called the Arduino Create Agent. Its job is to link the Arduino Create system running on the Web to the USB connection from your computer to the Servo controller.

 

The first thing to do is to install the Arduino Create Agent by pointing your browser at this web page:

 

https://create.arduino.cc/getting-started/plugin/welcome

 

Follow the steps there and you will download, install and run the Arduino Create Agent on your computer. The details vary depending on the kind of machine you're using.

 

Once you have done this, then you access the Arduino Create tools via your web browser on this page:

 

https://store.arduino.cc/digital/create

 

You need sign up to Arduino Create - it has a freemium model, meaning that it has a free tier that provides basic functionality, but you pay a subscription for advanced features. The free tier is fine for reconfiguring the sketch for the CMME Servo controller.

 

Once you've got an account and signed in, then the tool you're going to use to edit the sketch is the Arduino Editor:

 

Arduino_Create_Editor_1.jpeg.e14f06f0890df80085e921c274d2c50a.jpeg

 

The Arduino Sketch for the Servo controller is available for you to download onto your machine from the CMME website here:

 

https://chesterfield-models.co.uk/arduino-guide-sketches/

 

Look for the "DCC Servo Sketch" section on that page. It displays the sketch and also provides a Download button - click on the download button and a file 16_Servo_Complete.zip is downloaded to your machine. Within that zip file is a file called 16_Servo_Complete.ino - this is the sketch itself. From there you can import the sketch into the Arduino Editor using the button with the upwards arrow. You then open the sketch in the editor:

 

Arduino_Create_Editor_with_Sketch.jpeg.87ffc2c44a09c7bef82229badcb7395e.jpeg

 

One final thing remains before you start editing. You need to connect the editor to your Servo controller. This is done using the box in the top middle of the editor window - it has the words "Arduino Nano" in it in the image above. Clicking on that enables you to select the connection to your Servo controller via the USB connection on your machine. The exact address will depend on the configuration of your machine - but the Arduino Create Agent should already have worked out where the USB link is and will relay it to the Editor, so that all you have to do is to select it. When you're done the editor will look like this:

 

Arduino_Create_Editor_Connected.jpeg.40e737686b1f0072fbf6131083f16574.jpeg

 

The editor is now communicating with the Arduino Create Agent and the editor will be able to upload modified versions of the sketch to the Servo controller.

 

This post is already a long one, so I think I'll stop at this point before describing the changes to the sketch that are used to configure the Servo controller.

Link to post
Share on other sites

OK, we are ready to edit the CMME Sketch using Arduino Create.

 

Start with the original CMME Sketch:

CMME_Original_Sketch.jpg.43b5118f0b862f6e258eac4c53488dd1.jpg

The first thing to do is to create a base address for the servo controller. I create a new constant called BASEDCCADDR and set its value - in my case to 200, which suits my layout:

CMME_Sketch_with_Base_Address.jpg.9336ec92965290dc59dad5646e5bc19f.jpg

 

The new constant is then used to define all 16 addresses for the servos a bit further down the sketch (note the line numbers, which are displayed in the Arduino Create editor):

 

CMME_Sketch_using_Base_Address.jpg.6de242a4f891d7466081dfacfd4b1556.jpg

 

Doing this change means I can update the base address in one place and all 16 servo addresses change - so, for example if I buy a second Servo controller, it can have its own set of addresses.

 

The next thing is to adjust the sweep angle, which goes from the value represented by the second parameter ("SERVOMIN" here) to the value represented by the third parameter (which starts out as SERVOMAX-250). This is done by adjusting the value of the 3rd parameter for the servo concerned - line 97 above for the servo with address BASEDCCADDR. You may need to play around with this value to get it right for your installation - I suggest gradually reducing the value in stages until you get the sweep that you want:

CMME_Sketch_with_Updated_Sweep_Angle.jpg.bcb833c8c506107ad3b6e84c5e5643bb.jpg

In my case, I've changed the upper sweep angle to SERVOMAX-350.

 

Once the edits are complete, use the buttons at the top of the editor:

Arduino_Create_Editor_update_button.jpeg.05c9804e13c7788a2ef2f8457effa15a.jpeg

 

First use the button with the Tick - this verifies and saves the updated Sketch. If all is OK, then use the button with the Right Arrow to upload the Sketch to the Servo controller.

 

The editor will indicate that it is "Busy" while it is doing this and you will notice LEDs flashing on the Arduino board of the Servo controller as the upload takes place. Messages also get displayed at the bottom of the editor window, like these:

CMME_Sketch_update_messages.jpg.8a04f64e4e43f4de16ce0b695dba7220.jpg

 

Notice the final "done. Thank you" message that indicates that everything is complete and the updated version of the Sketch is now running.

 

You can now issue DCC commands to activate the servo - here, with JMRI, for example:

 

JMRI_Turnout_Control_for_Address_200.jpg.df373631915e7e290aef67f62afec5df.jpg

 

The DCC accessory address here is "200", matching the first entry in the updated sketch shown above.

"Thrown" and "Closed" buttons cause the servo to move to one end or the other of its sweep range.

 

For me, "Thrown" is here:

Servo_200_in_Thrown_state.jpg.49afce9dac2413fd4538bfc924f30baa.jpg

 

and "Closed" is here:

Servo_200_in_Closed_state.jpg.75d778ec851bf816c3d51d71a5dfe963.jpg

 

So, now we have the servo set up and ready to operate a semaphore signal.

 

 

 

Edited by KingEdwardII
Corrected spelling, added a bit more explanation.
  • Like 2
Link to post
Share on other sites

  • 2 months later...

Basically, I've been held up making the signals themselves, which is a story all of its own.

 

I had originally expected to motorise a Ratio 468 GWR Round Post bracket signal kit - but when I built that kit, I found that the supplied plastic cranks were not man enough to deal with the force from the servo.

 

I switched to building a Ratio 469 GWR Square Post bracket signal kit - similar but crucially this has metal cranks. I found a different flaw with that kit in that the signal arm mounting arrangements in plastic broke all too easily.

 

Perhaps my ham-fisted model making skills were not good enough, but my latest attempt is building an MSE (Wizard models) all-metal round post GWR home signal - simpler and in principle more straightforward to complete. However, I am finding this hard going too, with the balance weight arm for the base of the signal being too flimsy.

 

I'll get there in the end, but it has taken me far longer than I ever expected.

 

Once I get the metal MSE model done, I aim to go back to the Ratio kits and replace specific plastic elements with metal ones from the MSE etches - in particular the cranks and the signal arms. The rest of those kits are quite good so it has been frustrating that key elements are not up to the job. However, this is my first attempt building these signals, so it is all a learning curve!

 

Yours, Mike.

  • Agree 1
Link to post
Share on other sites

Generally speaking you need to solder 2 etches together for the weight bar plus two (you might prefer just one each side) of the weight etch discs each side, so each weight bar is made up of 6 (or 4) parts. I don't know what wire you are using but 0.33mm Albion Alloys Nickel Silver is what I use in 4mm, don't use brass wire it is too soft.

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...