User Tools

Site Tools


mgv145-en

MGV145 Turntable / Fiddle yard controller

ContentHardwareGCA


By Peter Giling

Description

Using a stepper motor seems to be the most simple way of moving a turntable or fiddle yard to the desired position.
And because mostly all of us will have one or more stepmotors available from any old printer/scanner/ disk-drive, we have to deal with a wide variety.
And if there are no motors available, stilla wide variety of these motors are available from Conrad, Reichelt Rapid, etc.
The needed power for a turntable can be rather low, but a fiddle yard needs a more powerful engine to be able to move it.
This unit provides enough energy for most common kind of motors.
The best suitable motor is the one with four wires (two coils).
The output voltage is adjustable over a wide range, to adapt to the chosen motor.
The position setting can be done by an incrimental switch , as known from many train speed controllers,
or by means of the input connector J5.
This connector can be straight connected to a GCA50 (LocoNet)- or CAN-GC2(mergCan) I/O module or from other controls systems.
You are free to create your own solution to fix motor to the TT/fiddle-yard.
The bottom of these pages show a few examples, about how satisfied users have been constructing their solutions.
48 positions are available and each position is set by a number of steps counted from zero position.
Each step can be programmed, using a simple menu and the addional GCA146 control and display board.
The total control unit is rather complicated, yet, through the use of a good worked out pcboard, it is rather simple to construct.
Boards and /or complete parts sets are available.. Ask Peter.
The rails on the TT will be polarised according to the position. This position is also programmable.
The maximum amount of positions and all other settings are accessable by means of MGV146.
In this case, also in manual control, you do not have to worry about polarisation, it is always correct.
For fiddle yard, no change in polarity is necessary, but it is nice that power of rails will be switched off during movement.
If you have any ready made turntable like Fleischmann, Maerklin, Roco or anything else, this unit is also useable but:
like in selfmade turntables, you wil have to make a connection between stepper motor and turning part of your item.
Further in these pages you will find some examples how a mechanical solution can be made.
You made your own nice design? we are happy to publish it here for the benefit of other TT lovers.
Also an extra setting is available to enable a correct position when there is still some free-space movement in the driving set.
The software runs a previous amount of steps further (only from lower to higher position), and then runs this amount of steps backwards.
These steps can be set fom 0 to max 99.
Starting at version 3.7 the program also is able to 'ramp-up'and 'ramp-down'.
This will give a rather real movement.
Both speeds, maximum and minimum, have their own set-point, as well as the incremental speed.

The final result

mgv145_pict03.jpg

Power

Any transformer from 16-24V(ac or dc) is suitable.
The demand of the maximum current is mostly depending of the type of Steppermotor which is used.
But the power supply on MGV145 can go up to a maximum of 3 Amp.
Entering the power Through J1(1+2), a multifuse will limit short circuit problems, if any.
A 6A rectifier bridge is capable of handling up to the maximum current given by VR1.
VR1 is a switching mode power supply, which means that there is much less energy generated in VR1, compared to normal linear regulators.
Many types of steppermotors will require a variety of different voltage to supply to the motor.
VR1 is adjustable by means of P1, in a range from 5.2 to 18Volt. This will cover mostly all of the available motors.
This way of using the controller is known as the simple solution, accurate enough for most situations.
Any additional improvement can be done by using the right values for R3 and R4 , to select the suitable current for the used stepmotor.
In that case voltage can be set to maximum.
Basic formula is that current through motor x R3( or R4 ) should be 1.
See datasheet of L297 and L298 for more details.
VR2 is regulating 5V for the logic on board ,and the relays K1 and K2.
The two regulators and U3 (the power output), are mounted to a cooling device.
The picture shows a cooling , suitable for allmost all situations.
However, if it comes to a situation where a stronger motor is used in a more constant movement, the cooling can be replaced by a larger type. (see parts list)
On board is also a jumper EEP1 for selection of start-up settings.
This should always be in OFF position, unless you want to clear all settings.

Adjusting the output voltage

Please refer to this manual

Interface to GCA50 and CAN-GC2

Connectors J5 and J6 have the equal reference as on the GCA50 , where they should be connected.

