[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 - Automated 360° Turntable Code
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

Automated 360° Turntable Code

Problems, solutions and discussion about scanning with a video projector and stripe patterns.

Re: Automated 360° Turntable Code

Postby gkrywusha » Fri Apr 25, 2014 6:16 pm

Thanks! I'll do that.

Greg
gkrywusha
 
Posts: 69
Joined: Sun Oct 27, 2013 8:41 pm

Re: Automated 360° Turntable Code

Postby MagWeb » Fri Apr 25, 2014 7:15 pm

Just came to my mind:
This hard coded delay means that the code always waits this set time even if you do more, shorter movements

You could add a new variable as "tpr" (time per round) where you set the time the stepper needs to do a full turn.
This devided by the number of scans gives an optimized delay. Make sure that the result of tpr/limit results in an integer value

...
int count = 0; // Variable to count the scans
int limit = 10; // Means the number of scans/round
int StepsPerRound = 20000; // Depends on the stepper's + gear's resolution
int tpr = 6000 // if your stepper needs 6 sec to do a full turn. A rough value + some savety time should be enough. The result of tpr/limit has to be an integer value

...

if (val == '2' && count > 0 && count < limit){
delay(tpr/limit); // Make sure that tpr/limit results in a integer value
Serial.println("S"); // Triggers the next scan when DAVID has sent its "ready" message
}

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

Re: Automated 360° Turntable Code

Postby gkrywusha » Fri Apr 25, 2014 10:41 pm

Interesting. I went and added the other code in. Got a bit better, but might need just a hair more time. I'm going to tweak this, then I'll look into this new code option. The 360 on 10 scans works well. I'm still have an issue fusing a second set of lateral meshes to fill in top holes. But other than that, it's looking good. Thanks again.

G-
gkrywusha
 
Posts: 69
Joined: Sun Oct 27, 2013 8:41 pm

Re: Automated 360° Turntable Code

Postby gkrywusha » Sat Apr 26, 2014 5:38 pm

gkrywusha
 
Posts: 69
Joined: Sun Oct 27, 2013 8:41 pm

Re: Automated 360° Turntable Code

Postby MagWeb » Sat Apr 26, 2014 6:31 pm

:oops: missing dot-colon after " int tpr = 6000;" Sorry

The other errors may be a result of this - hopefully
MagWeb
Moderator
 
Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

Re: Automated 360° Turntable Code

Postby gkrywusha » Sat Apr 26, 2014 9:26 pm

Thanks. I'll try this. Looking pretty good though.
gkrywusha
 
Posts: 69
Joined: Sun Oct 27, 2013 8:41 pm

Re: Automated 360° Turntable Code

Postby Anti » Wed May 14, 2014 5:43 pm

Hi,

any ideas which stepper could be used to turn objects up to 10 kg with a turntable? (It should be controlled using Arduino uno.)

Thanks for recommendations
Anti
Anti
 
Posts: 55
Joined: Sun May 11, 2014 9:20 am

Re: Automated 360° Turntable Code

Postby VDX » Wed May 14, 2014 8:34 pm

... depends on the acceleration you want to apply :wink:

With proper bearings and a 'reducing' timing belt or gearbox a common NEMA-23 stepper should do the job ...

Viktor
VDX
 
Posts: 260
Joined: Wed Jul 04, 2012 1:35 pm

Re: Automated 360° Turntable Code

Postby Anti » Wed May 14, 2014 8:39 pm

Thanks Viktor, I will take a closer look ...
Anti
 
Posts: 55
Joined: Sun May 11, 2014 9:20 am

Re: Automated 360° Turntable Code

Postby WalterMo » Thu May 15, 2014 6:35 am

Anti,

Here I had created a 10kg-turntable (Sept 21, 2013):
viewtopic.php?f=6&t=4291

There are two problems:
1.) The vertical force of the weight must be „carried“.
2.) A 10kg weight has a relative high inertia which must be accelerated and stopped for each motor step. So a gear of cogwheels or a timing belt is necessary. I had used a ratio of 3:1.

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

Re: Automated 360° Turntable Code

Postby Anti » Thu May 15, 2014 8:01 am

Walter,

thank you. I read your post previously but I've thought the turntable would be loaded only up to 1 kg - not ten.

Anti
Anti
 
Posts: 55
Joined: Sun May 11, 2014 9:20 am

Re: Automated 360° Turntable Code

Postby WalterMo » Thu May 15, 2014 8:30 am

There are two turntables in the same thread.

The second with 10kg has a special conical ball bearing. So the stepper's shaft hasn't to carry the load.

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

Re: Automated 360° Turntable Code

Postby VDX » Thu May 15, 2014 9:45 am

... an previous colleaugue used the bearings of a car-wheel without the rim as basis of a turntable with a NEMA23 stepper and timing belt for loads of around 50-120kg (on a chair sitting persons) :wink:

Viktor
VDX
 
Posts: 260
Joined: Wed Jul 04, 2012 1:35 pm

Re: Automated 360° Turntable Code

Postby 3Der » Wed Jan 28, 2015 12:35 am

3Der
 
Posts: 5
Joined: Mon Jul 28, 2014 10:17 pm

Re: Automated 360° Turntable Code

Postby Cedric » Wed Jan 28, 2015 7:24 pm

Hi 3Der,
try this code, it works:
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);

// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);
int val; //Variable to store the content of the COM port
int count = 0; // Variable to count the scans
int limit = 10; // Means the number of scans/round
int StepsPerRound = 20000; // Depends on the stepper's + gear's resolution

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");

AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz

myMotor->setSpeed(200); // 10 rpm
}

void loop() {
if (Serial.available() > 0) {
val = Serial.read(); // read if theres a message in the port and store it in the communication variable
}
if (val == 'T' && count < limit){
myMotor->step(StepsPerRound/limit, FORWARD, SINGLE); //Performs a turntable motion - This is needed for my Adafruit MotorShield on the Arduino
count +=1; //
Serial.println("T ok");
Serial.println(count);

}
if (val == '2' && count > 0 && count < limit){
Serial.println("S"); // Triggers the next scan when DAVID has sent its "ready" message
Serial.println("S ok");
Serial.println(count);
}
if (val == '2' && count == limit){
count = 0; //Just to reset things when you finished a whole round
Serial.println("2 OK");
Serial.println(count);
}
if (val == '1'){
count = 0; //To reset the counter after a faulty try switch to DAVID#s Calibration mode and return to ScanningMode
Serial.println("1 OK");
Serial.println(count);
}
val = 0; // To refresh the COM port input
}

regards
cedric
Cedric
 
Posts: 6
Joined: Wed Jan 14, 2015 7:25 am

PreviousNext

Return to Structured Light Scanning

Who is online

Users browsing this forum: No registered users and 1 guest