[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4807: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3904)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4809: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3904)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4810: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3904)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4811: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3904)
DAVID-Laserscanner Forum • View topic - USB Turntable
Dear DAVID Community,

In 2016, DAVID and this forum have been integrated into HP Inc.
This forum has been read-only since then, and will be switched off by then end of 2019.

To everyone who has contributed here, we thank you for all your work and for the constructive, helpful and friendly atmosphere you have created!
Please continue to discuss on the HP Support Forums.

USB Turntable

What do you think is the best way to control a turntable?

USB
15
88%
Microcontroller
2
12%
Other
0
No votes
 
Total votes : 17

USB Turntable

Postby Bongobat » Sat Jul 18, 2009 2:58 am

Hi,

Recently I built a USB turntable to be used with David. The circuit is based on WalterMo's trigger signal schematic viewtopic.php?f=6&t=1124 and a two wire bipolar stepper driver circuit I found here: http://www.tigoe.net/pcomp/code/categor ... owiring/51 I basically just put the two together and wrote the software to control it. It works simply by toggling the RTS and DTR line of a USB to RS232 Adaptor generating the 2 wire step sequence needed to rotate the motor. The motor is a small NIPPON PF35T-48L4 attached to a window lift mechanism worm drive. The driver chip is a SN754410 H-Bridge capable of delivering up to 1A. The USB to RS232 Adaptor is from DealExtreme. The optocouplers I picked up on Ebay and the rest of the other parts were purchased at radioshack. The turntable is powered by a simple AC/DC unregulated power supply .I use a small 78l05 regulator for the 5V and left the 12 V unregulated to drive the motor.

I have sucessfully used this with my COM signal processing software in a completely automated setup. It easily rotated a 10 lb (4.5 kg) object for scanning and I suspect it can handle more. The PF35T-48L4 has a step angle of 7.5 degrees and the controller can only do full steps but this is okay because the worm drive has 70 teeth giving the table an acceptable rotation speed and lots of torque.

Im sure Ive left something out so feel free to critique, ask questions or suggest improvements to this design.

Greg

EDIT: FIxed missing ground in schematic
EDIT2: Added Visual C++ source files for VisualStudio 2008
Attachments
tablecircuit.jpg
Circuit on radioshack protoboards
tablemotor.jpg
Stepper and window lift mechanism
turntable.zip
Win32 turntable software
(20.43 KiB) Downloaded 338 times
softwareschematic2.jpg
Schematic and software instructions
turntablesource.zip
Visual C++ turntable source files
(13.3 KiB) Downloaded 240 times
DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Re: USB Turntable

Postby WalterMo » Sat Jul 18, 2009 8:32 am

Hi Greg,
It's an impressively solution to control a turntable directly by the PC. So we can save a lot of electronic components.

For some of us it could be a problem to get a stable worm gear. So my suggestion: If the load is less, let's say about maximal 0.5kg (perhaps more) the platform can directly mounted on the motor shaft. But for this case a bigger motor with a shaft diameter of ca. 6 mm should be used. The less
torque because of the saved gear can be compensated by microstepping and/or by a motor with a step angle of 1.8° or 3.6°. We shouldn't forget the inertia.

In your schematic you have forgotten to ground both Emitters of the optocouplers (Pin3).

Thanks

Walter

P.S.:
For the European members of this forum I found two cheap suitable motors with 1.8° at Pollin:
http://www.pollin.de/shop/shop.php

And then click on „Motoren“, „Schrittmotoren“.

For the SANYO DENKI motor they are writing unipolar motor but it has six wires. That means in all likelihood the motor can also be used as a bipolar one. The Shinano STH-56D111 was tested by me. It works in unipolar and bipolar mode.
User avatar
WalterMo
Moderator
 
Posts: 2363
Joined: Mon Apr 02, 2007 6:52 pm
Location: Braunschweig, Germany

Re: USB Turntable

Postby Bongobat » Sun Jul 19, 2009 12:40 am

Attachments
unipolar_stepper.jpg
Simple unipolar 2 wire driver
DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Re: USB Turntable

Postby Bongobat » Sun Jul 19, 2009 12:15 pm

Hi,

I decided to make the unipolar circuit and it worked :!: . I soldered the uln2003 and the 78l05 regulator/capacitors on to the same small protoboard the optocoupler circuit was already placed. Worked perfectly with the same testturntable software.

Greg
Attachments
uln2003circuit.jpg
Uln2003 based USB stepper on small protoboard
uln2003circuit.jpg (46.04 KiB) Viewed 11545 times
DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Re: USB Turntable

Postby WalterMo » Sun Jul 19, 2009 8:27 pm

Hi Greg,
I have just tested your program turntable.exe with my new turntable.

