Free mouse alternative for CineCap

Forum covering all aspects of small gauge cinematography! This is the main discussion forum.

Moderator: Andreas Wideroe

RCBasher
Posts: 456
Joined: Thu Jan 11, 2007 9:27 am
Location: UK
Contact:

Post by RCBasher »

MovieStuff wrote:
RCBasher wrote: If this is going to be a problem, I'll add a small debounce in software.
That is highly recommended or you'll go nuts with a mechanical switch closure. The mouse circuit has anti-bounce built in but the serial port will see almost the thought of connection as a completed circuit. Just have the software look for the intial transistion and nothing else for a predetermined interval to get clear of the contact.

Roger
Yep, I can do that...any idea approximately how long those switches bounce for? Is it just switch bounce, or is the mechanical pressing of the switch by film pressure causing a long frazzling between on/off states? I could wait a relatively long time...like several ms (I think you said in a previous post that the mouse debounce is 8.5ms). I guess if I use a similar delay then this would match the mouse version phasing and setup :)
User avatar
MovieStuff
Posts: 6135
Joined: Wed May 01, 2002 1:07 am
Real name: Roger Evans
Location: Kerrville, Texas
Contact:

Post by MovieStuff »

RCBasher wrote:
MovieStuff wrote:
RCBasher wrote: If this is going to be a problem, I'll add a small debounce in software.
That is highly recommended or you'll go nuts with a mechanical switch closure. The mouse circuit has anti-bounce built in but the serial port will see almost the thought of connection as a completed circuit. Just have the software look for the intial transistion and nothing else for a predetermined interval to get clear of the contact.

Roger
Yep, I can do that...any idea approximately how long those switches bounce for? Is it just switch bounce, or is the mechanical pressing of the switch by film pressure causing a long frazzling between on/off states? I could wait a relatively long time...like several ms (I think you said in a previous post that the mouse debounce is 8.5ms). I guess if I use a similar delay then this would match the mouse version phasing and setup :)
I never stated a mouse debounce time. I said that the max speed we have found to capture in an asynchronous mode with the video camera is about 8.5fps. That isn't the limit of what the mouse can do, probably, but it does seem to plateau out in terms of what the mouse might ignore and also having enough clear field pairs to work with in the stream at 1/60th of a second (less if at 1/50th of a second for the same speed in PAL, remember). Raising the shutter speed to above 1/500th of a second can gain you some real estate in terms of avoiding pulldown blur but you still have the possibility of the mouse ignoring the commands at a higher FPS rate, depending on what computer it is on (we have one that can register 12+fps and another that can't go above 9fps).

I recommend setting the wait time as long as you can for the maximum speed you think you'll be capturing at. I think the amount of bounce should really be about the same regardless of speed so it should work for slower speeds as well.

Roger
RCBasher
Posts: 456
Joined: Thu Jan 11, 2007 9:27 am
Location: UK
Contact:

Post by RCBasher »