List of ports to GCA50 / CAN-GC2
Function Port# GCA50 Conn CAN-GC2 Conn
+5V - J5(1) J3(1)
0V - J5(2) J3(2)
Pos req b0 1 J5(3) J3(3)
Pos req b1 2 J5(4) J3(4)
Pos req b2 3 J5(5) J3(5)
Pos req b3 4 J5(6) J3(6)
Pos req b4 5 J5(7) J3(7)
Pos req b5 6 J5(8) J3(8)
Write 7 J5(9) J3(9)
Pos match 8 J5(10) J3(10)
+5V - J6(1) J4(1)
0V - J6(2) J4(2)
Feed-back 1 9 J6(3) J4(3)
Feed-back 2 10 J6(4) J4(4)
Feed-back 3 11 J6(5) J4(5)
Feed-back 4 12 J6(6) J4(6)
Sign fwd 13 J6(7) J4(7)
Sign rev 14 J6(8) J4(8)
not used 15 J6(9) J4(9)
not used 16 J6(10) J4(10)

Cable to MGV50 / CAN-GC2 / CAN-GC6

The logic control

When write line goes high, the processor will make ´pos match´ high, shut off both relays, reads PortA and starts running to the position given.\
After the postion has been reached, ´Pos match´will be forced low, to signal the LocoNet, that TT/FY is stable in position.
Also depending on the position, the correct relay will be switched on, to give power to the rail on the bridge.
Reverse or not of the railpower is depending on the chosen control type (see settings).
The amount of steps of the required position is read from EEprom, and then calculated in respect to actual position.
For the TT with connected wires counts, that there should be a balance of the amount of turns right and left, to avoid that cable to the bridge will be too far twisted.
Controller will normally calculate and take the shortest way, unless this ´twist´ is telling otherwise.
The control of stepper-motor is done by U2 and U3.
This combination of stepper control chips is making life easier for the microprocessor, which only have to give direction and clock.
All control of the motor, including a maximum load sensor, is made by these control chips.
The diodes at the output of U3 are made to suppress distorsion of the motor. Diodes are special high frequency types, to give best performance.
The eep jumper is used to set if the preset values should be used.
With the jumper in ON position, preset values will be loaded into EEprom, to make it possible to have a 'normal 'start.
Always set jumper to OFF after started the first time.
Otherwise all changed values in settings are cancelled with startup.

Manuals

Different versions have been developed, with different manuals.
The latest version V7.1, which I strongly advice to use.
* Version 4.6
* Version 5.2 to 5.4
* Version 7.1

Manual control, and display

Basicly, a GCA146 manual board is needed to be able to set all parameters.
A separate switch on the manual control board puts the GCA145 in adjust mode.
The best way is installing this switch close to the turntable on a not normal accessible place.
This avoids getting into settings accidently.
When this switch is ON, The display will show the menu number for one second and then show the present position.
Older versions than 5.5 have different menu. Please refer to Version 4.6 or Version 5.4
Pressing the control push button, the menu will shift.
Menu items 0 and 1 write information in the eeprom, dependent on the current position. To prevent overwriting settings with wrong information these menu items are not available when special positions 61, 62 or 63 are set.

Reverse / NOT reverse of railpower

When in menu 3 is chosen for option 1, 3, 5 or 6, the power to the bridge is only switched by use of K1.

In this case there is basicly no need to install K2.

Instead, a connection should be made between K2(6) and K2(4). See picture below.

Starting at version 4.9 the program will be able to set reverse /not reverse railpower on the bridge for every position separately.

The EEP jumper

As per realisation of Version 7.x firmware, eep1 is no longer important, and can be ignored.
For firmware 4.x and 5.x this jumper is still active, and so is the follwoing description.
The first start of GCA145 will show that, because there are no values in the processors memory, nothing will happen.
Starting the GCA145 with the EEP jumper set to ON, will set preset values in memory.
It is of course not possible to give a useful general value for all situations.
Another option is to edit your own values , using the programmer, and send that into processor.
The values (words), as stored in EEprom have to be calculated into two bytes: HighByte and LowByte.
The Lowbytes are stored in Eeprom starting at adres 0x01 for position 1 and so on.
The highbytes are stored in Eepromt starting at adres 0x31 for position 1 and so on.