But I have only used the DTR signal of the COM output to get the clock rate for the Markus Mechatronics driver board. The motor was the Shinano STH-56D111 from pollin.de with 1.8° in 1/8 step width mode.
Because your program controls both phases of the ULN2003 the clock rate for my driver was devided by four. So the motor speed was a bit too low. That means for 360° and 6400 preset steps it needs about 3 minutes (delay = 1 (ms)).

It would be nice if you could extend your software with a clock output DTR and a direction output RTS. Then the speed could be increased by a factor of four. :)

The table was loaded with 1.2 kg and no step was missing.

Thanks

Walter
Attachments
Turntable.jpg
Turntable with removed disk (185mm diameter)
User avatar
WalterMo
Moderator
 
Posts: 2363
Joined: Mon Apr 02, 2007 6:52 pm
Location: Braunschweig, Germany

Re: USB Turntable

Postby Bongobat » Mon Jul 20, 2009 12:29 pm

Hi Walter,

I modified the program I am using for automation to suit your scanner. To do full automation you will need to install com0com. http://sourceforge.net/projects/com0com/ Once it is installed it will create 2 virtual ports that are tied to each other. You need to change the name to COM(number) on both ports in the com0com. Something like COM4 and COM5 Just so they look like a real com port. You then need to set up David to use one of the virutal ports to send serial data and then set my program to open the other port. This way when David sends an 'S 'for scan or a 'T' for stop my program will translate that and send a DTR High or Low to the Scanner port ( The USB Adaptor that triggers your scanner) To have David automatically send the 'T' after a scan just turn on the autostop.

You then can set the TurnTable port to your USB adaptor and open it. When you put in a Scan Number in my program and pres the Scan button in David your scanner should start scaning (DTR HIGH) and should stop when david autostops (DTR LOW) It will then send the DTR pulse to turn your turntable the step amount and speed you specify. My program will then send David a command to save the scan and erase it and then the command to start scanning again (S) It will repeat this until it reaches the number of scans you specified.

To just test things you can put in whatever port you want to open and use the Scan and Table buttons on the bottom.

I attached some pictures to better explain things hopefully.

EDIT: Updated the software to fix some bugs hopefully and added a step button

Greg
Attachments
automated.jpg
instructions
com0com.jpg
com0com example
Automatedstep.zip
UPDATE: Automated program for DTR/RTS with STEP BUTTON
(21.93 KiB) Downloaded 293 times
DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Re: USB Turntable

Postby WalterMo » Mon Jul 20, 2009 7:48 pm

Greg,
Thanks for your new program. I have just tested it with my turntable (without comOcom).
DTR for the clock rate and RTS for the direction work.
But I have a problem:
The preset number of table steps is valueless. That means the motor doesn't stop if the number is processed.
And I found:
If the table speed is set to 1 for the very first time my motor needs for 360° (1600 steps) about 3 minutes. Set to 2 or any other number it needs 1 min 6 sec. When I try to set it again to 1 the speed remains at 1min 6sec.
But this speed is OK for my table. Perhaps a little bit faster (if it is possible).

Walter
User avatar
WalterMo
Moderator
 
Posts: 2363
Joined: Mon Apr 02, 2007 6:52 pm
Location: Braunschweig, Germany

Re: USB Turntable

Postby Bongobat » Mon Jul 20, 2009 8:17 pm

DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Re: USB Turntable

Postby Bongobat » Mon Jul 20, 2009 9:50 pm

Hi Walter

I deleted the old version and edited the above post and uploaded the new version there. Please try it out and see if it works better. Here you see the new step button. You should be able to put a number in the Table Steps box, set a Speed and click the step button and it should work. Hopfully :lol:

Greg
Attachments
Step button.jpg
New Step button
Step button.jpg (44.14 KiB) Viewed 11394 times
DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Re: USB Turntable

Postby WalterMo » Tue Jul 21, 2009 12:05 pm

Now it works perfect. Thanks, Greg.

A question regarding the speed (delay):
If it isn't possiple at visual C++ and .net timer to set a delay < 1ms what about letting the PC task some time-consuming mathematical calculations in a FOR-Next-Loop? I know, now the delay would be processor performance depending. But that would be no problem.

Walter
User avatar
WalterMo
Moderator
 
Posts: 2363
Joined: Mon Apr 02, 2007 6:52 pm
Location: Braunschweig, Germany

Re: USB Turntable

Postby Bongobat » Wed Jul 22, 2009 2:10 pm

Hi Walter,

Sven sent me a timer class he wrote that can do Microsecond timming :D

I tried to put it in a little test program. I hope I did everything correctly. I dont have any hardware that will respond to just DTR toggling right now. my easydriver is in my atmega8 controller and I dont want to remove it right now so I can not test the timing for your turntable, but I did not see a speed increase with my DTR/RTS uln2003 driver board. :oops: Maybe you can test this and see if you see a speed increase? It should start up with 0.000001 seconds (1 microsecond) in the numeric up down box. I dont see a speed difference until I put in 0.001 and up though?