Yes, you did say:
MovieStuff wrote:A PS2 mouse circuit is fast enough to respond up to about 8.5 mouse clicks per second using a simple micro switch. Any faster and you run into two problems. One is that the anti-bounce circuitry inherent in the mouse path will ignore commands too close to together.
sorry, I remembered it as 8.5 ms for some reason - my recall is clearly failing with age :(

A quick calculation suggests that allowing for running asynchronously and the 1/500 exposure gives a maximum of 20fps with NTSC and hence a debounce time of up to 50ms will not be a limiting factor at the normally much lower speeds. That should be more than plenty of debounce time!

Still think an optical switch is the way to go though.... :wink:

Thanks for your help,
Frank
User avatar
MovieStuff
Posts: 6135
Joined: Wed May 01, 2002 1:07 am
Real name: Roger Evans
Location: Kerrville, Texas
Contact:

Post by MovieStuff »

RCBasher wrote:Yes, you did say:
MovieStuff wrote:A PS2 mouse circuit is fast enough to respond up to about 8.5 mouse clicks per second using a simple micro switch. Any faster and you run into two problems. One is that the anti-bounce circuitry inherent in the mouse path will ignore commands too close to together.
sorry, I remembered it as 8.5 ms for some reason - my recall is clearly failing with age :(

A quick calculation suggests that allowing for running asynchronously and the 1/500 exposure gives a maximum of 20fps with NTSC and hence a debounce time of up to 50ms will not be a limiting factor at the normally much lower speeds. That should be more than plenty of debounce time!

Still think an optical switch is the way to go though.... :wink:
Oh it's necessity if you are going to run faster than 8.5fps, really. We are currently doing 20fps tests but are using an optical switch as well. A mechanical switch would wear out in no time at that speed, even if it did start out accurate and readable.

RCBasher wrote: Thanks for your help,
Frank
My pleasure.

Roger
RCBasher
Posts: 456
Joined: Thu Jan 11, 2007 9:27 am
Location: UK
Contact:

Post by RCBasher »

Hi Again,

Ok, I made a change to the program following a report from Thomas that the program was reading x2 fps...possibly due to switch bounce.

Here's a complete new upload http://www.cfav.co.uk/misc/downloads/TIC.zip

For those of you who have already downloaded and installed, then here is a new executable which you can download, unzip and save over the installed GrabFrame.exe file which you will find in c:/program files/TIC folder for a default installation. http://www.cfav.co.uk/misc/downloads/GrabeFrame.zip

:arrow: :arrow: ONE IMPORTANT CHANGE: The program now uses pin 2 (RD) for input instead of pin 8 (CTS). All other connections remain the same.

It now looks different:

Image

Edge detection option has been removed as no longer required.

Hope it is ok now!
Frank
tbruegg
Posts: 94
Joined: Thu Dec 04, 2003 5:11 pm
Location: switzerland
Contact:

Post by tbruegg »

Wow, you are really into it! :)
just downloaded the new exe file, will report as soon as i find time.

thanks, Thomas
RCBasher
Posts: 456
Joined: Thu Jan 11, 2007 9:27 am
Location: UK
Contact:

Post by RCBasher »

OK, just to be extra nice :wink: I've added user selectable debounce:

Image

Note: whatever debounce is selected will result in a corresponding additional delay to the user setable delay before sending out a trigger to the capture program. Just wind back your delay setting to compensate.

Download as the complete install or an exe upgrade as per my previous post.

No more programming for today...I'm off to pay my first visit to Widescreen then on to the London Model Engineering show at Alexandra Palace to buy some new tools for my lathe :) Could be an expensive day out!

Frank
tbruegg
Posts: 94
Joined: Thu Dec 04, 2003 5:11 pm
Location: switzerland
Contact:

Post by tbruegg »

Hello Frank, i hope you found the tools :)

Tested the new version. There are doubled frames and framedrops at free will in the capture, theres no pattern to it. i have tested different Bounce-dealays the faster times seem to work better. The fps display is not steady, it always searches, but it finds the right speed. maybe someone else can also test it.

Thanks, Thomas
RCBasher
Posts: 456
Joined: Thu Jan 11, 2007 9:27 am
Location: UK
Contact:

Post by RCBasher »

tbruegg wrote: Tested the new version. There are doubled frames and framedrops at free will in the capture, theres no pattern to it. i have tested different Bounce-dealays the faster times seem to work better. The fps display is not steady, it always searches, but it finds the right speed. maybe someone else can also test it.

Thanks, Thomas
Hi Thomas. Very sorry it didn't work for you but thank you for your feedback. I have to say I'm rather puzzled! How did you wire it up in the end...I assume you are not trying to run it at the same time as the mouse? Unfortunately, I do not have a microswitch set up and can't see how to fit one on my projector as the loops are in free air. Works 100% fine with an optical switch...but that doesn't help you.

If I make a special version that sends time stamps to a log file, would you be prepared to run it and send me the file back?

Regards,
Frank
tbruegg
Posts: 94
Joined: Thu Dec 04, 2003 5:11 pm
Location: switzerland
Contact:

Post by tbruegg »

Very sorry it didn't work for you
no problemo, the delay feature would be a big help for me. but since not too many seem to be interested, i wonder if you should really put in more time in solving this. but im happy if you do :) .
How did you wire it up in the end...I assume you are not trying to run it at the same time as the mouse?
hehe, yes that would be a good explenation for what happens. but no i take the signal from the microswitch to pin 2 and 7 on the com port directly, i use a female/mal serial cable that i solder the t cables to the pins. i have a usb mouse for normal mouse work, the modified mouse normally is on the ps2 port, but for tests it was not there and there was no microswitch signal on the mouse either. the pc is very new core2 with 2gb Ram, and a raid system capeable of writing 200MB/s so the specs of the pc should not cause the problem.

there are two things you mentioned that i did not try yet. the 3k3 resistor and change the wiring on the microswitch. do you think its worth trying?
If I make a special version that sends time stamps to a log file, would you be prepared to run it and send me the file back?
yes shure!

Thomas
RCBasher
Posts: 456
Joined: Thu Jan 11, 2007 9:27 am
Location: UK
Contact:

