Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post in this topic Go to first unread post in this topic
Offline kiwiAlan  
#1 Posted : 10 August 2020 22:35:58(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,102
Location: ENGLAND, Didcot
Has anyone had any experience designing a SUSI device to attach to a decoder?

My reason for asking is that Minoks posting over here has reawakened thoughts of doing something similar.

Cogitating on it today my thinking is going along the following lines - Use a raspberry Pi Zero W as the primary camera control unit for a RPi camera, and it will then be able to store video on its internal microSD card and/or transmit it over Wifi to a phone or tablet.

Then have a potentiometer linked to the front coupling on the wagon - I am envisaging using a 4515 wagon as the underlying transport - which the code in the RPi will read and swing the camera in line with the bogie position so it will 'look around' curves as it travels.

However having watched the video in Minoks post I realise there is some value in unlinking the camera from the bogie angle and being able to turn it further manually to get sideways views. So my thoughts wandered along the lines of using a suitable decoder such as a Lokpilot as the source of control and link it to the RPi with a SUSI interface.

I have looked at the NMRA document which is essentially a translation of the German document by the originator of the SUSI protocol. It doesn't look like an onerous protocol in terms of timing, so it should be able to be decoded by the RPi with commands defined to lock the camera to the bogie, or move it independently, start recording, and any other functions that come to mind.

As another thought I was considering having some lights at the front of the wagon, which when turned on would 'fade up' over several seconds after a voice says "lights" then once they had come up to full brilliance the voice would say "Camera, and a couple of seconds later would say "action". this should be all possible with the RPi initiated by a SUSI command.

So I'm wondering if anyone has tried playing with SUSI beyond using ready made add-on boards?

thanks 1 user liked this useful post by kiwiAlan
Offline DaleSchultz  
#2 Posted : 11 August 2020 03:15:26(UTC)
DaleSchultz

United States   
Joined: 10/02/2006(UTC)
Posts: 3,997
never looked at SUSI, but why not have both independent pan control AND bogie drive panning?

If you attach the camera to the bogie, it will automatically turn with curves, and then you can pan the camera relative to the bogie as well.
So if the bogie is 5° off straight, and the direct control pan is 5° you will have a 10° camera slew. As it comes out of the curve into a straight it will become 5°....
Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
thanks 1 user liked this useful post by DaleSchultz
Offline mario54i  
#3 Posted : 11 August 2020 11:02:22(UTC)
mario54i

Italy   
Joined: 28/03/2007(UTC)
Posts: 283
Location: Torino,
Originally Posted by: kiwiAlan Go to Quoted Post

So I'm wondering if anyone has tried playing with SUSI beyond using ready made add-on boards?



I did it many times.
I use SUSI to get information from decoder and use them to control lights and other special effects.



This is an expansion board for Marklin and Hag Re460.
It takes information from SUSI about speed, direction, functions status and controls 8 amplified outputs per side, two servos for pantos, 4 LED outputs for panto sparking.
Besides, one relay is for consist lighting, the other is a latching relay for pickup shoe switching in shuttle trains.
It works with Lokpilot V4 and Zimo, but only F0-F12. It doesn't work with Marklin decoders, reason unknown.
The flexibility of Lokpilot programming is lost, all control of outputs is written into the board and cannot be changed by user.

I have also used this technique to control an entire consists from one decoder, passing the four SUSI wires all along the train.
It works but not perfectly, at power on everything works, after some running on rails (i.e. noise, spikes and so) the slave boards far from master lose control and a power off/on is needed.
Probably the alignment of SUSI packets is lost.

Regards




thanks 1 user liked this useful post by mario54i
Offline kiwiAlan  
#4 Posted : 11 August 2020 16:18:40(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,102
Location: ENGLAND, Didcot
Originally Posted by: DaleSchultz Go to Quoted Post
never looked at SUSI, but why not have both independent pan control AND bogie drive panning?

If you attach the camera to the bogie, it will automatically turn with curves, and then you can pan the camera relative to the bogie as well.
So if the bogie is 5° off straight, and the direct control pan is 5° you will have a 10° camera slew. As it comes out of the curve into a straight it will become 5°....