Base position

J4 is the connector for a position switch or hall diode or IR port.

It is needed for adjusting the TT/FY after transport, or in any case when adjusting is needed.

Selected position 63 will make the bridge run to the base position, where it expects a switch.

If the controller is set for 'shortest way option '(menue 3, option 2 .. 5), the motor will continue running in the same direction,

until the turntable has reached the same point again. This is needed for counting the total steps for one complete circle.

If this is done several times after one another, the twist protection will aboard the extra round, and assume that total steps are counted already.

Safety switch

An extra safety switch can be connected to ICSP1 connector.

My setup of the large Fiddle Yard will be exposed to public .

Since the drive unit is rather strong, I had to design a safety switch to protect the hands of too curious children or grownups.

This safety switch will be a wire on top of the frame-side of the fiddle yard.

For connection of this switch refer to 'max limit switch connection' below.

The wire can easily been touched and will then contact a strip right below it(approx 2mm distance), causing the fy to stop immediately when moving.

Addional warning signs will be on the front of the fiddle yard of course.

All this will for sure not be needed when GCA145 is driving a turntable, unless that turntable is 1,5 m in diameter, driven by a 1/4 HP motor.

Full/Half Step (Jumper JP1)

The used integrated circuits have a possiblility to change between full and half steps.

It is not applicable for all type of motors.

Jumper JP1 will set this choice : H= half step and F = full step. )indicated on the pc/board, but very small characters unfortunately.

In most situations the full step will be the best choice.

When there is not much gearing available, making it impossible to reach a decent slow movement, the half step choice will slow down to half speed.

Chip programming

U1 , a PIC16F873A chip needs firmware.
A simple programmer like GCA153 can be used, connnected to ICSP1 connector, to write program into U1.
See for details GCA153.

Unfortunately, the programming connector ICSP1 on the board with code MGV145 has a problem.
Points 1 and 5 (0V and +5V) are reversed.
So either it is necessary to make special cable form GCA153 to ICSP1, where points 1 and 5 are swapped, or a small change should be made on the PCBoard.
If you are going to reprogram the chip for updating to the next version, the erasing off eeprom is not really necessary.
Only when updating versions before 4.8, it will be needed to reprogram eeprom also, because steps are changed (1-48 = 0-47), due to correction possibilities in Rocrail.
Simply tell your programmer to preserve Eeprom, avoiding to do all setting correction again.

First time initialisation

The first time the system is started, there is no knowledge about the amount of steps in total or between various positions.
Follow the next procedure to get this properly set:

1 Start the system and set parameters like max positions, min and max speed, ramp time etc. Do NOT forget control type (menu 3).
2 Shut off programming switch, select position 63 (ver. 4.9+) or 0 (earlier versions) and press the knob.
3 Now the motor will run -clockwise when everything is connected correctly- to zero and make an extra turn, in order to calculate the amount of steps for a full circle.
4 Shut off power and set eeprom jumper to ON (on position are the two pins closed to the two relais).
5 Start up system again. The firmware will now divide the total number of steps for one revolution evenly over the set number of position.
6 Set eeprom jumper to off.
7 Now all positions have a value which is approximately according to their physical situation.
8 System is ready now for further adjustments of each position.

Bridge connection

All hardware for moving TT/FY is build on the stationary part of TT/FY.
For the railsection on the bridge, four feed/back points can be connected, which means that the rails on the moving part will have 4 points for detection.
This makes it very easy to determine the exact position of a locomotive, when driving on the bridge.
Two signs, one at each side can be placed and controlled by LocoNet.
All these connections are combined in one connector J8.
Rocrail will have the possiblity to use these 4 positions.
The rails on the bridge can be connected by flexible wires.
An internal counter keeps track of the amount of turns right and left, when turning through 0-point.
The maximum difference between left and right 0-point passes is 4.
If that difference is reached, the bridge will take 'the long road'.

Safety precautions.

Please refer to Next generation of Fiddle Yard for further info on this item.

Position feed-back

