Andrew Davie's Arduino Televisor by Chris Lewis

Centralised area for notes about construction projects. Each project has its own sub-forum. In the sub-forums will be topics relevant to parts of that project (e.g., there might be a topic on motor control). If you start a construction diary, just post in the forum with your project name as the topic, and a moderator will create a sub-forum for your project.

Moderators: Dave Moll, Andrew Davie, Steve Anderson

Andrew Davie's Arduino Televisor by Chris Lewis

Postby acl » Sat Jul 18, 2020 1:47 am

Construction Diary 7 Final Testing

With the disc now fitted on the motor and spun freely by hand we may start final testing. You will need to load all the files from this directory onto a MicroSD card and insert into the socket on the main controller card.

https://github.com/andrew-davie/Arduino ... BTV8%20WAV

These are the actual NBTV video files. Apply power to the unit and hopefully if there’s no smoke you should see the display light up with HMI front screen. By touching the screen the play menu should appear then you can select the NBTV file you would like to play then by touching the icon at the bottom right of the screen the motor should start to turn counter clockwise, speed up and after a short period of time the video should lock. Adding electrolytic capacitors approx. 470 MFD should stabilise the picture (watch the polarity).

If the picture is upside down the motor is turning the wrong way round and can be rectified by swapping the leads on the motor. If the image is ‘mirrored’ indicated by the countdown numbers being reversed then the disc is facing the wrong direction. Touching the icon again stops the run sequence. Brightness, contrast and volume controls are controlled by touch control slider bars.

If the disc tries to launch itself into orbit then we should start looking at the speed detection circuitry. With the power on and the disc not turning if we connect a scope across the ‘two ‘IR-synch in’ terminals (ground connection to the right terminal) we should see a nominal five Volt signal when the synch hole is obscured and zero volts when the hole is present. If you suspect a faulty IR detector then swap the wires around if not point a TV remote control directly into the detector and you should see a stream of pulses appear when a selection button is depressed on the remote control. If you point a digital camera at the IR sending LED you should see a blue hue around through your viewfinder it when it is energised.
acl
Anyone have a spare straightjacket?
 
Posts: 441
Joined: Thu Mar 08, 2007 7:38 am

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby Andrew Davie » Sat Jul 18, 2020 11:26 pm

acl wrote:These are the actual NBTV video files. Apply power to the unit and hopefully if there’s no smoke you should see the display light up with HMI front screen. By touching the screen the play menu should appear then you can select the NBTV file you would like to play then by touching the icon at the bottom right of the screen the motor should start to turn counter clockwise, speed up and after a short period of time the video should lock.


That doesn't sound quite right. The play menu will show the filenames of the "wav" files detected on the MicroSD card. You should be able to select any of these by pressing anywhere on the line with the name. On the right side is a scrollbar, which behaves as expected if you have more files than can be shown on a single screen. When you select a file, it should auto-play from that point - displaying a control screen with brightness/contrast/sound/gamma and a few other controls.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby acl » Sat Jul 18, 2020 11:38 pm

I stand corrected Andrew.
acl
Anyone have a spare straightjacket?
 
Posts: 441
Joined: Thu Mar 08, 2007 7:38 am

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby FlyMario » Wed Sep 30, 2020 2:11 pm

Well, this is a fascinating read! What a nice Televisor! I had been toying with the idea of using a MicroSD Card with my latest design. This makes me wonder if you are getting the motor up to speed and then feeding the video signal in or if you are obtaining the sync signals from the .wav file and syncing the motor to it?

I imagine you are going to say it is the second one and you are doing it in the traditional way. The sound might get funny if you were to alter the video to match the motor. If that is the case, it seems that the microcontroller would have to do the sync collections since I don't spot any chips likely to do this.
Peter J. Fischel
Mechanical TV Fan, Programmer and Tinkerer.
FlyMario
Mad Scientist
 
Posts: 73
Joined: Sat Sep 22, 2018 11:34 am

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby Andrew Davie » Wed Sep 30, 2020 2:16 pm

