Joined: 23/07/2014(UTC) Posts: 8,467 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?
|
 1 user liked this useful post by kiwiAlan
|
|
|
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°....
|
|
 1 user liked this useful post by DaleSchultz
|
|
|
Joined: 28/03/2007(UTC) Views messages in topic : 303 Location: Torino,
|
Originally Posted by: kiwiAlan  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
|
 3 users liked this useful post by mario54i
|
|
|
Joined: 23/07/2014(UTC) Posts: 8,467 Location: ENGLAND, Didcot
|
Originally Posted by: DaleSchultz  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.
|
|
|
|
Joined: 23/07/2014(UTC) Posts: 8,467 Location: ENGLAND, Didcot
|
Originally Posted by: mario54i  Originally Posted by: kiwiAlan  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.
|
|
|
|
Joined: 28/03/2007(UTC) Views messages in topic : 303 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
|
|
|
|
Joined: 23/07/2014(UTC) Posts: 8,467 Location: ENGLAND, Didcot
|
Originally Posted by: mario54i  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 Thanks for the scope shots, I hadn't got that far yet, but will confirm them for myself. Regards Alan
|
|
|
|
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.
|
|
|
|
|
Joined: 23/07/2014(UTC) Posts: 8,467 Location: ENGLAND, Didcot
|
Originally Posted by: DaleSchultz  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  . I think the unit in the link that Minok posted does what you suggest.
|
|
|
|
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.... |
|
|
|
|
Joined: 23/07/2014(UTC) Posts: 8,467 Location: ENGLAND, Didcot
|
Originally Posted by: DaleSchultz  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.
|
 1 user liked this useful post by kiwiAlan
|
|
|
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 |
|
|
|
|
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 |
|
|
|
Joined: 23/07/2014(UTC) Posts: 8,467 Location: ENGLAND, Didcot
|
Originally Posted by: costing  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.
|
|
|
|
Joined: 07/11/2024(UTC) Posts: 4
|
Alan,
I'm also interested in using the SUSI communication protocol to output decoder data to a custom expansion board. Did you ever test using SUSI or end up using it for your video camera project?
loddie
|
|
|
|
Joined: 23/07/2014(UTC) Posts: 8,467 Location: ENGLAND, Didcot
|
Originally Posted by: loddie  Alan,
I'm also interested in using the SUSI communication protocol to output decoder data to a custom expansion board. Did you ever test using SUSI or end up using it for your video camera project?
loddie I haven't got to that project yet, been doing a heap of other stuff. Sorry can't help with how to implement SUSI, other than studying the document I posted a link to.
|
|
|
|
Joined: 07/11/2024(UTC) Posts: 4
|
No worries. If you do pursue SUSI further, please update here or in a new thread.
|
|
|
|
Joined: 28/03/2007(UTC) Views messages in topic : 303 Location: Torino,
|
Hello LeRoy I found your PM in spam folder marked as potentially unsafe. Sorry for the delay. You have a quite interesting question but I don't know the answer. You could post your question here, someone else could help. I'm using SUSI in a basic way, just taking information about active functions F0-F28, set and actual speed and direction. I wrote the code myself for Attiny microcontrollers. If you need some help do not hesitate.
Regards
|
 1 user liked this useful post by mario54i
|
|
|
Joined: 07/11/2024(UTC) Posts: 4
|
Originally Posted by: mario54i  Hello LeRoy I found your PM in spam folder marked as potentially unsafe. Sorry for the delay. You have a quite interesting question but I don't know the answer. You could post your question here, someone else could help. I'm using SUSI in a basic way, just taking information about active functions F0-F28, set and actual speed and direction. I wrote the code myself for Attiny microcontrollers. If you need some help do not hesitate.
Regards
Hi Mario, I'm glad you found the message! So not to hijack this thread, I started a new thread here: https://www.marklin-user...USI-interface#post677389loddie
|
|
|
|
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.