The actual feed-back of positions to Rocrail or any other applicable program, has not been a very important issue.
Due to the fact that another 6 lines should have been available, to connect to LocoNet or else, it was skipped.
But it still is possible.
A small I2C printed circuit between GCA145 and GCA50 would do the trick.
It is not available at present, but if anyone feels the need to have it, please let me know at Peter.

Rail power

Rail power from booster/central unit/trafo is needed to power the rails on the bridge and is connected to J1(3+4).

The hardware

The schematics

The Pcb and parts positions

Bill of materials

Connection Stepmotor to GCA145


Public shopping card at Reichelt
*Special note about PCF8574P:*

Be aware that there are two types of PCF8574 with different slave addresses: PCF8574P (0x40) and PCF8574AP (0x50).

Only PCF8574P is suitable, the AP version will NOT work, because the other slave address!

The firmware

Version 7.1 The latest edition, suitable for all options

Version 4.6 with corrected ´short way´ and 2 extra menus

Version 5.2 with many changes, adapted to users input, written by Ronald B

Version 5.3 with correction for reading bridge power setting at start up

Version 5.4 Special version
In version 5.4 the option to manually operate the stepper motor via menu 9 is skipped.
Menu 9 is now used to determine if the base position detector is to be used (1) or not (0) to go to bridge position 0.
If menu 9 is set to 1 and bridge position 0 is selected one of two things happen:
1) When the bridge travels clockwise (going from higher to lower position numbers, the same direction as when position 63 was selected during initialisation) the stepper motor will continue to run until the base position detector signals, regardless of the number of steps stored in the eeprom memory.
2) When the bridge travels counter clockwise (from low to high position numbers) the stepper motor will continue to run until the bridge has passed the base position detector.
Then the stepper motor will run in the other direction until the base detector signals again.
The number of steps needed in the backwards direction is shown on the display and stored as value for free space steps.
Special position 61 has been added to the other two special positions (62 and 63).
When position 61 is selected, the bridge will run counter clockwise to bridge position 0 as described under 2).

Please note that this requires a perfect alignment between the base position detector and bridge position 0.

Version 5.5 based on 5.4, bridge power and option for base detector now combined in menu 8, menu 9 for delay between turning off position match and start of motor, display now signals that emergency stop switch has been activated

Connections to MGV50 / CAN-GC2

IMPORTANT NOTE !!!!!! Some users seem to know better, and solder wires directly to the pins or the pc-board.!
That is totally unacceptable !!
Wires will easily break off, and cause a lot of damage in many cases.
So use connectors !!!!!
In order to ease making these cables, it is also possible to buy the necessary tool, to create the PSK cables.
This special plier will be sold for net price of € 18,25 if ordered together with complete kits. crimpzange.jpg
Just ask Peter

It is possible to use MGV145 without any further connections.
However, the first idea was to use it inside the GCA-LocoNet system.
Basicly, any function decoder(s) (DCC or Motorola), with 7 outputs available, can be used to control MGV145.
Therefore two connectors are available to interact with a decoder.
Here follows the list of connections, when a GCA50 or CAN-GC2 is used to control.
The cable between the two units is a standard 1 to 1 PSK cable, NO TWISTING !

connector GCA145 connector GCA50 Setting GCA50 Function
J5(2) J5(2) GND GND
J5(3) J5(3) Output switch (no pulse) position command bit 0
J5(4) J5(4) Output switch (no pulse) position command bit 1
J5(5) J5(5) Output switch (no pulse) position command bit 2
J5(6) J5(6) Output switch (no pulse) position command bit 3
J5(7) J5(7) Output switch (no pulse) position command bit 4
J5(8) J5(8) Output switch (no pulse) position command bit 5
J5(9) J5(9) Output switch (no pulse) New position flag
J5(10) J5(10) input Position match


connector GCA145 connector GCA50 Setting GCA50 Function
J6(2) J6(2) GND GND
J6(3) J6(3) Block Feed-back 1st section
J6(4) J6(4) Block Feed-back 2nd section
J6(5) J6(5) Block Feed-back 3rd section
J6(6) J6(6) Block Feed-back 4th section
J6(7) J6(7) Output switch Forward sign
J6(8) J6(8) Output switch Reverse sign
J6(9) J6(9) XXX Not used
J6(10) J6(10) XXX Not used