The system detects the difference between a received IR pulse from the motor spinning, and the absolute offset of the sample that is playing at the time. That gives a time difference, which is then used to drive a PID for spinning the motor. In other words, it's the signal which is used to get the delta of where the hole position is relative to where it should be - and then speeds up or slows down the PWM to the motor, accordingly.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby Andrew Davie » Wed Sep 30, 2020 2:24 pm

To clarify a bit more -- the system requires only a single IR hole --- and thus a synch pulse is received only once per rotation. Since the PWM to the motor is "tweaked" once per revolution of the disk, but remains the same value during that revolution, the picture tends to be somewhat stable. The intensity of the "tweak" is based on the delta between received IR time and expected IR time, and so it can get the disk up to speed very rapidly with the motor powering up quickly at the start, and then settling down to a fairly static PWM. Typically, the ArduinoVisors built thus far seem to be able to get from stopped to a fully-correct framed and stable image in 5 to 8 seconds.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby FlyMario » Wed Sep 30, 2020 9:08 pm

Ahh Great! A single sync hole per revolution. I am trying to do the same thing on my new build.

I did want to ask about optical sensors vs hall effect. On my new television I have a hall effect sensor. The only reason is I recall all the issues I had before with ambient light goofing up the ir sensor readings. Do you have any opinion on hall effect sensors?
Peter J. Fischel
Mechanical TV Fan, Programmer and Tinkerer.
FlyMario
Mad Scientist
 
Posts: 73
Joined: Sat Sep 22, 2018 11:34 am

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby Harry Dalek » Wed Sep 30, 2020 9:31 pm

FlyMario wrote:Ahh Great! A single sync hole per revolution. I am trying to do the same thing on my new build.

I did want to ask about optical sensors vs hall effect. On my new television I have a hall effect sensor. The only reason is I recall all the issues I had before with ambient light goofing up the ir sensor readings. Do you have any opinion on hall effect sensors?


I used the hall effect sensors on the 2nd drum monitor .. as you see it can replace the opto switch altogether only problem is the mass of the magnet i would since you are thinking of just one cut a small bit out of a fridge magnet see how tiny you can get away with .
If framing pulse is wanted perhaps also after the LM311 a monostable ic to adjust the pulse width to match your mini computer pulse width wants for motor control .
Attachments
Picture 2290-cropmotorcontrol.jpg
Picture 2290-cropmotorcontrol.jpg (228.3 KiB) Viewed 10455 times
The electromagnetic spectrum has no theoretical limit at either end. If all the mass/energy in the Universe is considered a 'limit', then that would be the only real theoretical limit to the maximum frequency attainable.
User avatar
Harry Dalek
"Fester! Don't do that to 'Thing'"
 
Posts: 5364
Joined: Fri Sep 26, 2008 4:58 pm
Location: Australia

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby FlyMario » Thu Oct 01, 2020 12:05 am

Yes, I am using a very tiny magnet. 3mm across. The hall effect sensor ( A3144 ) has no problem with picking up the pulse at full speed. I can't argue that there is accuracy issues... especially since I have a DC motor in the mix.

I do not seem to have any balance issues because of the little magnet. Maybe I would if I went way higher speeds. Having the aluminum disk not be Perfectly Flat and 3D printed gears seem to create enough light vibrations.
Peter J. Fischel
Mechanical TV Fan, Programmer and Tinkerer.
FlyMario
Mad Scientist
 
Posts: 73
Joined: Sat Sep 22, 2018 11:34 am

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby FlyMario » Thu Oct 01, 2020 7:49 am

I have been reading over your code for this televisor. You are really doing a lot with that poor Arduino. :)

I see that you are loading the WAV file in as a binary fine. I think it is two channels at 8 bits per channel. One of the channels must be Audio and you appear to be sending that data to a pin configured for fast PWM. If this is the case, is the .WAV file structured in that 2 channels at 8 bits would mean you read 16 bits and one set of 8 bits in the left and the other the right channel? I follow a lot of what you have written but it's been many years since I messed with C++.

I am just so very impressed with what you have accomplished with that single Arduino.

I had a notion that I would use ram chips as a buffer and dump binary data into them alternating between both so that one could be reading while the other one is being written to. Using TTL chips to control the data lines.
Peter J. Fischel
Mechanical TV Fan, Programmer and Tinkerer.
FlyMario
Mad Scientist
 
