Dear DAVID Community,

As you are probably aware, the entire DAVID company, team and product range has been integrated into HP Inc.
This forum is now read-only. Relevant content has been migrated to HP and merged into HP's Support Forums on November 1, 2016.

To start new discussions for 3D Scanning, please register and post your new topic at the HP Support Forums

Not sure about signals

Questions, problems, comments and tips regarding the 3d scanning process.

Not sure about signals

Postby doi » Thu Feb 11, 2010 10:01 pm

Hi,

I have scanned a bit by hand but need to scan objects that can not be moved. So the conclusion was that I need an automated setup, and started building it. Which resulted in a controller (PIC-based) > driving a stepper motor > turning a gear > which turns the laser. Now the question is: how do I sync David's scanning with the laser motion?

What I think the best solution would be is a loop like this: David analyzes a picture, laser moves a bit.

After looking around a bit I think that it should translate into the following:
:start
I click on start > David sends StartScanning or StartScanningRepetition

:loop
David starts analyzing an image > David sends AnalyzeImage
motor moves the laser during the MinDelayBetweenFrames time
if i click to stop the scan > David sends StopScanning > goto :end
goto :loop

:end
motor resets start position of laser

Am I right?

Now another question: is there a way to optimize this? Meaning I do not want to use the MinDelayBetweenFrames but instead maybe send a signal from the controller to David when the laser motion is completed so David would start analyzing the frame. Then David would send a signal so the controller could move the laser again. And repeat.

I have looked on the forum and the wiki, but somehow I can not get to understand if this is possible or not. There are many threads about this and I can not seem to be able to compile all that information into what I need.
Dan

Logitech 9000 / Red laser bought on ebay / core duo laptop
doi
 
Posts: 1
Joined: Thu Feb 11, 2010 9:31 pm
Location: Timisoara / Romania

Re: Not sure about signals

Postby swizzlee » Thu Oct 04, 2012 9:32 am

Hi,
I have the same problem, and I am wondering why isn't it discussed on the forum or somewhere else. I was looking for a solution or a howto without any success.
I am curently using the 3.4.0 Version of David 3D and I would like to do panel-less scans with synchronized camera and motor movements.
After analyzing David 3D's communication on the serial connection it seems that David 3D can send a signal when it begins to analyse a camera image, which can be used to initiate a step for the stepper motor, but on the other hand there is no possibility - or at least I am not aware of that - for the motor to send a message back to David 3D that it successfully executed the step and the next image can be processed.
If David 3D is working at 30FPS and sending step commands to the motor at this rate the motor can not follow it and stays in the same position through several images, which is probably detected as a failure. Or at least I think, since after the motor calibration process David stops shortly after starting the normal scan.
Isn't there an option to issue a signal when the motor step is completed and tell David to wait with the image processing till the signal from the motor is issued?
swizzlee
 
Posts: 4
Joined: Wed Oct 03, 2012 3:07 pm

Re: Not sure about signals

Postby WalterMo » Thu Oct 04, 2012 11:04 am

Hi,
When doi posted above his wishes on 11 February 2010 we had not yet published the "Laser Scanner for Planeless Scanning":
viewtopic.php?f=6&t=2421

Sven's Katie software is using the synchronisation of the captured camera frames and the stepping motor steps.
The speed of the motor can be varied by you but is still synchronized to the cam frames. At highest speed one frame corresponds to one motor step. For lower scan speeds: E.g. 5 cam frames for each motor step.

Was this your question?

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

Re: Not sure about signals

Postby swizzlee » Thu Oct 04, 2012 2:11 pm