Post by RCBasher »

tbruegg wrote:
Very sorry it didn't work for you
no problemo, the delay feature would be a big help for me. but since not too many seem to be interested, i wonder if you should really put in more time in solving this. but im happy if you do :)
I happy to put a bit more effort into it...for the moment! If anyone else has tried it, some feedback (good or bad) would be appreciated?
tbruegg wrote:...i take the signal from the microswitch to pin 2 and 7 on the com port directly, i use a female/mal serial cable that i solder the t cables to the pins

I guess you checked the type of cable (cross-over or straight through) as pin numbering will be different in a crossover cable?
tbruegg wrote:...there are two things you mentioned that i did not try yet. the 3k3 resistor and change the wiring on the microswitch. do you think its worth trying?
Most definately. Although sometimes it works, allowing the input line to just float is probably a bad idea...I now regret suggesting it as a possibilty :oops:

The easiest and most positive way to wire it up is to connect the microswitch centre pole (might not be physically the centre terminal!) to pin 2 (RD) and the other two teminals to pins 7 (RTS) and 3 (TD). Now, depending on the on/off ratio of the switch, it may also be worth swapping the two ends over.

May I ask at what speed is your projector nominally running at? Out of interest, is this a telecine machine you have built yourself?
tbruegg wrote:
If I make a special version that sends time stamps to a log file, would you be prepared to run it and send me the file back?
yes shure!

Thomas
Please try the wiring first and also, just run my program without running CineCap (or checking the Capture box) to see if you get a stable display of frame rate.

Good luck and I hope we can get this sorted for you.
Frank
RCBasher
Posts: 456
Joined: Thu Jan 11, 2007 9:27 am
Location: UK
Contact:

Post by RCBasher »

tbruegg wrote:....Bounce-dealays the faster times seem to work better. The fps display is not steady, it always searches, but it finds the right speed. maybe someone else can also test it.
Hi Thomas, I just noticed something...I was obviously in too much of a hurry to post the user-setable delay feature before I went out for the day...there's a bug! :oops:
The new debounce setting will not 'take' until the program is exited and restarted.

Sorry, will do an updated version...but first I'm also looking at something else that might be a problem. If the microswitch's on/off period is closer to 50:50 and let's say you are running at 5 fps then I might be seeing both edges of the switch (opening and closing) as separate events. On my optical switch setup, I only get a very short pulse. So for the moment, best to put the debounce setting at 128ms. This still might not be enough, so I'm looking at a different way of doing now.
Cheers,
Frank
RCBasher
Posts: 456
Joined: Thu Jan 11, 2007 9:27 am
Location: UK
Contact:

Post by RCBasher »

Hi Thomas,
RCBasher wrote:So for the moment, best to put the debounce setting at 128ms.
Don't bother with this setting...it will not work and will throw an error. There's a limitation in the Microsoft control DLL that won't let me set 75 baud...which I can set through the Control Panel properties. Best to park this to one side (if you haven't already!) until I sort this out for all eventualities.
Frank
mattias
Posts: 8356
Joined: Wed May 15, 2002 1:31 pm
Location: Gubbängen, Stockholm, Sweden
Contact:

Post by mattias »

MovieStuff wrote:We are currently doing 20fps tests
isn't 15fps for ntsc and 12.5 for pal the maximum rate possible? i mean there are as many pulldowns as discrete frames, and all frames showing the pulldown have to be discarded. and since it's not crystal my educated guess says that you have to allow one more frame per cycle as well because of the shifting phase, giving you 10 for ntsc and 8.33 for pal. i guess using a 60p machine vision camera changes that though...

/matt
tbruegg
Posts: 94
Joined: Thu Dec 04, 2003 5:11 pm
Location: switzerland
Contact:

Post by tbruegg »

Hello Frank

I think did not get the wiring stuff, i have to get back to you when im ready to try that.
May I ask at what speed is your projector nominally running at? Out of interest, is this a telecine machine you have built yourself?
yes i built it myself based on the workprinter basics. it can run from 2 to 12 fps, it's not synced, normally i have it running at about 4-5 fps.
The new debounce setting will not 'take' until the program is exited and restarted.
hmm thats strange, when i changed it to 128 it there was nearly no frames captured, there was a sudden change to the previous setting.
what about this, i pm you a picture of the microswitch im using and you tell me exactly which cable should be soldered to which pin on the port, i have no deeper knowledge of electronics, so this way you would know exactly that the cabling is right :)

Thomas
Post Reply