connector GCA145 connector CAN-GC2 Setting CAN-GC2 Function
J5(2) J4(2) GND GND
J5(3) J4(3) Output switch (no pulse) position command bit 0
J5(4) J4(4) Output switch (no pulse) position command bit 1
J5(5) J4(5) Output switch (no pulse) position command bit 2
J5(6) J4(6) Output switch (no pulse) position command bit 3
J5(7) J4(7) Output switch (no pulse) position command bit 4
J5(8) J4(8) Output switch (no pulse) position command bit 5
J5(9) J4(9) Output switch (no pulse) New position flag
J5(10) J4(10) input Position match


connector GCA145 connector CAN-GC2 Setting CAN-GC2 Function
J6(2) J3(2) GND GND
J6(3) J3(3) Block Feed-back 1st section
J6(4) J3(4) Block Feed-back 2nd section
J6(5) J3(5) Block Feed-back 3rd section
J6(6) J3(6) Block Feed-back 4th section
J6(7) J3(7) Output switch Forward sign
J6(8) J3(8) Output switch Reverse sign
J6(9) J3(9) XXX Not used
J6(10) J3(10) XXX Not used


The position command byte are 6 bits, giving the desired position for the TT/FY to run to.
The write enable is used to tell MGV145 to start.
First the 6 bits are set according position.
To activate the MGV145, write enable should go high.
When no connection is made to J5, a resistor should be soldered (10KOhm) from J5(9) to + 5V.

Connection of base and max switch

For turntables, a base position switch is needed.
For Fiddle yard, also an extra end limit switch (passed the last position) is also adviseable.

base position switch connection (normal -micro-switch)
J4 pt 2 NO
J4 pt 3 C

On position 0 the switch is ON.

base position switch connection with hall sensor
J4(MGV145) Hall sensor
1 (closest to Led) + 5V
2 output
3 0 Volt


Max limit switch connection
ICSP1 pt 3 NO
ICSP1 pt 5 C


Safety switch is connected to the same points.
On position Max, the switch is ON.
Since the development of this board, a few extra connections needed to be made to make all new ideas possible.
Two resistors have to be soldered on the bottom of PCboard, according picture below.
The first resistor (R21 = 10 KOhm > the bottom one) is to avoid that the motor might start moving without any command to do so.
The cause of that is a not connected GCA50 or CAN-GC2, leaving an open input to the PIC.
Also base position correction might not be properly.
The resistor can remain there also when afterwards the GCA50 / CAN-GC2will be connected.
Starting at V4.1 a second resistor (R22 = 22 KOhm > top on picture) is needed because pin RB7 of PIC is used for the end switch.
Also the safety switch mentioned under safety precautions is comnnected to this point.
When this point is switched to ground, the stepmotor will stop immidiately.
In case of a fiddle-yard this will also happen when pin 8 on connector J5 to the MGV50 is high (position command bit 5).
This situation is signalled on the display, this now shows the starting position and the left dot starts blinking.
By pressing (and keeping it pressed) the setbutton the movement will continue and the dot will stop blinking.

Configuration of GCA50 Turntable and Fiddle yard

Example for a LocoIO/GCA50 "15-3" with port adresses "51..66"


Configuration of Rocrail for Turntable

Turntable Dialog

To report the arrival at destination track, a sensor object must added into the track plan.
This sensor need the address from GCA50 port 8. (Address 58 in example above)
In Tab "Interface" the ID of this sensor (example "POS") must be set in "Position Sensor".
Also the "Type" must choose as multiport and if necessary, be set the IID of the LocoNet CS into "Interface ID".
The sensors of the turntable bridge be set in "Sensor 1..3".



The settings in Tab "Multiport" comply with the GCA50 settings for port 1..7 above.

:!: Important Remark:
It's necessary to set the upper Invert option, common for Position Address 0..5.
Otherwise the position command is wrong coded. (GCA145 expect "activ low" signals).
The New Position Flag is default "activ low" and so the Invert option there remains unset.