Posts: 73
Joined: Sat Sep 22, 2018 11:34 am

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby Andrew Davie » Thu Oct 01, 2020 5:52 pm

FlyMario wrote:I have been reading over your code for this televisor. You are really doing a lot with that poor Arduino. :)


Yes, the poor thing is working rather hard :)

I see that you are loading the WAV file in as a binary fine. I think it is two channels at 8 bits per channel. One of the channels must be Audio and you appear to be sending that data to a pin configured for fast PWM. If this is the case, is the .WAV file structured in that 2 channels at 8 bits would mean you read 16 bits and one set of 8 bits in the left and the other the right channel? I follow a lot of what you have written but it's been many years since I messed with C++.


Yes, that's my recollection of it. I called the format "NBTV8". One channel 8-bit is audio, the other 8-bit video. I'd have to review the code myself to remember more than that! It's loaded into a circular buffer which it tops up as required.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby FlyMario » Thu Oct 08, 2020 4:53 am

So I took your Magic Rays of Light NBTV8 .wav file and exported the left channel (video) to a .csv file to look at in excel. What is apparent is that each line has a 0 as line sync. Once you see the 0, you should read 47 more values for the line.

line.jpg
line.jpg (18.94 KiB) Viewed 10322 times


I was concerned because I was looking at the program FreeNBTV and the information I saw seemed to conflict with my hopes of using two 19,200hz streams for audio and video. I think you must have allotted the bottom two pixels on the frame as sync instead of having an additional sync pulse outside of the visible area. I say two pixels because sometimes I see two 0 values in the visible area. Not sure how I should interpret that. It doesn't matter because as long as I read 48 values per line value everything should be ok.

Looks like FreeNBTV should work great for this.

Anyways... thought I would write this down.
Peter J. Fischel
Mechanical TV Fan, Programmer and Tinkerer.
FlyMario
Mad Scientist
 
Posts: 73
Joined: Sat Sep 22, 2018 11:34 am

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby Andrew Davie » Thu Oct 08, 2020 6:53 am

FlyMario wrote:So I took your Magic Rays of Light NBTV8 .wav file and exported the left channel (video) to a .csv file to look at in excel. What is apparent is that each line has a 0 as line sync. Once you see the 0, you should read 47 more values for the line.


No. This is not correct.
There is NO line synch pulse embedded in the NBTV8 format. What you think you see there is just happenstance, possibly from the original source.
The timing of signals is implicit based on the offset from the start of the file. End-of-story.

I think you must have allotted the bottom two pixels on the frame as sync instead of having an additional sync pulse outside of the visible area. I say two pixels because sometimes I see two 0 values in the visible area. Not sure how I should interpret that. It doesn't matter because as long as I read 48 values per line value everything should be ok.


Again, there is no allocation of any pixels in the frame for anything. It's pure video data, and you can have any value at all there.
Having just woken up, and it being early - I will get back to you if anything changes. But I'm very very sure.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby FlyMario » Thu Oct 08, 2020 7:16 am

Oh, interesting. So you never put any syncs in the video? Wow. I can count exactly 48 pixels for each line going from a value of 0 going forward 48 pixels to find the next 0. Maybe it was something from the original though. That sounds reasonable.

So I get it. Your signals are just a constant stream with no syncs. I had been trying to wrap my head around doing syncs. I guess if you do know the .wav file starts on the first line of the first frame things should be fine just streaming the data. Nice.

Thanks!
Peter J. Fischel
Mechanical TV Fan, Programmer and Tinkerer.
FlyMario
Mad Scientist
 
Posts: 73
Joined: Sat Sep 22, 2018 11:34 am

Re: Andrew Davie's Arduino Televisor by Chris Lewis

Postby Steve Anderson » Thu Oct 08, 2020 12:43 pm

Some years ago I did a similar approach with just a frame sync only. The value of 0x00 was allocated to start of frame (or was it end-of-frame?) the rest (0x01 to 0xFF) was the video. This means you can start playback anywhere in the file and within one frame all is in sync. This was on a CRT-based system, a mechanical one will obviously take a bit longer.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Previous

Return to Construction Diaries

Who is online

Users browsing this forum: No registered users and 3 guests