Shop OBEX P1 Docs P2 Docs Learn Events
Viewport v2 Released! 40Mhz ADC, Video capture, Fuzzy Logic and more — Parallax Forums

Viewport v2 Released! 40Mhz ADC, Video capture, Fuzzy Logic and more

HannoHanno Posts: 1,130
edited 2008-01-27 06:50 in Propeller 1
Viewport v2 is almost ready is finished! Great new features include:
-high speed analog input with a $5 40Mhz ADC
-video capture: up to 240x255 @256 graylevels
-fuzzy logic engine to simplify robotics
-advanced edge/pattern triggers
-simplified user interface

Check out the video:youtube.com/watch?v=-YB5lFfSQC4
Download from http://mydancebot.com
Hanno

Post Edited (Hanno) : 12/21/2007 6:41:18 AM GMT
«1

Comments

  • RaymanRayman Posts: 14,162
    edited 2007-11-30 03:06
    40 Mhz is nice! Any chance of interleaving 2 to get 80 Mhz?
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-30 03:09
    Hanno,

    Looks like your server is a little busy tonight.

    Congrats! Too many goodies to be believed[noparse]:)[/noparse]

    Time to use a little charm on RadioShack. One order and you are off to the races!

    Rich
  • HannoHanno Posts: 1,130
    edited 2007-11-30 03:21
    Rayman,
    The particular ADC I used "only" supports 40Mhz. Viewport and the Propeller support up to 80Mhz- maybe we'll get there soon. The ADC only uses 9 pins, so you could easily use 3 chips which would get you 3 channels of 40Mhz each.

    Rich,
    The youtube link should work... Sorry for being dense- why is it time to charm Radioshack?
    Hanno
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-30 04:10
    You have an amazing product... that uses Parallax hardware. RadioShack and Parallax do business together. RadioShack is in the process of re-defiining itself. They have high end products and services, but they don't have a lock on any market segment except hobby electronics. Your product would give them that lock in hobby robotics.

    If I were you... I would go get some money and offer them kits on consignment.

    Rich
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-30 04:14
    One advantage that you have over Americans is that your Government will sometimes act as a developing partner and allow you to retain control of your own company.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-30 04:15
    Hanno,
    Very impressive demonstration and a nicely done video.
  • HannoHanno Posts: 1,130
    edited 2007-11-30 18:56
    Rich- thanks for the confidence. I would love to have Viewport included in an advanced electronics kit. Component costs are very reasonable: an additional $20 on top of the basic Propeller components gets you an 80Mhz LSA, 40Mhz Analog Oscilloscope, and Video Capture.

    I'm very happy with the Fuzzy Logic Engine- while fuzzy logic is not a silver bullet, it does simplify robotic programming by making the constants more intuitive.

    en.wikipedia.org/wiki/Fuzzy_system

    Instead of using complicated formulas coupled with IF statements for every threshold/exception, fuzzy logic just requires you to specify how variables should be mapped onto classes. For example, 75 degrees is warm, 90' is hot, 50' is cold. PID loops for a motor can be tuned in seconds (video coming at some point), and I came up with a better balancing algorithm that incorporates PID and fuzzy logic for the dancebot. Once fuzzified into classes, the engine supports the standard functions to let you quickly calculate what you need- taking less than a millisecond on the Propeller.

    Once you decide to try out Fuzzy Logic, Viewport gives you the easiest and most powerful interface- and the Propeller provides the ideal hardware.
    Hanno
  • MarkSMarkS Posts: 342
    edited 2007-12-01 04:14
    I've tried to download your program twice, but no luck. Is there a trick to it?
  • HannoHanno Posts: 1,130
    edited 2007-12-01 08:52
    We're still fixing the last bugs in Viewport v2- it should be ready within 2 weeks. Version 1.2- which does not include support for Analog, Fuzzy Logic, or Video Input is available for download at:
    http://mydancebot.com/viewport/download.php
    Some browsers block downloads- we've included a direct link to the file on the final page.
    Hanno
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2007-12-01 14:24
    Hanno said...
    Rich- thanks for the confidence. I would love to have Viewport included in an advanced electronics kit. Component costs are very reasonable: an additional $20 on top of the basic Propeller components gets you an 80Mhz LSA, 40Mhz Analog Oscilloscope, and Video Capture.

    Missed something here... Would you elaborate on these components? Is there a list?

    Thanks
    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just getting started with Propeller?

    Propeller Cookbook

    PropDOS
  • HannoHanno Posts: 1,130
    edited 2007-12-01 20:11
    The camera which allows the Propeller to capture video at 240x240@256 graylevels at 30fps, stream video to the
    Viewport at 240x200x16 grays or download 240x255x256 gray pictures is the:

    "C Cam 2A" available at: www.electronics123.com/s.nl/it.A/id.32/.f?sc=8&category=240

    I use the composite NTSC signal to feed a 40Mhz 8 bit ADC, the "TLC 5540" search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2556291;keywords=TLC%205540

    Viewport can read the Propeller's 32 IO pins at up to 80Mhz.

    A picture is imaged by the camera, converted to NTSC, sampled by the ADC into 8 bits and then read as a digital value by the Propeller. The Viewport TV object running on the Propeller samples the INA port, finds the syncs, and "compresses" the data into a frame which is then sent to the Viewport application.

    My prototype adapter combines the camera and ADC on a board which plugs into the Propeller Demo Board.

    Who wants to build the ADC/camera module for the masses?
    Hanno
  • Harrison.Harrison. Posts: 484
    edited 2007-12-01 21:03
    Can the propeller store the video frames in the hub memory? It seems like the object is only able to run locally in a cog and can only stream images to the Viewport application.

    From what I can see, storing in memory seems possible. I am not sure about the HUB read/write times, but the 240x200x16 gray levels 24KB image should fit...

    EDIT: Woops, I meant 16 gray scales (16 bit would have been obviously too much)... (Thanks Bill)

    Post Edited (Harrison.) : 12/1/2007 9:19:42 PM GMT
  • Bill HenningBill Henning Posts: 6,445
    edited 2007-12-01 21:15
    240x200x16 bits = 96k

    I think you meant 240x200x16 gray scales, which would be 24k
    Harrison. said...
    Can the propeller store the video frames in the hub memory? It seems like the object is only able to run locally in a cog and can only stream images to the Viewport application.

    From what I can see, storing in memory seems possible. I am not sure about the HUB read/write times, but the 240x200x16bit 24KB image should fit...
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • Harrison.Harrison. Posts: 484
    edited 2007-12-01 21:18
    Thanks for the correction Bill. Lack of sleep and bad math skills don't combine well.
  • HannoHanno Posts: 1,130
    edited 2007-12-01 22:05
    Yes, the captured image is stored in main ram as a 24kb array. Other apps can easily interface with it. To stream Video to Viewport, one cog continually updates the 24kb array with image data while another cog transmits the array and other data to the Viewport application. The imaging object has 4 modes- capturing the 200 lines at 4bits/sample, or capturing a third of the frame (85 lines from the top, middle, bottom) at 8bits/sample.
    A huge benefit of the NTSC composite signal is that you DON'T need the whole frame in memory to do visual processing. For simple processing (line finding, blobs...) the processing can be done as the image is being scanned. This is lets you process every pixel of every frame! Currently all of this is only possible for a black/white source- decoding a color stream would require syncing to the color burst and would require much more data.
    Hanno
  • JT CookJT Cook Posts: 487
    edited 2007-12-01 22:17
    One thing that would be interesting to experiment with would be to add and SD card and start dumping frames as quick as possible to an SD card, then write an app for the PC (and prop as well) that would play back the video.
  • Sleazy - GSleazy - G Posts: 79
    edited 2007-12-03 21:02
    im not certain, but·If you are using a 40mhz ADC with the prop, which runs at 80 mhz but only executes hub instructions every 16 clock cycles (pllx16)·, so i think youd only be able to update the digital value at 5mhz.
    Youd be losing 7 of every 8 digital representations of the analog signal it processes.· Am I right about this?· You do have to wait for the hub to cycle to update registers, right?
    ·
  • HannoHanno Posts: 1,130
    edited 2007-12-04 00:30
    Hi Sleazy, (nice name [noparse]:)[/noparse] )
    The Propeller has 8 cogs, each capable of executing 1 simple instruction every 4 clock-cycles. So, a single cog can read the INA port up to 20Mhz- if it's just storing data into the 2kb cog ram. The ViewPort QuickSample object uses up to 4 cogs to sample the INA port at up to 80Mhz- in this case the cogs run interleaved, just like a 4 stroke engine. In the ViewPort video object, multiple samples are taken, combined, and written to global RAM. To read the ADC, Viewport takes up to 1500 samples of the entire 32bits of INA (at up to 80Mhz), transfers the samples to ViewPort, and decodes the digital values into analog.

    And yes, this all works robustly!

    Clear as mud?
    Hanno
  • JonKoppJonKopp Posts: 12
    edited 2007-12-08 10:47
    If I'm wrong please correct me, this is meant as a question.

    If you set up a flip flop running at the 80Mhz clock and ran two of the ADC's, each of their triggers off a separate leg of the flip flop, wouldn't their output be synced to a total of 80Mhz ADC rate? Maybe running thier output through diodes or nor gates?

    I don't know, just a thought. Great work so far!

    I've been tinkering with the notion of video ADC's as o-scope inputs for a while and just found the Propeller a few months ago. You guys are doing amazing things here! I'm trying to design a memory buffer so I can see what just happened. This interlacing prop stuff looks fun though.
  • Michael07Michael07 Posts: 12
    edited 2007-12-11 01:10
    Hi Hanno,

    Great work! I am very interesting in the image processing. Is it hard to put them together for a beginner? I like to work in the smart camera - after capture an image it can tell what is in the image.

    Michael
  • rjo_rjo_ Posts: 1,825
    edited 2007-12-11 01:21
    Hanno,

    Was off transporting kids and wrecking equipment. Missed your post. Awesome. Seeing what seems to be impossible flow so easily from your brain is a true joy.

    Rich
  • HannoHanno Posts: 1,130
    edited 2007-12-12 01:15
    Rich,
    Thanks for the kudos. And no, a lot of this stuff does not "flow easily" from my brain- lots of tinkering and troubleshooting. (I've worn out the F10 key on my keyboard)

    Michael,
    I'm hoping someone on this board will contact me to build the camera boards...
    It took me an hour to solder everything together onto a prototype board.

    It'll be difficult to get the Propeller to "tell what is in the image" - even supercomputers with much more memory can't get close to what the human brain can do. But, experimenting with ViewPort should let hobbyists implement simple Vision algorithms to help robots see.

    JonKopp,
    I believe your suggestion could work... Have a try once ViewPort is released- would be good to get interesting measurements of high frequency signals.
    Maybe you can use ViewPort to see "what just happened"? It lets you view your Propeller's memory over time.

    Hanno
  • Michael07Michael07 Posts: 12
    edited 2007-12-14 17:04
    tongue.gif Hi Hanno,

    Thank you for your opinion about the "smart camera". But with a limit on certain objects and a "grow up propeller" down the road, there could be some possibilities. Anyway, I am a newcomer and need to learn lot more...
    With Viewport V2, do we have to use a propeller demo board?
    I have a propeller educational kit, can I use this kit with Viewport V2?

    Propeller and Viewport are great products for my starting adventure.

    Michael
  • Mike HuseltonMike Huselton Posts: 746
    edited 2007-12-14 17:47
    Brilliant!

    I'm anxiously awaiting the code release - soon?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • HannoHanno Posts: 1,130
    edited 2007-12-14 21:19
    Michael,
    I think the great talent on this board will do many great things with the Propeller- robotic vision included.

    ViewPort v2 works with all Propellers running at 80Mhz. We test on the Protoboard, Education Kit, and Demoboard. V2 now supports 2 baud rates, 2mbps for people using the Parallax USB PropPlug and 115kbps for people using a plain serial port or other configuration.

    Quantum- and others,
    If you promise to leave feedback/comments by private message, you can download a final candidate of ViewPort v2:
    mydancebot.com/setup.exe Remember, this is not the final release- so don't expect perfection and you will have to upgrade to the official v2 when it's released.
    Hanno
  • HannoHanno Posts: 1,130
    edited 2007-12-20 02:26
    ViewPort v2 is officially done!

    Download it here mydancebot.com/viewport/r_download.php

    Hanno

    Post Edited (Hanno) : 12/21/2007 6:36:08 AM GMT
  • Sleazy - GSleazy - G Posts: 79
    edited 2007-12-26 17:13
    So you can·read at 80MSPS to the cog·ram·registers·with 4 interleaved cogs from the INA port. But what·do you do after filling the 496·cog register locations with data?· Youd have to start writing·that data to the hub or send it through·outa port·to a peripheral.·Since you·have to wait 16 clocks·to write to the hub (at best), that leaves·you with 5MSPS of data throughput to the hub. Say you dont want to transfer the data to·the hub, and you want to use the outa port?· All of the cogs outa registers are OR'ed with each other after each hub cycle,·so even if you wanted to skip writing the data into the hub, you still have to wait for all of the·8 cogs·instruction registers to load up (8 clocks min) and then execute·in parallel (8 clocks min), so youre back to 5MSPS throughput.

    So what is the point of sampling at 80MSPS when you can only hold on to 5MSPS of it?·I guess i could see benefits if you never had to write the data to the hub or send it to outa, but then youd probably have to be doing some DSP or thruput functions, since youd·have only 496 samples per cog·buffered before you have to produce a processed result or start dumping the cog·ram due to buffer overflow.· At 80MSPS, there would be only·24uS between the time you sample INA and the time you have to·move the data out of cog ram, that is , if you want to write to your cog·registers·at the speed you read your INA port (80msps), which id prefer.

    Anyone have thoughts on this?
  • HannoHanno Posts: 1,130
    edited 2007-12-27 21:19
    Hi Sleazy,
    ViewPort samples the INA port at 80Mhz and then displays that data like an oscilloscope or logic analyzer would. Those instruments typically cost thousands of dollars.

    ViewPort gives you that power for a much lower price- and is easier to use since you don't have to connect logic probes to anything- typically all the signals you wish to measure are the processors IO pins...

    Each cog takes 360 samples (the remainder of the 496 longs is taken up by the program which will take another sample as soon as the next trigger fires). So, 4 cogs will give you 1440 samples of 32 bits. A sample is taken every 12.5 nanoseconds, so all 1440 measurements are taken in 18 microseconds. At 32 bits/sample, this gives you a datarate of 80Mhz*32bits/sample=

    2.56Gbit/second!

    The limiting factor is the 2mbps connection, this "only" allows ViewPort to render and display a new measurement ~40 times/second.

    Would be interesting to see if other people have different uses for this object...
    Hanno
  • mosquito56mosquito56 Posts: 387
    edited 2007-12-30 05:11
    · Checked out your video, love to get one. Question? How does the program see the pins on the board? How is the program connected to the board? What do I need to buy to use the items in the demo? Is this actually connected to the prop or only a simulator?

    · I have downloaded the program but not installed it. I have the prop hooked thru a usb cable.

    Thanx...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mosquito: An animal which buzzes in your ear and never stops. He may byte you, he may nibble you, but you will know you were bit.


    Technologically challenged individual, Please have pity.
  • HannoHanno Posts: 1,130
    edited 2007-12-30 19:45
    Mosquito-

    ViewPort consists of:
    - a set of Objects you can integrate into Propeller programs and
    - a Windows Application that communicates with the Propeller.

    There are 4 objects:
    - ViewPort Conduit : lets the ViewPort windows application read and write Propeller memory at high speed
    - QuickSample : samples the INA port (which represents the state of the 32 IO pins) at up to 80Mhz
    - Fuzzy Logic Engine : lets you calculate with fuzzy logic
    - Video Capture : captures ntsc video with an 8 bit ADC into a 24KB buffer, which can be streamed to the Windows Application, or used for vision research

    You need a Propeller connected to your Computer to run tutorials 1..6

    (You don't even need a USB connection, ViewPort v2 has a setting under Edit/Preferences that let's you disable the 2mbps baud rate. Doing this will allow you to use a standard serial connection, a very slow computer 100Mhz PC, or even crystals faster/slower than 5mhz)

    All tutorials and objects are documented with items you need, instructions, theory, etc.- just view the spin file.

    The demo is real- nothing is simulated.

    People have taken lots of interesting measurement with ViewPort- check out sample applications here:

    http://mydancebot.com/viewport/applications.php

    Hanno
    Download Viewport
Sign In or Register to comment.