Dear Walter,
Thank you for the quick reply. I am aware of the referred topic and also the Katie software, I am currently using a modified version (I commented out the display and the input buttons functionality). What I am missing is the communication in the direction Arduino to David 3D. So if I have a very slow motor (let's say 1 step / second) will the David 3D software know that the 30 images taken (assuming 30 FPS) during the 1 second all belong to the same step?

My problem is, when I start the plane-less calibration the motor begins to move the laser till the edge of the calibration corner, then I push the stop button, the image processing stops but the motor still makes several (usually more than 10-20) steps (probably the input is buffered and the motor need to process the move commands after the stop). When I want to start the measurement the motor makes 1-2 steps and David 3D stops the process due to some Automatic Stop.
swizzlee
 
Posts: 4
Joined: Wed Oct 03, 2012 3:07 pm

Re: Not sure about signals

Postby WalterMo » Thu Oct 04, 2012 4:18 pm

swizzlee wrote:What I am missing is the communication in the direction Arduino to David 3D. So if I have a very slow motor (let's say 1 step / second) will the David 3D software know that the 30 images taken (assuming 30 FPS) during the 1 second all belong to the same step?

That's no problem. If I remember well (so Sven told me?) only one frame of the 30 will be used by DAVID because the 29 remaining have the very same information. Or another example, some guys have a 64:1 gear at the motor (like me), others a 100:1 (or a higher ratio). That's no problem, DAVID will use only that frame which has another information as that before.
swizzlee wrote:My problem is, when I start the plane-less calibration the motor begins to move the laser till the edge of the calibration corner, then I push the stop button, the image processing stops but the motor still makes several (usually more than 10-20) steps (probably the input is buffered and the motor need to process the move commands after the stop). When I want to start the measurement the motor makes 1-2 steps and David 3D stops the process due to some Automatic Stop.

If using the Katie software the motor immediately stops when the stop button was pushed. Then the motor automatically precisely returns to the start position by overrun it a bit, stops, changing direction and then slowly approaches the start position. This procedure is made to eliminate a backlash.

Give the original Katie a try. :wink:
X70GHY
User avatar
WalterMo
Moderator
 
Posts: 2363
Joined: Mon Apr 02, 2007 6:52 pm
Location: Braunschweig, Germany

Re: Not sure about signals

Postby Sven » Fri Oct 05, 2012 9:48 am

Hello,

Sorry there seem to be some misunderstandings here, let me clarify:

- DAVID will scan using every camera image it can get, as fast as the computer can. DAVID will send "move" messages over COM with the same speed. DAVID will not wait for a reply.
- If the stepper motor (the Arduino program) does not process the Move commands quickly enough, DAVID will not realize that. As you have presumed, there is an input buffer in Arduino, which will collect the messages, that's why your motor keeps running even after "Stop". It keeps reading and processing all Move messages from the buffer before reaching the Stop message. However you should avoid this. I don't know how large the input buffer is.
- The "Motor Speed" setting determines the number of motor steps for each camera frame. By default, the value is sent as part of the Move message (that is the %1 in m%1;).
- If I remember correctly, there is no way to move slower than one step per camera frame. If this is necessary, you will have to implement that in your Arduino code (e.g. count the incoming Move commands and process only 1 out of 5).
- You could also limit DAVID's speed by selecting a slower Frame Rate (FPS) in the camera settings. But I think that does not make much sense.
- DAVID does not detect whether the laser is moving or not. If it is not moving, DAVID will still process the image, and (ideally) compute the same depth values over and over again. This is not a problem. In the real world, no two frames are identical (image noise), so it can even be an advantage to move so slow that DAVID can average the results from several "identical" frames.
- AutoStop: Can happen when no more scan data are coming in. Usually that only happens when the laser moves out of view. Also it auto-stops when the end of the Reference Scan range has been reached. You can switch off AutoStop in The Advanced Settings -> Laserscanning -> Motorscanning.

The whole Motorscanning feature is meant to be used with an Arduino/stepper motor that can keep pace, i.e. can move with the same speed. Why is your hardware so slow? 30 steps/s should not be a problem...?
Whatever you do, the process must be reproducible. If your motor runs slower or misses steps, that is OK but only if the exact same thing happens during "Record New Motion" and all further repetition scans! Otherwise the scans will be distorted and/or have strong waves.

I think the whole process will only work fine if all components have some "spare time". The camera should dictate the speed, be the clock. The computer should be able to process all camera frames without 100% CPU load. The Arduino should be able to process all Messages immediately, and idle inbetween. The stepper motor should be able to make all steps, not lose any.
Otherwise I think there will be problems that are irregular and not reproducible. That's ok for normal scanning with background, but not for planeless scanning.

(The communication direction from Arduino to DAVID is also possible, but I think it should not be mixed with the other direction. If you choose the Arduino->DAVID direction, you can use the "Commands" that you can find in the Advanced Settings->Communication->COM. They do NOT include a frame synchronization, just Start and Stop.
The direction DAVID->Arduino is called "Messages", the other direction is called "Commands".)

I hope I did not mix anything up, I haven't worked with the motor scanner for some time... Walter please let me know if I'm mistaken!

Sven
User avatar
Sven
DAVID Developer
 
Posts: 1541
Joined: Mon Jan 22, 2007 8:59 am
Location: Braunschweig, Germany

Re: Not sure about signals

Postby swizzlee » Fri Oct 05, 2012 11:32 am

Hi Walter and Sven,
Thanks for your exhausting and detailed answers, they helped me much.
Originally, I chose to use a lower (1rpm) motor speed to reduce the vibrations occuring at the end of steps when the laser is stopped suddenly. Now I turned up the motor speed a bit to 5rpm where the vibrations are not disturbing but the motor can keep up the pace with the rest of the system. I also chose an inverse: bottom to up scanning direction, it also helps with the motor vibrations and coging. It is working now. I just need to tune the system a bit to have smoother results with less holes in it, but it will work.
Thank you for your help!
swizzlee
 
Posts: 4
Joined: Wed Oct 03, 2012 3:07 pm


Return to 3D Laser Scanning

Who is online

Users browsing this forum: No registered users and 2 guests

cron