Thanks for the thought Dale. I hadn't considered having it as an offset from the bogie angle, but that could be a third mode.

I was just going to have it as bogie controlled, or manual angle set.But I will certainly have enough functions availale to add a third mode.

Offline kiwiAlan  
#5 Posted : 11 August 2020 18:05:25(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,102
Location: ENGLAND, Didcot
Originally Posted by: mario54i Go to Quoted Post
Originally Posted by: kiwiAlan Go to Quoted Post

So I'm wondering if anyone has tried playing with SUSI beyond using ready made add-on boards?


I did it many times.
I use SUSI to get information from decoder and use them to control lights and other special effects.
...
This is an expansion board for Marklin and Hag Re460.
It takes information from SUSI about speed, direction, functions status and controls 8 amplified outputs per side, two servos for pantos, 4 LED outputs for panto sparking.
Besides, one relay is for consist lighting, the other is a latching relay for pickup shoe switching in shuttle trains.
It works with Lokpilot V4 and Zimo, but only F0-F12. It doesn't work with Marklin decoders, reason unknown.
The flexibility of Lokpilot programming is lost, all control of outputs is written into the board and cannot be changed by user.

I have also used this technique to control an entire consists from one decoder, passing the four SUSI wires all along the train.
It works but not perfectly, at power on everything works, after some running on rails (i.e. noise, spikes and so) the slave boards far from master lose control and a power off/on is needed.
Probably the alignment of SUSI packets is lost.

Regards



Thanks Mario. I don't think Marklin claim to have a SUSI interface, although they must do as I understand that the C-Sine locos with piggy back decoders (i.e. the early ESU based ones) use SUSI to communicate the loco speed etc between the decoder and the C-Sine electronics. So to use a Marklin decoder you may need to use whatever setup they use for C-Sine control.

Having looked at the Lokpilot info for SUSI I agree with you, all you get is that a function is turned off or on and some information about motor settings. I am expecting to use the decoder just to get a track interface, so that is all I need as I am not looking to do anything fancy.

How did you receive the SUSI data? It looks like it should be possible to use an SPI module in 8 bit mode, possibly using timeouts to deal with framing issues. Then using a transistor driven from a GPIO pin to pull the data line low for an acknowledge pulse.
Offline mario54i  
#6 Posted : 11 August 2020 20:20:57(UTC)
mario54i

Italy   
Joined: 28/03/2007(UTC)
Posts: 283
Location: Torino,
Yes, it's an SPI.
In a Lokpilot SUSI signal is a 16 bits packet at around 4 kb/s repeated every 16 ms.





DATA line goes in high impedance between packets. I didn't use any acknowledge.
I did alignment just by waiting 2.5 ms without high level on clock line at power up
Beware of the bit order.

Marklin decoders give out a SUSI like signal, my software doesn't understand it. No problems.


Regards

Offline kiwiAlan  
#7 Posted : 12 August 2020 00:24:48(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,102
Location: ENGLAND, Didcot
Originally Posted by: mario54i Go to Quoted Post
Yes, it's an SPI.
In a Lokpilot SUSI signal is a 16 bits packet at around 4 kb/s repeated every 16 ms.


Except the CV commands which are 3 bytes (24 bits). I guess if one presets everything and doesn't worry about CVs then it doesn't matter BigGrin

Thanks for the scope shots, I hadn't got that far yet, but will confirm them for myself.

Regards

Alan
Offline DaleSchultz  
#8 Posted : 12 August 2020 14:25:26(UTC)
DaleSchultz

United States   
Joined: 10/02/2006(UTC)
Posts: 3,997
the bit I have missed, is why not simply use the analog output produced by a decoder function output to signal what you want?
I assume the camera controls you want are:

on/off (maybe)
pan left
pan right

so all you need is three function outputs.

Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
Offline kiwiAlan  
#9 Posted : 12 August 2020 17:47:00(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,102
Location: ENGLAND, Didcot
Originally Posted by: DaleSchultz Go to Quoted Post
the bit I have missed, is why not simply use the analog output produced by a decoder function output to signal what you want?
I assume the camera controls you want are:

