<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mi Tren &#187; Rocrail</title>
	<atom:link href="http://tren.enmicasa.net/category/rocrail/feed/" rel="self" type="application/rss+xml" />
	<link>http://tren.enmicasa.net</link>
	<description>Blog describiendo las diferentes etapas por las que va pasando mi maqueta Märklin</description>
	<lastBuildDate>Sun, 05 Feb 2012 20:26:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Nueva locomotora HAMO  e interfaz loconet</title>
		<link>http://tren.enmicasa.net/2011/10/29/nueva-locomotora-hamo-e-interfaz-loconet/</link>
		<comments>http://tren.enmicasa.net/2011/10/29/nueva-locomotora-hamo-e-interfaz-loconet/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 10:51:24 +0000</pubDate>
		<dc:creator>Manolo</dc:creator>
				<category><![CDATA[Compras]]></category>
		<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Rocrail]]></category>

		<guid isPermaLink="false">http://tren.enmicasa.net/?p=1427</guid>
		<description><![CDATA[Recientemente he incorporado a  la colección una locomotora HAMO (BR012) y un interfaz para una mobile station. La idea es convertir la  locomotora a sistema marklin, usar el interfaz para comunicar con rocrail por loconet y dejar la mobile station como un control más. Lo segundo aún no tengo muy claro si se puede hacer. El [...]]]></description>
			<content:encoded><![CDATA[<p>Recientemente he incorporado a  la colección una locomotora HAMO (BR012) y un interfaz para una mobile station.</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/DSCN2434.jpg" class="thickbox" rel="grupo1427" ><img class="aligncenter size-full wp-image-1438" title="DSCN2434" src="http://tren.enmicasa.net/wp-content/uploads/DSCN2434.jpg" alt="" width="640" height="159" /></a><a href="http://tren.enmicasa.net/wp-content/uploads/DSCN2437.jpg" class="thickbox" rel="grupo1427" ><img class="aligncenter size-full wp-image-1439" title="DSCN2437" src="http://tren.enmicasa.net/wp-content/uploads/DSCN2437.jpg" alt="" width="336" height="448" /></a></p>
<p>La idea es convertir la  locomotora a sistema marklin, usar el interfaz para comunicar con rocrail por loconet y dejar la mobile station como un control más.<br />
Lo segundo aún no tengo muy claro si se puede hacer. El interfaz estaba pensado para una central intellibox. Así que tengo que investigar un poco más.<br />
Para la conversión a digital en tres carriles la cosas es más sencill.  No tengo ni que instalar  el imán. la conversión es casi directa sólo me surge una duda: ¿para qué sirve el pequeño tornillo de la foto?</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/DSCN2238.jpg" class="thickbox" rel="grupo1427" ><img class="aligncenter size-full wp-image-1436" title="DSCN2238" src="http://tren.enmicasa.net/wp-content/uploads/DSCN2238.jpg" alt="" width="640" height="480" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tren.enmicasa.net/2011/10/29/nueva-locomotora-hamo-e-interfaz-loconet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Función SpeedCurve en Rocrail no aprobada</title>
		<link>http://tren.enmicasa.net/2011/06/07/funcion-speedcurve-en-rocrail-no-aprobada/</link>
		<comments>http://tren.enmicasa.net/2011/06/07/funcion-speedcurve-en-rocrail-no-aprobada/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 21:56:49 +0000</pubDate>
		<dc:creator>Manolo</dc:creator>
				<category><![CDATA[Rocrail]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[speedcurve]]></category>

		<guid isPermaLink="false">http://tren.enmicasa.net/?p=1382</guid>
		<description><![CDATA[Aún no sé porque &#8211; no me han dado ninguna explicación &#8211; pero la contribución del speedcurve no ha sido aceptada por el administrador de Rocrail. A la espera de más información &#8211; al menos me gustaría que me dijeran porqué la rechazan &#8211; he compilado un paquete basado en la rev 2631: rocrail-setup-2.0.0-SpeedCurve-rev2631-win32. Esta [...]]]></description>
			<content:encoded><![CDATA[<p><del>Aún no sé porque &#8211; no me han dado ninguna explicación &#8211; pero</del> la contribución del speedcurve no ha sido aceptada por el administrador de Rocrail.<br />
<del>A la espera de más información &#8211; al menos me gustaría que me dijeran porqué la rechazan &#8211; </del>he compilado un paquete basado en la rev 2631:</p>
<p><a href="http://tren.enmicasa.net/wp-content/uploads/rocrail-setup-2.0.0-SpeedCurve-rev2631-win32.exe">rocrail-setup-2.0.0-SpeedCurve-rev2631-win32</a>.</p>
<p>Esta solución debería solucionar el problema de pérdida de memoria que describía en el anterior post. Los nuevos ficheros fuente (<a href="http://tren.enmicasa.net/wp-content/uploads/speedr1.zip">speedr</a>).</p>
<p>La contribución no se va a incluir en la distribución oficial porque &#8220;sólo es útil para decoders de bajo coste que se pueden substituir por poco dinero&#8221; . Yo seguiré actualizando esta versión para uso propio, así que si alguien la quiere, sólo tiene que pedirla <img src='http://tren.enmicasa.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://tren.enmicasa.net/2011/06/07/funcion-speedcurve-en-rocrail-no-aprobada/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Función Speedcurve en Rocrail</title>
		<link>http://tren.enmicasa.net/2011/06/05/funcion-speedcurve-en-rocrail/</link>
		<comments>http://tren.enmicasa.net/2011/06/05/funcion-speedcurve-en-rocrail/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 20:04:50 +0000</pubDate>
		<dc:creator>Manolo</dc:creator>
				<category><![CDATA[Rocrail]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[speedcurve]]></category>

		<guid isPermaLink="false">http://tren.enmicasa.net/?p=1354</guid>
		<description><![CDATA[Este fin de semana he mandado a la gente de Rocrail una contribución para añadir una funcionalidad a Rocrail. Se trata de la capacidad de tener una curva de velocidad que se gestiona desde el ordenador. La documentación está en Inglés: Finally I have had some time to implement the functionality I was requesting. I [...]]]></description>
			<content:encoded><![CDATA[<div>Este fin de semana he mandado a la gente de <a title="Rocrail" href="http://www.rocrail.net" target="_blank">Rocrail</a> una contribución para añadir una funcionalidad a Rocrail. Se trata de la capacidad de tener una curva de velocidad que se gestiona desde el ordenador.</div>
<div>La documentación está en Inglés:</div>
<blockquote><p>Finally I have had some time to implement the functionality I was requesting. I am attaching an explanation on what the motivation was, and how it can be used.<br />
Since I am not at all an expert on C, neither on the rocrail code, it has taken me longer than expected. Moreover, there is still a problem with the code – a memory leak – I have not been able to solve. I think it is in the way I am attaching the speedcurve parameters to the loc command (loc.c file)… but I am not sure – any help, correction and suggestion for improvement is very welcome.<br />
Basically I have modified the wrapper description file to include a new property to the loc (speedcurve). Then I have modified the loc.c file to explore if a locomotive has this property and include them in the commands sent to the stations. Finally, in DDX, this parameter is treated in MM locomotives.<br />
The reason to address only MM is basically because DCC decoders use to have an actual speedcurve functionality. In any case, since the information is transmitted to any station, anyone could make use of it to implement the speedcurve as I have made for DDX MM.<br />
Hope this new feature to be of interest. It needs still some refinement for the memory leak.. but hopefully someone could give me a hint on how to solve it, so it can be included in a stable release – if it is of interest of course.<br />
I am attaching the three source code files modified, a plan example and the explanation of the functionality.</p></blockquote>
<p><span id="more-1354"></span></p>
<h1>Description and motivation</h1>
<div>A speed curve is a well-known feature of new decoders, and especially it is a feature extensively used in DCC hardware. The solution is normally based on a number of CV that grants the user with the possibility to specify non-linear speed curves, which are closer to reality. The speed can be set per engine step and in addition it is also possible to define the acceleration and deceleration time.</div>
<div>Older decoders, and especially some low-cost solutions designed to work with the motorola format, cannot access such rich feature. In the best scenario it is possible to adjust the acceleration and deceleration time, but never to define different parameters per engine step. This handicap can be easily overcome by software with Rocrail, introducing predefined speed profiles per engine step that can be interpreted by DDX.</div>
<div>The speed curves by software, or speed profiles, are based in the definition of the time each step needs to be hold before going to the next/previous one. It is noteworthy to clarify that the functionality provided by a hardware speed curve is not exactly the same, since a speed profile will not affect the speed magnitude, but the acceleration/deceleration time between steps.</div>
<div>In this way, it is easy to code curves forcing long pauses to accelerate for the lower steps and short pauses for the higher steps, or long pauses to decelerate in higher steps and low pauses in the lower steps.</div>
<table border="0" align="center">
<tbody>
<tr>
<td>
<div style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/S1ACC.png" class="thickbox" rel="grupo1354" ><img class="aligncenter size-medium wp-image-1355" title="S1ACC" src="http://tren.enmicasa.net/wp-content/uploads/S1ACC-300x224.png" alt="" width="300" height="224" /></a></div>
<div style="text-align: center;">ACCELERATION CURVE 1</div>
</td>
<td>
<div style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/S1DECC.png" class="thickbox" rel="grupo1354" ><img class="aligncenter size-medium wp-image-1362" title="S1DECC" src="http://tren.enmicasa.net/wp-content/uploads/S1DECC-300x224.png" alt="" width="300" height="224" /></a></div>
<div style="text-align: center;">DECELERATION CURVE 1</div>
</td>
</tr>
</tbody>
</table>
<div>Furthermore, speed profiles have been proved especially useful in some decoders that, in addition to the lack of a speed curve, have some particular time constraints to achieve an efficient behavior:</div>
<ul>
<li>Märklin DIGITAL 146871 PIC-Decoder <a href="http://decoder.x-train.de/index.php?seite=decoder/digipic/146871.php%5b">1</a>. This low-cost decoder needs some pause after any speed change request to actually reach the new speed. This is important when two consecutive commands are sent, and especially critical if a change of direction is requested. In those cases, the decoder needs to stop before implementing the change of direction. Without the mandatory pause, the engine does not &#8220;accept&#8221; the request, and the change of direction is never achieved.</li>
<li>TAMS LD_W_3. This decoder needs an update on the speed after a change of direction request. Otherwise, the delay in accepting the order depends on the loco stack of commands and active protocols in DDX &#8211; worst scenario up to 18 seconds of delay with MM, MMLP and DCC active.</li>
<li>Motorola format I. This protocol forces a stop whenever a change of direction is requested. The behavior can be improved by implementing speed profiles, which may help considering the speed when<br />
the change of direction is requested as a persistent variable. In this way, after the change of direction is implemented, the speed is recovered and the loco does not stop.</li>
</ul>
<h1>How it works</h1>
<div>The speed profiles are implemented as a new feature for DDX working on Motorola protocol locomotives. The user needs to define per each step (14 or 28 steps) the delay until the next or previous step. As an example, the accelerating curve in previous section is defined by:</div>
<table border="0" align="center">
<tbody>
<tr>
<td>
<div>Step</div>
</td>
<td>
<div>Delay to next step (ms)</div>
</td>
<td>
<div>Next step</div>
</td>
</tr>
<tr>
<td>
<div>0</div>
</td>
<td>
<div>1500</div>
</td>
<td>
<div>1</div>
</td>
</tr>
<tr>
<td>
<div>1</div>
</td>
<td>
<div>1000</div>
</td>
<td>
<div>2</div>
</td>
</tr>
<tr>
<td>
<div>2</div>
</td>
<td>
<div>900</div>
</td>
<td>
<div>3</div>
</td>
</tr>
<tr>
<td>
<div>3</div>
</td>
<td>
<div>800</div>
</td>
<td>
<div>4</div>
</td>
</tr>
<tr>
<td>
<div>4</div>
</td>
<td>
<div>700</div>
</td>
<td>
<div>5</div>
</td>
</tr>
<tr>
<td>
<div>5</div>
</td>
<td>
<div>600</div>
</td>
<td>
<div>6</div>
</td>
</tr>
<tr>
<td>
<div>6</div>
</td>
<td>
<div>500</div>
</td>
<td>
<div>7</div>
</td>
</tr>
<tr>
<td>
<div>7</div>
</td>
<td>
<div>400</div>
</td>
<td>
<div>8</div>
</td>
</tr>
<tr>
<td>
<div>8</div>
</td>
<td>
<div>300</div>
</td>
<td>
<div>9</div>
</td>
</tr>
<tr>
<td>
<div>9</div>
</td>
<td>
<div>200</div>
</td>
<td>
<div>10</div>
</td>
</tr>
<tr>
<td>
<div>10</div>
</td>
<td>
<div>200</div>
</td>
<td>
<div>11</div>
</td>
</tr>
<tr>
<td>
<div>11</div>
</td>
<td>
<div>175</div>
</td>
<td>
<div>12</div>
</td>
</tr>
<tr>
<td>
<div>12</div>
</td>
<td>
<div>150</div>
</td>
<td>
<div>13</div>
</td>
</tr>
<tr>
<td>
<div>13</div>
</td>
<td>
<div>125</div>
</td>
<td>
<div>14</div>
</td>
</tr>
<tr>
<td>
<div>14</div>
</td>
<td>
<div>100</div>
</td>
<td>
<div>NA</div>
</td>
</tr>
</tbody>
</table>
<div>The curve can be extended to 28 steps. In any case, as expected, the last parameter &#8211; i.e. ms to go beyond the maximum step &#8211; is never used.</div>
<div><strong>IMPORTANT: </strong>a minimum delay of 10ms between steps should be respected (100ms recommended value). Otherwise, depending on the platform, the rocrail serveray collapse.</div>
<div>In a similar way, the deceleration file is defined by:</div>
<table border="0" align="center">
<tbody>
<tr>
<td>
<div>Step</div>
</td>
<td>
<div>Delay to previous step (ms)</div>
</td>
<td>
<div>Next step</div>
</td>
</tr>
<tr>
<td>
<div>14</div>
</td>
<td>
<div>2000</div>
</td>
<td>
<div>13</div>
</td>
</tr>
<tr>
<td>
<div>13</div>
</td>
<td>
<div>1800</div>
</td>
<td>
<div>12</div>
</td>
</tr>
<tr>
<td>
<div>12</div>
</td>
<td>
<div>1200</div>
</td>
<td>
<div>11</div>
</td>
</tr>
<tr>
<td>
<div>11</div>
</td>
<td>
<div>1000</div>
</td>
<td>
<div>10</div>
</td>
</tr>
<tr>
<td>
<div>10</div>
</td>
<td>
<div>600</div>
</td>
<td>
<div>9</div>
</td>
</tr>
<tr>
<td>
<div>9</div>
</td>
<td>
<div>600</div>
</td>
<td>
<div>8</div>
</td>
</tr>
<tr>
<td>
<div>8</div>
</td>
<td>
<div>500</div>
</td>
<td>
<div>7</div>
</td>
</tr>
<tr>
<td>
<div>7</div>
</td>
<td>
<div>400</div>
</td>
<td>
<div>6</div>
</td>
</tr>
<tr>
<td>
<div>6</div>
</td>
<td>
<div>300</div>
</td>
<td>
<div>5</div>
</td>
</tr>
<tr>
<td>
<div>5</div>
</td>
<td>
<div>200</div>
</td>
<td>
<div>4</div>
</td>
</tr>
<tr>
<td>
<div>4</div>
</td>
<td>
<div>175</div>
</td>
<td>
<div>3</div>
</td>
</tr>
<tr>
<td>
<div>3</div>
</td>
<td>
<div>150</div>
</td>
<td>
<div>2</div>
</td>
</tr>
<tr>
<td>
<div>2</div>
</td>
<td>
<div>125</div>
</td>
<td>
<div>1</div>
</td>
</tr>
<tr>
<td>
<div>1</div>
</td>
<td>
<div>100</div>
</td>
<td>
<div>0</div>
</td>
</tr>
<tr>
<td>
<div>0</div>
</td>
<td>
<div>200</div>
</td>
<td>
<div>*Pause before sending a refresh in a<br />
change direction request</div>
</td>
</tr>
</tbody>
</table>
<div>In this case, the last parameter, which was not used in the speed profile definition, has been used to code a pause if a refresh message wants to be sent at the end of the sequence when a change direction is requested &#8211; 0ms =non refresh.</div>
<div>In reaction to a speed change request, a sequence is initiated to reach the new speed going through the curve. In this way going from v=4 to v=9 would trigger the following sequence:</div>
<div>· Wait 700 ms and V=5</div>
<div>· Wait 600 ms and V=6</div>
<div>· Wait 500 ms and V=7</div>
<div>· Wait 400 ms and V=8</div>
<div>· Wait 300 ms and V=9</div>
<div>In the same way a change of direction in v=4 would trigger the following sequence:</div>
<div>· Wait 175 ms and V=3 reverse</div>
<div>· Wait 150 ms and V=2</div>
<div>· Wait 125 ms and V=1</div>
<div>· Wait 100 ms and V=0</div>
<div>· Wait 1500 ms and V=1 forward</div>
<div>· Wait 1000 ms and V=2</div>
<div>· Wait 900 ms and V=3</div>
<div>· Wait 800 ms and V=4</div>
<div>In the case of having any delay defined for v=0 &#8211; for instance 200ms-, at the decelerating curve, a last message would be sent:</div>
<div>· Wait 200 ms and V=4</div>
<div>The decelerating curve would be used in a similar way to go from v=9 to v=4.</div>
<h2>Configuration</h2>
<div>The configuration of any speed profile is done at the XML file describing the layout.</div>
<div>As a new parameter describing a loco, now it is possible to include a &#8220;speedcurvestep&#8221;:</div>
<blockquote>
<div>&lt;lc id=&#8221;130TB SNCF&#8221; mtime=&#8221;0&#8243; prev_id=&#8221;130TB SNCF&#8221; shortid=&#8221;130TB&#8221; roadname=&#8221;former Royal Prussian State Railways (K.P.E.V.) class T 12.&#8221; number=&#8221;130TB&#8221; desc=&#8221;" docu=&#8221;" image=&#8221;tb130.png&#8221; imagenr=&#8221;0&#8243; remark=&#8221;" len=&#8221;12&#8243; nrcars=&#8221;0&#8243; catnr=&#8221;36742&#8243; purchased=&#8221;2010&#8243; identifier=&#8221;0&#8243; show=&#8221;true&#8221; useshortid=&#8221;false&#8221; mint=&#8221;40&#8243; bus=&#8221;0&#8243; addr=&#8221;78&#8243; iid=&#8221;" prot=&#8221;M&#8221; protver=&#8221;2&#8243; spcnt=&#8221;14&#8243; fncnt=&#8221;2&#8243; V_min=&#8221;10&#8243; V_mid=&#8221;50&#8243; V_max=&#8221;100&#8243; V_Rmin=&#8221;0&#8243; V_Rmid=&#8221;0&#8243; V_Rmax=&#8221;0&#8243; V_step=&#8221;0&#8243; mass=&#8221;0&#8243; V_mode=&#8221;percent&#8221; placing=&#8221;true&#8221; regulated=&#8221;true&#8221; restorefx=&#8221;true&#8221; dirpause=&#8221;0&#8243; blockwaittime=&#8221;10&#8243; evttimer=&#8221;0&#8243; ent2incorr=&#8221;100&#8243; priority=&#8221;10&#8243; usescheduletime=&#8221;false&#8221; commuter=&#8221;false&#8221; trysamedir=&#8221;false&#8221; tryoppositedir=&#8221;false&#8221; forcesamedir=&#8221;false&#8221; shortin=&#8221;false&#8221; inatpre2in=&#8221;false&#8221; usemanualroutes=&#8221;false&#8221; engine=&#8221;steam&#8221; cargo=&#8221;mixed&#8221; secondnextblock=&#8221;false&#8221; consist_lightsoff=&#8221;false&#8221; consist=&#8221;" V=&#8221;0&#8243; throttleid=&#8221;" fn=&#8221;true&#8221; fx=&#8221;0&#8243; runtime=&#8221;33775&#8243; dir=&#8221;true&#8221; mode=&#8221;" resumeauto=&#8221;false&#8221; active=&#8221;true&#8221; scidx=&#8221;-1&#8243; server=&#8221;infw01EFE784&#8243; dectype=&#8221;" blockenterside=&#8221;true&#8221; throttlenr=&#8221;0&#8243; manual=&#8221;false&#8221; swaptimer=&#8221;0&#8243; useownwaittime=&#8221;false&#8221; startupscid=&#8221;"&gt;<br />
&lt;fundef fn=&#8221;4&#8243; text=&#8221;" timer=&#8221;0&#8243;/&gt;<br />
&lt;fundef fn=&#8221;0&#8243; text=&#8221;Luces&#8221; timer=&#8221;0&#8243;/&gt;<br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;0&#8243; nsleep=&#8221;3000&#8243; psleep=&#8221;0&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;1&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;1500&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;2&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;1000&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;3&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;2000&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;4&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;100&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;5&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;100&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;6&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;500&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;7&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;100&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;8&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;500&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;9&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;300&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;10&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;500&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;11&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;300&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;12&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;200&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;13&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;200&#8243;/&gt;</span><br />
<span style="color: #ff0000;"> &lt;speedcurvestep step=&#8221;14&#8243; nsleep=&#8221;0&#8243; psleep=&#8221;100&#8243;/&gt;</span><br />
&lt;/lc&gt;</div>
</blockquote>
<div>For each step the ms to wait until the next and previous steps need to be set.</div>
<div>If a step is not defined, or if it is defined with a 0ms wait, it will not be considered in the acceleration, or deceleration profile. Thus, a speedprofile as the one above will produce the following curve:</div>
<table border="0" align="center">
<tbody>
<tr>
<td>
<div style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/S2ACC.png" class="thickbox" rel="grupo1354" ><img class="aligncenter size-medium wp-image-1363" title="S2ACC" src="http://tren.enmicasa.net/wp-content/uploads/S2ACC-300x224.png" alt="" width="300" height="224" /></a></div>
<div style="text-align: center;">ACCELERATION CURVE 2 (wait in v=0 3000 ms)</div>
</td>
<td>
<div style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/S2DECC.png" class="thickbox" rel="grupo1354" ><img class="aligncenter size-medium wp-image-1364" title="S2DECC" src="http://tren.enmicasa.net/wp-content/uploads/S2DECC-300x224.png" alt="" width="300" height="224" /></a></div>
<div style="text-align: center;">DECELERATION CURVE 2</div>
</td>
</tr>
</tbody>
</table>
<div>The sequences presented(v=4 to V=9) before would become:</div>
<div>· Wait 0 ms and V=9</div>
<div>Delays equal to zero are not considered.</div>
<div>And V=4 change direction would become:</div>
<div>· Wait 100 ms and V=3 forward</div>
<div>· Wait 2000ms and V=2 forward</div>
<div>· Wait 1000 ms and V=1 forward</div>
<div>· Wait 1500 ms and V=0 forward</div>
<div>· Wait 3000ms and v=4 reverse</div>
<h2>Examples</h2>
<div>The attached file (<a href="http://tren.enmicasa.net/wp-content/uploads/speedr.zip">speedr</a>) presents the modified source files and four examples :</div>
<div>· One typical speed profile (curve 1, Firemen)</div>
<div>· One low cost  (curve 2, 130TB)</div>
<div>· One motorola I (curve 3, BR44)</div>
<div>· One tams (curve 4, V160)</div>
<div>The rest of the locomotives are just included to test that the speedcurve does not affect other decoders.</div>
<table border="0" align="center">
<tbody>
<tr>
<td>
<div style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/s3acc.png" class="thickbox" rel="grupo1354" ><img class="aligncenter size-medium wp-image-1365" title="s3acc" src="http://tren.enmicasa.net/wp-content/uploads/s3acc-300x224.png" alt="" width="300" height="224" /></a></div>
<div style="text-align: center;">ACCELERATION CURVE 3(no delay)</div>
</td>
<td>
<div style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/s3decc.png" class="thickbox" rel="grupo1354" ><img class="aligncenter size-medium wp-image-1366" title="s3decc" src="http://tren.enmicasa.net/wp-content/uploads/s3decc-300x224.png" alt="" width="300" height="224" /></a></div>
<div style="text-align: center;">DECELERATION CURVE 3</div>
</td>
</tr>
</tbody>
</table>
<table border="0" align="center">
<tbody>
<tr>
<td>
<div style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/s4acc.png" class="thickbox" rel="grupo1354" ><img class="aligncenter size-medium wp-image-1367" title="s4acc" src="http://tren.enmicasa.net/wp-content/uploads/s4acc-300x224.png" alt="" width="300" height="224" /></a></div>
<div style="text-align: center;">ACCELERATION CURVE 4 (no delay)</div>
</td>
<td>
<div style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/s4decc.png" class="thickbox" rel="grupo1354" ><img class="aligncenter size-medium wp-image-1368" title="s4decc" src="http://tren.enmicasa.net/wp-content/uploads/s4decc-300x224.png" alt="" width="300" height="224" /></a></div>
<div style="text-align: center;">DECELERATION CURVE 4 (repeat chdir)</div>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://tren.enmicasa.net/2011/06/05/funcion-speedcurve-en-rocrail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solución definitiva al problema del coche grúa en Rocrail</title>
		<link>http://tren.enmicasa.net/2010/01/03/solucion-definitiva-al-problema-del-coche-grua-en-rocrail/</link>
		<comments>http://tren.enmicasa.net/2010/01/03/solucion-definitiva-al-problema-del-coche-grua-en-rocrail/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 22:45:05 +0000</pubDate>
		<dc:creator>Manolo</dc:creator>
				<category><![CDATA[Rocrail]]></category>

		<guid isPermaLink="false">http://tren.enmicasa.net/?p=965</guid>
		<description><![CDATA[Finalmente han introducido una opción de configuración en Rocrail para permitir una pausa larga entre paquetes Motorola. Esta sencilla solución hace que el vagón grúa funcione ya perfectamente.]]></description>
			<content:encoded><![CDATA[<p>Finalmente han introducido una opción de configuración en Rocrail para permitir una pausa larga entre paquetes Motorola. Esta sencilla solución hace que el vagón grúa funcione ya perfectamente.</p>
]]></content:encoded>
			<wfw:commentRss>http://tren.enmicasa.net/2010/01/03/solucion-definitiva-al-problema-del-coche-grua-en-rocrail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solución 1 (con suerte no la última) al problema del vagón grúa en Rocrail</title>
		<link>http://tren.enmicasa.net/2009/12/30/solucion-1-con-suerte-no-la-ultima-al-problema-del-vagon-grua-en-rocrail/</link>
		<comments>http://tren.enmicasa.net/2009/12/30/solucion-1-con-suerte-no-la-ultima-al-problema-del-vagon-grua-en-rocrail/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 13:14:51 +0000</pubDate>
		<dc:creator>Manolo</dc:creator>
				<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Rocrail]]></category>
		<category><![CDATA[análisis]]></category>
		<category><![CDATA[grúa]]></category>
		<category><![CDATA[matlab]]></category>
		<category><![CDATA[programación]]></category>

		<guid isPermaLink="false">http://tren.enmicasa.net/?p=951</guid>
		<description><![CDATA[El vagón grúa me ha dado muchos problemas para funcionar en rocrail. Tras varios meses mirando el problema e intercambiando información en el foro, parece que por fin he encontrado una solución. Por comodidad la he documentado en inglés, pero si alguien necesita traducción sólo tiene que contactarme. Finally, I have been able to analyse [...]]]></description>
			<content:encoded><![CDATA[<p>El vagón grúa me ha dado muchos problemas para funcionar en rocrail. Tras varios meses mirando el problema e intercambiando información en el <a href="http://forum.rocrail.net/index.php">foro</a>, parece que por fin he encontrado una solución. Por comodidad la he documentado en inglés, pero si alguien necesita traducción sólo tiene que contactarme.</p>
<p>Finally, I have been able to analyse the output of a Mobile Station and compare it to the output of a DDX+MGV105.</p>
<p>After a couple of tests, it was clear, as expected that the signal from the MS (hereafter) was quite different to the signal coming from DDX, especially with regards to the distribution of packets.</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/tek00000.png" class="thickbox" rel="grupo951" ><img class="aligncenter size-full wp-image-952" title="tek00000" src="http://tren.enmicasa.net/wp-content/uploads/tek00000.png" alt="" width="537" height="341" /></a><a href="http://tren.enmicasa.net/wp-content/uploads/tek00000.png" class="thickbox" rel="grupo951" ></a></p>
<p><span id="more-951"></span></p>
<p>The voltage and timing were similar, except for the pause between double packets.</p>
<p>At this point, I needed a logic analyser to check the content of the packets and since I do not have an easy access to an oscilloscope at work, obviously I do not have one at home, and I needed a good set of samples, I decided to ‘build’ something that without having the quality of an oscilloscope, enables the recording of a high number of samples.</p>
<p>With a couple of resistors the voltage coming from a MS or a MGV105, can be reduced to meet the maximum acceptable levels of a sound card (normally between -1V and 1V). In the Internet there are a lot of examples on circuits to adapt the signal that is going to be recorded, protecting the sound card and PC. In my case, and since this solution was prepared ad-hoc to solve the problem with the crane, I simply used a simple voltage divider.</p>
<p>Choosing the resistors is critical, especially if you do not know the circuit in the sound card. As a general rule the second resistor should support only the -1V,1V difference, and the current through the divider should not be high enough to destroy the resistors.</p>
<p>Personally, I do not know if a high impedance in the divider would be better than a low impedance (as I said I do not know the details of the sound card). I have the feeling that a low impedance would be better… but it would require to dissipate a lot of power, and this solution was design to be built with 0,25W resistors. All in all, I used the following schema.</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/divisor.jpg" class="thickbox" rel="grupo951" ><img class="aligncenter size-full wp-image-953" title="divisor" src="http://tren.enmicasa.net/wp-content/uploads/divisor.jpg" alt="" width="300" height="172" /></a></p>
<p>Playing with different values for the second resistor, the best results in my case were with 33k – the limit to saturate my sound card and get voltages close to -1V,1V. Note that a higher resistor can damage a soundcard; actually 33k is already too high… especially for the MGV105.</p>
<p>As explained before, this was just an ad-hoc solution; there are much better circuits to adapt the signals.</p>
<p>The software used to record the signal was <a href="http://www.wavosaur.com/">wavosour</a>. Any software that can record at the maximum sample rate supported by a sound card is OK. I used the “line in” port of my sound card, but I suppose the microphone port could work too.</p>
<p>The higher the sample rate is, the best (you get more samples to capture the signal). Since the Motorola format has a frequency of ≈38K<a href="http://tren.enmicasa.net/wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=327-12351#_ftn1">[1]</a>, a sample rate of 44K could be enough (you get a sample each ≈22us and the shortest pulse in the format for locomotives is ≈26us). However, higher sample rates are needed in order to obtain an accurate capture, (pretty important if you want to measure the timings, and not just to capture the levels). In addition, higher sample rates enable the recording of accessory packets, which shorter pulse is ≈13us – out of the scope of this analysis.</p>
<p>I recorded the signals from the MS and DDX+MGV105 (configuring rocrail to work only with MM) using 192K as ample rate – once again I had no idea of what the limits of my sound card were.</p>
<p>The resulting wave files can be opened and treated with Matlab. To that end I wrote a set of functions to prepare the signal (chose the channel in the case of a stereo recording, produce the sampling vector and even adapt the polarity of the signal); decode the trits and measure the distance between packets; decode the bits; and measure the distance between two data cursors in a figure.</p>
<p>The results for idle data in a group of 4 packets in DDX can be found hereafter. Besides the the way the information is distributed in the MS, and not considering the expected differences –i.e. no idle data for DCC in the MS, unknown packets in the MS that could be MMX info – the main differences were on the pause timing between packets, specially the pause between double packets.</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/idlesignalMM.jpg" class="thickbox" rel="grupo951" ><img class="aligncenter size-full wp-image-954" title="idlesignalMM" src="http://tren.enmicasa.net/wp-content/uploads/idlesignalMM.jpg" alt="" width="674" height="306" /></a></p>
<p>The MS is forcing a pause of more than 6000us, whilst DDX is forcing only 2000us (1700us reading the source code, if I am understanding it right).</p>
<p>On the other hand, the timing of an idle packet in DDX is similar to the timing of the MS, though the MS is not producing the expected idle packet -i.e. AAAA00000’trit.</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/idlemseeageMM.jpg" class="thickbox" rel="grupo951" ><img class="aligncenter size-full wp-image-956" title="idlemseeageMM" src="http://tren.enmicasa.net/wp-content/uploads/idlemseeageMM.jpg" alt="" width="667" height="329" /></a></p>
<p>With this first analysis and the results of the different functions in Matlab, the most significant difference seemed to be on the pause between double-packets. Furthermore, the comments on the different configurations for the <a href="http://www.uhlenbrock.de/germany/Service/FAQ/MaerSys/I96EF538-001.htm!ArcEntryInfo=0007.3.I96EF538&amp;NewServerName=GAMMA">Intellibox</a>, and the comments on how the 6021 can be also configured to adapt the timing between <a href="http://www.diei.unipg.it/STAFF/scorzoni_file/personale/hobby/motorola.htm">packets</a>, pointed at the timing as the more probable cause of the problem with the crane.</p>
<p>As a first solution I have modified the end19K value at locpool.c in rocrail sourcecode, 6000us instead of 1700. With this figure, the crane is reacting fine. I have tested the other MM decoders I have (tams LD-W-3, and a MMX decoder) and everything still works. I have also tested if this modification affects to the DCC signal,  and so far I have not detected any problem with my home made <a href="http://tren.enmicasa.net/?page_id=312">DCC accessory decoder</a> and the loksound decoders.</p>
<p>I would expect more flickering in the lights, and of course a longer delay in the response to commands… but it does not seem to be so critical. Obviously, this is just a working solution. At least it would require a dialog in rocview to offer the possibility to change this value or not (as the intellibox or the 6021 do).</p>
<p>I am working now in declaring a new MM format in DDX (MM6) forcing this special pauses of 6000us. As soon as I get results, if any, I would publish them.</p>
<p>The files in matlab as well as the modified locpool.c can be found <a href="http://tren.enmicasa.net/wp-content/uploads/crane.zip">attached</a>. Sorry but the comments are in Spanish, so if you want to use them and you need translation, please let me know.</p>
<hr size="1" />
<p><a href="http://tren.enmicasa.net/wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=327-12351#_ftnref1">[1]</a> A complete description of the Märklin Motorola format is provided by Andrea Scorzoni at <a href="http://www.diei.unipg.it/STAFF/scorzoni_file/personale/hobby/motorola.htm">http://www.diei.unipg.it/STAFF/scorzoni_file/personale/hobby/motorola.htm</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://tren.enmicasa.net/2009/12/30/solucion-1-con-suerte-no-la-ultima-al-problema-del-vagon-grua-en-rocrail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Estudiando un nuevo esquema ecléctrico</title>
		<link>http://tren.enmicasa.net/2009/09/06/estudiando-un-nuevo-esquema-eclectico/</link>
		<comments>http://tren.enmicasa.net/2009/09/06/estudiando-un-nuevo-esquema-eclectico/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 10:16:20 +0000</pubDate>
		<dc:creator>Manolo</dc:creator>
				<category><![CDATA[Diseño]]></category>
		<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Rocrail]]></category>

		<guid isPermaLink="false">http://tren.enmicasa.net/?p=880</guid>
		<description><![CDATA[En los últimos días estoy estudiando abandonar el planeado uso dl bus s88, y sustituirlo por loconet. Parece que en rocrail es la opción que da mejores resultados. De hecho han creado una nueva placa de alimentación muy compacta y sencilla que no incluye el bus s88 y que es capaz de reportar cortos y [...]]]></description>
			<content:encoded><![CDATA[<p>En los últimos días estoy estudiando abandonar el planeado uso dl bus s88, y sustituirlo por loconet. Parece que en rocrail es la opción que da mejores resultados.</p>
<p>De hecho han creado una nueva placa de alimentación muy compacta y sencilla que no incluye el bus s88 y que es capaz de reportar cortos y estado a loconet.</p>
<p>Aún no tengo muy claro como funciona el sistema – me estoy informando en el foro de rocrail – pero la versión simplificada del nuevo esquema debería ser algo así.</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/ESQUEMA_2_LOCO.jpg" class="thickbox" rel="grupo880" ><img class="aligncenter size-full wp-image-881" title="ESQUEMA_2_LOCO" src="http://tren.enmicasa.net/wp-content/uploads/ESQUEMA_2_LOCO.jpg" alt="ESQUEMA_2_LOCO" width="532" height="376" /></a> </p>
<p>Lo único que sé es que los cirtuitos que se emplean son bastante más sencillos de realizar, y que el programa es capaz de gestionar los boosters de manera individual.</p>
<p>Lo que aún no sé cierto es como se conectan los detectores de corriente – y si podré adaptarlos a una detección por infrarrojos – ni como se conectan varios boosters.</p>
<p>Espero aclarar las dudas pronto.</p>
]]></content:encoded>
			<wfw:commentRss>http://tren.enmicasa.net/2009/09/06/estudiando-un-nuevo-esquema-eclectico/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Estación subterránea (II)</title>
		<link>http://tren.enmicasa.net/2008/08/18/estacion-subterranea-ii/</link>
		<comments>http://tren.enmicasa.net/2008/08/18/estacion-subterranea-ii/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 22:40:14 +0000</pubDate>
		<dc:creator>Manolo</dc:creator>
				<category><![CDATA[Construcción]]></category>
		<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Rocrail]]></category>
		<category><![CDATA[cableado]]></category>
		<category><![CDATA[clavos]]></category>
		<category><![CDATA[corcho]]></category>
		<category><![CDATA[estación]]></category>
		<category><![CDATA[ordenador]]></category>
		<category><![CDATA[subterránea]]></category>

		<guid isPermaLink="false">http://tren.enmicasa.net/?p=179</guid>
		<description><![CDATA[Tras más de dos años sin trabajar en los aspectos mecánicos de la maqueta (carpintería), este verano me he decidido a avanzar un poco más con la estación subterránea. A falta de terminar mi booster casero, los detectores infrarrojos y de hacer más copias de mi decoder de accesorios; me he puesto a construir la [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Tras más de dos años sin trabajar en los aspectos mecánicos de la maqueta (carpintería), este verano me he decidido a avanzar un poco más con la estación subterránea.</p>
<p style="text-align: left;">A falta de terminar mi booster casero, los detectores infrarrojos y de hacer más copias de mi decoder de accesorios; me he puesto a construir la rampa de acceso a la estación subterránea. Además he incluido las modificaciones al diseño que ya presenté en un artículo <a href="http://tren.enmicasa.net/2008/07/03/nuevo-diseno-para-la-estacion-subterranea/" target="_self">anterior</a>.</p>
<p style="text-align: left;">Tras dar inclinación a las vías, me ha parecido que era hora de clavarlas, y evitar así que se vicien y adquieran deformaciones. Para ello además de la capa de chapa de madera sobre la que se sujetan, he provisto el trazado de una cama de corcho que amortigua y da homogeneidad al recorrido.</p>
<p style="text-align: left;">Finalmente he pasado todos los cables ya a la cara inferior, dejando despejado el nivel de las vías.</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/img_00241.jpg" class="thickbox" rel="grupo179" ><img class="size-medium wp-image-197" title="img_00241" src="http://tren.enmicasa.net/wp-content/uploads/img_00241-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://tren.enmicasa.net/wp-content/uploads/img_00261.jpg" class="thickbox" rel="grupo179" ><img class="size-medium wp-image-199" title="img_00261" src="http://tren.enmicasa.net/wp-content/uploads/img_00261-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://tren.enmicasa.net/wp-content/uploads/img_00251.jpg" class="thickbox" rel="grupo179" ><img class="size-medium wp-image-198" title="img_00251" src="http://tren.enmicasa.net/wp-content/uploads/img_00251-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://tren.enmicasa.net/wp-content/uploads/img_00231.jpg" class="thickbox" rel="grupo179" ><img class="size-medium wp-image-196" title="img_00231" src="http://tren.enmicasa.net/wp-content/uploads/img_00231-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>La segunda gran novedad ha sido la inclusión del ordenador que correrá rocrail para controlar la maqueta.</p>
<p>Lo he instalado junto a la rampa, en una zona muy despejada de vías y cercana a los enchufes de la casa. Para albergarlo lo he alojado en una pequeña caja de metacrilato. En realidad, no se pude considerar una caja ya que, a fin de poder acceder a él y manipularlo desde abajo (cuando la maqueta esté terminada el acceso desde arriba será imposible), lo que he hecho ha sido fabricar tres paredes de metacrilado (arriba, abajo e izquierda) que se puedes desmontar para liberar el ordenador. La ventilación se garantiza por una de las paredes y con la inclusión de ventiladores. En la zona de ventilación se incluirá también el booster principal.</p>
<p style="text-align: center;"><a href="http://tren.enmicasa.net/wp-content/uploads/img_00181.jpg" class="thickbox" rel="grupo179" ><img class="aligncenter size-medium wp-image-193" title="img_00181" src="http://tren.enmicasa.net/wp-content/uploads/img_00181-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://tren.enmicasa.net/wp-content/uploads/img_00151.jpg" class="thickbox" rel="grupo179" ><img class="aligncenter size-medium wp-image-191" title="img_00151" src="http://tren.enmicasa.net/wp-content/uploads/img_00151-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://tren.enmicasa.net/wp-content/uploads/img_00161.jpg" class="thickbox" rel="grupo179" ><img class="aligncenter size-medium wp-image-192" title="img_00161" src="http://tren.enmicasa.net/wp-content/uploads/img_00161-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://tren.enmicasa.net/wp-content/uploads/img_00221.jpg" class="thickbox" rel="grupo179" ><img class="aligncenter size-medium wp-image-195" title="img_00221" src="http://tren.enmicasa.net/wp-content/uploads/img_00221-300x225.jpg" alt="" width="300" height="225" /></a><img class="alignnone size-medium wp-image-194" title="img_00191" src="http://tren.enmicasa.net/wp-content/uploads/img_00191-300x225.jpg" alt="" width="300" height="225" /></p>
]]></content:encoded>
			<wfw:commentRss>http://tren.enmicasa.net/2008/08/18/estacion-subterranea-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