Greg
Attachments
TestTimer.zip
Test microsecond timer
(21.67 KiB) Downloaded 286 times
DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Re: USB Turntable

Postby WalterMo » Wed Jul 22, 2009 5:18 pm

Hi Greg,
Now we know it must be a limitting problem of the COM port. I have again measured 1min 6sec for 360° of the table. That means a maximal toggle speed of 24.6Hz.
The only possibility to increase the speed is that I don't use 1/8 step width but ¼. I have tested it and it's OK. Only not so fluently.
Also no step was lost at a 1.2 kg load.

Thanks

Walter

P.S.: The slow COM port might also be the reason for the low motor clock rate during the planeless scanning when synchronisation with the camera frames is used.
User avatar
WalterMo
Moderator
 
Posts: 2363
Joined: Mon Apr 02, 2007 6:52 pm
Location: Braunschweig, Germany

Re: USB Turntable

Postby Bongobat » Tue Jul 28, 2009 2:40 am

Hi,

Walter, On advice from Sven I tried changing the baude rate to see if this had an affect on the speed but I did not see a difference. I think we have to live with this limit.

I am now working on a complete automated system with a USB Light. Perhaps something can be made with a cree LED http://dealextreme.com/details.dx/sku.2394 and another USB adaptor that triggers a LED driver board such as this: http://dealextreme.com/details.dx/sku.7612
These flashlight driver boards dont get very hot and should be easy to build a circuit for.

This also leaves another output pin free that could be used for a laser. So with 3 Adaptor circuits you could have full automation without using microcontrollers. However I still use an atmega8 for laser and laser motor control.

I have written windows software that can control all of this. It will 1. Move the laser to scan the object and retun laser to start position when David autostops 2. Turn on the USB light 3.Tell David to setup cam for texture shot. 4. Grab texture 5. Save scan 6. Turn USB turntable at a user defined angle. 7. Erase texture shot and Depth map and tell David to setup for scan and start scanning all over again untill the number of scans you specify has been completed.

I have a problem though. Davd can not control the SPC900NC parameters :( I thought I could get around this using Wcctrl http://www.burri-web.org/bm98/soft/wcctrl/ I have been using it to quickly change cam settings. The program fully stores all the camera parameters in different slots so they can be called up later. It works great and I was hoping to use the command line to recall scan and texture shot slots durring automation but it seems that portion of the software doesnt work. I have emailed the creator to see if that is a bug but havent heard back yet. Anyone else use the command line with this program and run into this problem?

So now I can not do texture automation right now... unless I buy a pro9000 :roll: Or better yet maybe I can get the windows handle of wcctrl and use sendkeys to change the slots? UGH.

Greg
Attachments
Slingshot.jpg
My new tabbed slingshot automation software
DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Re: USB Turntable

Postby MagWeb » Tue Jul 28, 2009 7:08 am

MagWeb
Moderator
 
Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

Re: USB Turntable

Postby Bongobat » Wed Jul 29, 2009 9:24 pm

Hi,

Gunter, Thanks for the tip on the quickcam for notebooks but I have found a solution for complete automation with texture grabbing using the spc900nc.

The maker of WcCtrl http://www.burri-web.org/bm98/soft/wcctrl/ emailed me back and confirmed there is a bug in the command line part of the software and he is going to let me know when he fixes it and release an upadated version. I am impatient though and hacked a workaround until he fixes the bug

The commad line bug is that no matter what argument for slot you put into the wcctrl command line string the program always opens with slot 1. My solution is as follows:

1. You make copies of the WcCtrl folder and name them something easy to remember like calibrate, scan, texture, etc.
2. You open the WcCtrl program in each of these folders seperately and set slot 1 camera parameters to calibrate, scan, and texture.
3. You make 3 batch files to open up the individual copies like calibrate.bat, scan.bat, and texture.bat. Now when you click on each bat you get the appropriate camera setting.
4. You write in your program to open the texture.bat (camera settings change to texture parameters) at the appropriate time, then close WcCtrl, and then tell david to grab texture shot and open scan.bat (camera settings change to scan parameters) and tell david to scan. You can just make a button to open calibration.bat as I dont think it is necessary to automate calibration settings.

So I did this and it worked great. I now have a fully automated setup with automatic texture grabbing using the SPC900NC. I can just click the scan button in david and watch a movie :!: :D :wink:

The WcCtrl software can control many different types of cameras so if David cant control yours you might see if WcCtrl can.

Greg
DealExtreme red line laser, Microsoft Lifecam HD-5000
User avatar
Bongobat
Moderator
 
Posts: 1002
Joined: Mon Apr 02, 2007 10:02 am
Location: Ohio, USA

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 1 guest

cron