on/off (maybe)
pan left
pan right

so all you need is three function outputs.



That might be a possibility, but what I am considering doing is using a PWM output from the RPi to provide the position command for an R/C servo. I was looking at having the RPi sense the bogie angle using a potentiometer, and then provide a calibrateable drive to the servo, as I believe the camera angle swing in bogie follow mode will need to be a greater angle than the bogie moves to produce a sensible view in the image. My gut feeling is if the bogie goes 5 degrees then the camera will need to move something like 8-10 degrees.

The idea of using a decoder to control the options is a very recent idea after watching the video that Minok posted the link to, and realising that there is viewing value in having the camera not just look straight ahead in track follow mode.

The sort of options I am thinking of are as follows: -
Camera in "Track Follow" mode - one function turns on this mode, a second function possibly increases the camera swing by a fixed amount.
Camera in "manual" mode (one function pans left, another function pans right). Possibly another function key would allow these ones to add offset to the track follow mode as you previously suggested.
"Record" video - RPi records the camera video (allows dropout free watching afterwards). The video is always transmitted on the Wifi.
Another key would initiate a "Lights" voice announcement (head lights fade up) then "Camera" announcement (turns on red light on top to show active camera, studio style) then "Action" announcement which drops into Record mode.

I'm guessing there will be other ideas as time goes by BigGrin.

I think the unit in the link that Minok posted does what you suggest.
Offline DaleSchultz  
#10 Posted : 12 August 2020 18:34:48(UTC)
DaleSchultz

United States   
Joined: 10/02/2006(UTC)
Posts: 3,997
I get all that, but you still don't say what the SUSI gives you.....

Are you looking for an input that is a range, so you know how much pan to use? If so, just use a motor speed output as your input....
Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
Offline kiwiAlan  
#11 Posted : 12 August 2020 19:01:21(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,102
Location: ENGLAND, Didcot
Originally Posted by: DaleSchultz Go to Quoted Post
I get all that, but you still don't say what the SUSI gives you.....

Are you looking for an input that is a range, so you know how much pan to use? If so, just use a motor speed output as your input....


OK. SUSI gives me the ability to control the camera from the train controller. Otherwise all control has to be done via wifi through the RPi, which involves doing an app for the phone.

I am envisaging having it at an exhibition where the video can be put on a screen for the public to see, with the camera control being done by the person at the controller.
thanks 1 user liked this useful post by kiwiAlan
Offline DaleSchultz  
#12 Posted : 12 August 2020 20:09:42(UTC)
DaleSchultz

United States   
Joined: 10/02/2006(UTC)
Posts: 3,997
ah, I see thanks.

If you use function and motor outputs of a loco decoder, you still control it from the train controller...

If you have not tried Blynk yet, this may be a good time to check it out. It gives you a phone app that interfaces with Arduino projects, very easy to put together.
See https://blynk.io/en/developers
Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
Offline costing  
#13 Posted : 13 August 2020 09:11:37(UTC)
costing

Switzerland   
Joined: 20/08/2018(UTC)
Posts: 157
Location: Geneve, Geneva
Could you use, instead of a slave susi device, a second decoder, listening on the same address? It can be an actual decoder or an arduino (dcc only) which you can directly program to act on the function changes.
JMRI on RPi & DCC++ / C-track / Marklin, Roco, ESU, Bemo locos / Christmas car collector
Offline kiwiAlan  
#14 Posted : 13 August 2020 11:52:50(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,102
Location: ENGLAND, Didcot
Originally Posted by: costing Go to Quoted Post
Could you use, instead of a slave susi device, a second decoder, listening on the same address? It can be an actual decoder or an arduino (dcc only) which you can directly program to act on the function changes.


Well, it only needs one decoder in total, and I was working on the practicality of using a Lokpilot to give me multiple protocols so I can use the camera car on multiple layouts.

My current thinking is becoming a case of using a decoder to feed commands to a suitably programmed microprocessor to control the servo and lights rather than having the RPi Zero W do this, and have the Pi just do the video and wifi part.

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

| Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.690 seconds.