In Tab "Tracks" the GCA145 stored physical positions of the turntable bridge be mapped to the logical tracks of the turntable object of the track plan.

The turntable object of the example
use 6 of 48 possible positions.

The three tracks 3, 0, 45 have
the tracks 27, 24, 21 in opposite.

In the example the positions of the tracks are configured as No. 1..6 in the GCA145.

The mapping must be set, so Rocrail is able to generate the appropriate command to the GCA145 from the logical track number.

In the example:

Mapping of track numbers
Rocrail 3 4 45 27 24 21
GCA145 1 0 3 4 5 6


In the dialog, the mapping looks like this:


Because the GCA145 use only one "Position Sensor" to report the arrival for all bridge positions - configured at tab "Interface" - the individual sensors of the tracks are unnecessary.

Connections J8

J8 is connector where all brige connections can be made.

Four sections are available with current detection.

J8 Function
1 railsection 1 right rail
2 railsection 2 right rail
3 railsection 3 right rail
4 railsection 4 right rail
5 Left rail of all sections
6 Ground
7 +5Volt
8 not used
9 reverse sign
10 forward sign

Input from satisfied users

If you have designed your own solution for connection stepper motor to bridge, please send pictures.

Here are some pictures of examples :

Test-setup for controller

The example of the picture above is a simple motor equipped with an extra gear wheel and a matching tooth-belt.

These were just taken out of an old scanner from a neighbour, who thought it had no value at all!

The first attempt for installing gear-wheel from this page.

This motor is a stronger type, out of a large tractor feed printer.

This unit is in use as driver for the new fiddle yard in Modelspoorgroepvenlo.

This Fiddle Yard has 12 tracks, with a length of 2300mm each.

There are 4300 steps of the steppermotor needed to get to the next track, which , with a distance of 40mm heart to heart, gives accuracy better than 0.01 mm to get into position!

Realized two-step toothed belts drive

tt_hh_1.jpg
From motor …
tt_hh_2.jpg
… over a toothed belt …
tt_hh_3.jpg
… to transmission …
tt_hh_4.jpg
… over a 2nd toothed belt …
tt_hh_5.jpg
… to the bridge axle
tt_hh_6.jpg
Zero point switch
Click on pictures to get a large view



Video with the setup menue of GCA145/146 and two-step toothed belts drive



LGB turntable

Conversion of a manually operated LGB turntable (from Modellbau-Werkstatt Heyn).
The turntable is internally fitted with a toothed belt between the bridge and the manual handwheel, with a 1:12 gear ratio. The top part (shown on the picture next to the tape measure) of the housing of the handwheel axle has been cut away and a brass gear wheel is fitted to the axle beneath the handwheel. The counterpart worm wheel (giving a ratio of 1:20) is fitted onto an axle, which is held in place by two grooved ball bearings plus holders (capable of taking axial and radial loads). The steppermotor (100 steps/revolution) is connected to the axle via an aluminium flexible coupling. The coupling also adjust for the difference in axle diameters (5 mm for the steppermotor and 4 mm for the worm wheel). For one revolution of the bridge 12 * 20 * 100 = 24000 steps are needed.

In the edge of the turntable a zero position detector is fitted (cover removed for the picture). The detector consists of an infra-red led/photo-transistor combination with a focal point between 3 and 4 mm and a very narrow vertical stripe of aluminium foil (showing as white on the picture) glued to the side of the black bridge cover.

New idea

example_26.jpg
Constructors keep on coming with new ideas
We sure hope more pictures will come from this object


Phytron beauty

Another satisfied user of GCA145 has sent me this solution:
Phytron solution
This stepper motor has a gear box of 206:1 making 41200 steps for one full rotation!
Motor type : Phytron ZSS 52.200.2.5-HD 14/206
Through eBay he managed to buy this top product for a reasonable price.
There is no slack in the movement of this motor, so it is EXTREMELY right for the TT job.!
Full specs of the motor:
ftp://ftp.phytron.de/phytron-usa/stepper_motors/zss-hd-us.pdf

mgv145-en.txt · Last modified: 2023/01/19 21:39 by phg