Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers

LPF Donation via Stripe | LPF Donation - Other Methods

Links below open in new window

ArcticMyst Security by Avery

Glitch with my Arduino or OpenLPM?

Joined
Mar 2, 2011
Messages
692
Points
0
When ever I hit 1W with my radiant alpha/arduino uno setup,
I get a small hickup,

What causes this?

PIC:

72479575.jpg


It is worse when the laser output is just above 1W

44062984.jpg


I have checked the raw output with the Arduino serial monitor and it is just like the graphs show, just when it gets to 1000, the output drops to around 600 for a while
 
Last edited:





Trevor

0
Joined
Jul 17, 2009
Messages
4,386
Points
113
Okay; that's a bug going on in the autoranging. It's switching into the high range, but is still reporting as if it were in the low range.

I just rolled in from cutting the grass; I'll grab a drink and come back to look at code. :)

EDIT: Also, please post your configuration settings so I can duplicate the error.

EDIT: ...and if you have data logs of this occurring, that would help a lot.

Trevor
 
Last edited:
Joined
Mar 2, 2011
Messages
692
Points
0
Thanks for the help,
Config and data log below

Code:
0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

0,0

3,3

9,9

14,14

20,20

24,24

30,30

35,35

39,39

44,44

49,49

53,53

58,58

63,63

67,67

72,72

76,76

81,81

85,85

90,90

94,94

98,98

103,103

107,107

111,111

115,115

119,119

123,123

126,126

130,130

133,133

137,137

140,140

144,144

147,147

150,150

154,154

158,158

161,161

165,165

168,168

172,172

175,175

178,178

181,181

185,185

189,189

192,192

195,195

198,198

202,202

205,205

208,208

211,211

215,215

219,219

222,222

225,225

228,228

231,231

234,234

237,237

240,240

244,244

247,247

250,250

253,253

256,256

259,259

262,262

264,264

267,267

269,269

273,273

275,275

278,278

281,281

284,284

288,288

290,290

293,293

296,296

299,299

302,302

305,305

308,308

310,310

313,313

316,316

319,319

322,322

325,325

328,328

331,331

333,333

335,335

338,338

341,341

344,344

347,347

349,349

352,352

354,354

357,357

360,360

362,362

364,364

367,367

369,369

372,372

375,375

377,377

379,379

381,381

384,384

386,386

389,389

391,391

393,393

395,395

398,398

401,401

403,403

405,405

407,407

409,409

411,411

414,414

416,416

419,419

421,421

423,423

425,425

427,427

430,430

432,432

434,434

436,436

438,438

440,440

443,443

445,445

447,447

449,449

451,451

453,453

455,455

458,458

460,460

462,462

464,464

466,466

468,468

470,470

473,473

475,475

477,477

479,479

481,481

483,483

485,485

488,488

490,490

492,492

494,494

496,496

498,498

500,500

502,502

504,504

506,506

508,508

510,510

512,512

514,514

516,516

518,518

520,520

522,522

523,523

525,525

527,527

530,530

531,531

533,533

535,535

536,536

538,538

540,540

542,542

544,544

546,546

548,548

549,549

551,551

553,553

554,554

556,556

559,559

560,560

562,562

564,564

565,565

567,567

568,568

570,570

572,572

574,574

576,576

577,577

579,579

580,580

582,582

584,584

586,586

588,588

589,589

591,591

592,592

594,594

595,595

597,597

599,599

601,601

602,602

604,604

605,605

607,607

608,608

610,610

611,611

613,613

615,615

616,616

618,618

619,619

620,620

622,622

623,623

625,625

626,626

628,628

630,630

631,631

632,632

634,634

635,635

636,636

638,638

639,639

641,641

643,643

644,644

646,646

647,647

648,648

650,650

651,651

652,652

654,654

655,655

657,657

658,658

660,660

661,661

662,662

664,664

665,665

666,666

667,667

668,668

670,670

672,672

673,673

674,674

675,675

676,676

677,677

679,679

680,680

681,681

682,682

684,684

686,686

687,687

688,688

689,689

690,690

692,692

693,693

694,694

695,695

696,696

697,697

699,699

700,700

702,702

703,703

704,704

705,705

706,706

707,707

708,708

710,710

710,710

712,712

713,713

715,715

716,716

717,717

718,718

719,719

720,720

721,721

722,722

723,723

724,724

726,726

727,727

728,728

730,730

731,731

732,732

733,733

734,734

735,735

736,736

737,737

738,738

739,739

740,740

742,742

743,743

744,744

745,745

746,746

747,747

748,748

749,749

750,750

751,751

752,752

752,752

754,754

754,754

756,756

757,757

758,758

759,759

760,760

761,761

762,762

763,763

764,764

765,765

766,766

767,767

768,768

769,769

769,769

771,771

772,772

773,773

773,773

774,774

775,775

776,776

776,776

777,777

778,778

779,779

780,780

781,781

781,781

782,782

783,783

784,784

785,785

786,786

787,787

787,787

788,788

789,789

789,789

790,790

791,791

792,792

793,793

793,793

794,794

795,795

795,795

796,796

797,797

798,798

799,799

800,800

801,801

802,802

802,802

803,803

804,804

804,804

805,805

806,806

807,807

808,808

808,808

809,809

810,810

811,811

811,811

812,812

813,813

814,814

815,815

816,816

817,817

817,817

818,818

818,818

819,819

820,820

821,821

821,821

822,822

823,823

823,823

824,824

825,825

825,825

826,826

827,827

828,828

829,829

830,830

830,830

831,831

832,832

832,832

833,833

834,834

834,834

835,835

836,836

837,837

838,838

838,838

839,839

840,840

840,840

841,841

842,842

843,843

844,844

845,845

845,845

846,846

847,847

848,848

848,848

849,849

850,850

851,851

851,851

852,852

853,853

853,853

854,854

855,855

856,856

857,857

858,858

859,859

859,859

860,860

861,861

862,862

862,862

863,863

864,864

865,865

865,865

866,866

867,867

868,868

869,869

869,869

871,871

872,872

873,873

873,873

874,874

875,875

876,876

877,877

877,877

878,878

879,879

880,880

880,880

881,881

882,882

883,883

883,883

885,885

886,886

886,886

887,887

888,888

889,889

889,889

890,890

891,891

891,891

892,892

893,893

893,893

894,894

894,894

895,895

896,896

896,896

897,897

898,898

899,899

900,900

900,900

901,901

901,901

901,901

902,902

902,902

903,903

903,903

903,903

904,904

904,904

905,905

905,905

905,905

906,906

906,906

906,906

907,907

907,907

907,907

908,908

908,908

909,909

909,909

910,910

910,910

911,911

911,911

911,911

912,912

912,912

912,912

913,913

913,913

914,914

915,915

915,915

915,915

916,916

916,916

916,916

917,917

917,917

918,918

918,918

918,918

918,918

919,919

919,919

920,920

920,920

920,920

920,920

921,921

921,921

922,922

922,922

923,923

923,923

923,923

924,924

924,924

925,925

925,925

925,925

926,926

926,926

926,926

927,927

928,928

928,928

929,929

929,929

929,929

930,930

930,930

930,930

931,931

931,931

931,931

932,932

932,932

932,932

932,932

933,933

933,933

933,933

934,934

934,934

934,934

934,934

935,935

935,935

935,935

935,935

936,936

936,936

936,936

937,937

937,937

937,937

938,938

938,938

938,938

938,938

939,939

939,939

939,939

940,940

940,940

940,940

941,941

941,941

942,942

942,942

943,943

943,943

944,944

944,944

945,945

945,945

946,946

946,946

946,946

947,947

948,948

948,948

948,948

949,949

949,949

950,950

950,950

951,951

951,951

951,951

952,952

952,952

953,953

953,953

954,954

954,954

954,954

955,955

955,955

956,956

956,956

957,957

958,958

958,958

959,959

959,959

959,959

960,960

960,960

960,960

961,961

961,961

961,961

962,962

962,962

963,963

963,963

963,963

964,964

964,964

964,964

965,965

965,965

966,966

966,966

967,967

967,967

967,967

968,968

968,968

968,968

969,969

969,969

970,970

970,970

971,971

972,972

972,972

972,972

973,973

973,973

973,973

974,974

974,974

974,974

975,975

975,975

975,975

976,976

976,976

977,977

977,977

977,977

978,978

978,978

979,979

979,979

979,979

980,980

980,980

980,980

981,981

981,981

982,982

982,982

982,982

982,982

983,983

983,983

984,984

985,985

985,985

986,986

986,986

987,987

987,987

987,987

988,988

988,988

989,989

989,989

989,989

989,989

990,990

990,990

990,990

991,991

925,925

991,991

861,861

992,992

926,926

992,992

992,992

993,993

862,862

928,928

928,928

928,928

929,929

929,929

929,929

929,929

930,930

930,930

996,996

878,878

840,840

771,771

734,734

835,835

678,678

785,785

670,670

618,618

605,605

614,614

548,548

543,543

541,541

537,537

536,536

541,541

535,535

540,540

533,533

530,530

534,534

541,541

530,530

531,531

536,536

538,538

531,531

536,536

542,542

535,535

533,533

536,536

539,539

533,533

536,536

542,542

534,534

535,535

540,540

534,534

537,537

540,540

528,528

538,538

530,530

534,534

541,541

527,527

534,534

544,544

521,521

532,532

526,526

530,530

528,528

529,529

531,531

528,528

533,533

528,528

539,539

527,527

540,540

530,530

543,543

526,526

547,547

552,552

550,550

615,615

620,620

617,617

745,745

679,679

639,639

668,668

679,679

667,667

658,658

739,739

872,872

872,872

872,872

936,936

936,936

936,936

936,936

975,975

913,913

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

937,937

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

983,983

906,906

1001,1001

1001,1001

936,936

936,936

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

872,872

970,970

917,917

956,956

992,992

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1002,1002

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

1001,1001

937,937

937,937

1001,1001

1001,1001

1001,1001

1002,1002

1002,1002

1002,1002

1002,1002

1003,1003

1003,1003

1004,1004

1004,1004

1005,1005

1005,1005

1005,1005

1005,1005

1005,1005

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1006,1006

1007,1007

1007,1007

1007,1007

1008,1008

1008,1008

1009,1009

1009,1009

1010,1010

1010,1010

1010,1010

1010,1010

1010,1010

1010,1010

1010,1010

1010,1010

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1011,1011

1012,1012

1012,1012

1012,1012

1012,1012

1012,1012

1012,1012

1012,1012

1012,1012

1012,1012

1013,1013

1012,1012

1013,1013

1012,1012

1013,1013

1013,1013

1013,1013

1013,1013

1013,1013

1012,1012

1011,1011

1011,1011

1010,1010

1007,1007

1005,1005

874,874

547,547

527,527

541,541

526,526

600,600

932,932

993,993

990,990

986,986

982,982

978,978

975,975

971,971

967,967

964,964

960,960

956,956

953,953

950,950

947,947

943,943

939,939

936,936

933,933

930,930

927,927

923,923

920,920

917,917

913,913

910,910

907,907

904,904

901,901

898,898

894,894

892,892

889,889

886,886

882,882

879,879

877,877

874,874

871,871

868,868

865,865

862,862

860,860

857,857

853,853

851,851

848,848

845,845

843,843

839,839

837,837

834,834

832,832

829,829

826,826

823,823

821,821

818,818

816,816

813,813

810,810

808,808

805,805

803,803

800,800

797,797

794,794

792,792

789,789

787,787

784,784

781,781

779,779

777,777

774,774

772,772

769,769

766,766

764,764

762,762

759,759

757,757

754,754

752,752

750,750

747,747

745,745

743,743

740,740

738,738

736,736

734,734

732,732

730,730

727,727

725,725

723,723

721,721

719,719

716,716

714,714

711,711

709,709

707,707

705,705

703,703

701,701

698,698

695,695

693,693

691,691

690,690

688,688

685,685

683,683

681,681

679,679

677,677

675,675

673,673

670,670

668,668

666,666

664,664

662,662

660,660

658,658

655,655

653,653

651,651

650,650

648,648

646,646

644,644

642,642

639,639

638,638

636,636

634,634

632,632

630,630

628,628

626,626

624,624

622,622

620,620

619,619

617,617

615,615

613,613

611,611

609,609

607,607

606,606

604,604

602,602

601,601

598,598

596,596

595,595

593,593

591,591

590,590

588,588

586,586

584,584

582,582

580,580

579,579

577,577

576,576

574,574

572,572

570,570

568,568

567,567

565,565

564,564

562,562

561,561

559,559

558,558

555,555

554,554

552,552

551,551

549,549

548,548

546,546

545,545

543,543

541,541

540,540

538,538

536,536

535,535

534,534

532,532

531,531

529,529

527,527

526,526

524,524

523,523

521,521

520,520

519,519

517,517

516,516

514,514

513,513

511,511

510,510

508,508

507,507

505,505

504,504

503,503

501,501

500,500

498,498

497,497

495,495

494,494

493,493

491,491

490,490

489,489

488,488

486,486

484,484

483,483

481,481

480,480

479,479

477,477

476,476

475,475

473,473

472,472

471,471

469,469

468,468

466,466

465,465

464,464

463,463

461,461

460,460

459,459

457,457

455,455

454,454

453,453

451,451

450,450

449,449

448,448

447,447

446,446

444,444

443,443

441,441

439,439

438,438

436,436

434,434

433,433

431,431

429,429

427,427

425,425

424,424

422,422

421,421

419,419

417,417

416,416

414,414

412,412

411,411

409,409

408,408

406,406

405,405

403,403

402,402

400,400

398,398

397,397

396,396

395,395

394,394

392,392

391,391

390,390

389,389

388,388

387,387

386,386

384,384

383,383

382,382

381,381

380,380

379,379

378,378

377,377

376,376

375,375

373,373

372,372

371,371

370,370

368,368

367,367

366,366

365,365

364,364

363,363

362,362

361,361

360,360

359,359

358,358

356,356

355,355

354,354

353,353

352,352

351,351

350,350

349,349

348,348

347,347

346,346

345,345

344,344

343,343

342,342

340,340

339,339

338,338

337,337

336,336

334,334

333,333

332,332

331,331

329,329

328,328

326,326

324,324

323,323

322,322

320,320

319,319

317,317

316,316

314,314

312,312

311,311

310,310

308,308

307,307

305,305

304,304

303,303

301,301

300,300

298,298

296,296

295,295

294,294

293,293

291,291

290,290

289,289

288,288

287,287

286,286

285,285

283,283

282,282

282,282

281,281

280,280

279,279

279,279

278,278

277,277

277,277

276,276

275,275

275,275

274,274

273,273

273,273

272,272

271,271

270,270

269,269

268,268

268,268

267,267

266,266

266,266

265,265

264,264

264,264

263,263

262,262

262,262

261,261

260,260

260,260

259,259

258,258

258,258

257,257

256,256

255,255

254,254

254,254

253,253

252,252

252,252

251,251

250,250

249,249

248,248

247,247

246,246

245,245

244,244

243,243

241,241

240,240

239,239

238,238

237,237

235,235

235,235

234,234

233,233

233,233

232,232

231,231

231,231

230,230

229,229

228,228

226,226

226,226

224,224

224,224

223,223

222,222

222,222

221,221

220,220

219,219

219,219

217,217

217,217

216,216

215,215

214,214

213,213

212,212

212,212

211,211

211,211

210,210

210,210

209,209

209,209

208,208

208,208

207,207

206,206

206,206

206,206

205,205

205,205

204,204

204,204

203,203

203,203

202,202

202,202

202,202

201,201

200,200

200,200

199,199

198,198

198,198

197,197

197,197

196,196

196,196

195,195

195,195

195,195

194,194

193,193

193,193

193,193

192,192

192,192

191,191

191,191

190,190

190,190

190,190

189,189

189,189

188,188

188,188

187,187

187,187

186,186

186,186

186,186

185,185

184,184

183,183

183,183

182,182

182,182

181,181

181,181

180,180

180,180

179,179

179,179

179,179

178,178

178,178

177,177

177,177

176,176

176,176

176,176

175,175

175,175

174,174

174,174

174,174

173,173

173,173

173,173

172,172

172,172

171,171

170,170

170,170

169,169

169,169

169,169

168,168

168,168

167,167

167,167

167,167

166,166

166,166

166,166

165,165

165,165

165,165

164,164

164,164

163,163

163,163

163,163

162,162

162,162

161,161

161,161

161,161

160,160

160,160

160,160

159,159

159,159

159,159

158,158

158,158

157,157

157,157

156,156

155,155

155,155

155,155

154,154

154,154

154,154

153,153

153,153

152,152

152,152

152,152

152,152

151,151

151,151

150,150

150,150

150,150

149,149

149,149

149,149

148,148

148,148

148,148

147,147

147,147

147,147

146,146

146,146

146,146

145,145

145,145

145,145

144,144

144,144

Code:
// Version: 0.9.3
 
/*
  The number of samples to take per
  reading output.
 */
#define OVERSAMPLE 256

/*
  The baud rate for serial communication.
  115200 will work with all modern systems.
  
  9600 should work with everything.
 */
#define BAUD 9600

/*
  If left false, the reference voltage will autorange
  between 1.1V and 5V for maximum precision.  If set to
  true, the external reference voltage will be used.
  
  Reference: http://arduino.cc/en/Reference/AnalogReference
 */
#define REFERENCE_OVERRIDE false

/*
  If using an external voltage reference,
  define it here in millivolts.
 */
double Vref = 1100;

/*
  Volts per watt ratio.
  
  Surplus Ophir sensors output 1V/W.
 */
const double VoltsPerWatt = 1.0;

/*
  The pin that the signal is coming in from.
 */
#define SENSOR 1

/*
  Buffer size.
  
  The Arduino has extremely limited memory;
  be careful when modifying this value.
  
  Default is 64 and should never need to change.
 */
#define BUFFER_SIZE 64

/*
  Data output mode.  In default mode, the output
  will be compatible with Luminosity.
  
  0 = Default
  1 = Custom
 */
#define STREAM_MODE 1

/*
  Custom Datastream Formatting
  
  $w = whole number
  $f = number after the decimal point
  
  Default / Luminosity
    "$w.$f\n"
 */
char DATASTREAM_FORMAT[BUFFER_SIZE] = "\r$w,$w\n";

/*
  Number of decimal places.
  
  Usage beyond 1-2 will clog your datastream
  and not be useful.
 */
#define PRECISION 0

/*
  EU Compatibility
  
  All this does is puts a comma in place of a period
  for the default datastream format.
 */
#define EU 0
 
Last edited:

Trevor

0
Joined
Jul 17, 2009
Messages
4,386
Points
113
Maybe it's because the EagleEye software was designed for
LaserBee Products.....

This would solve your problems.....


Jerry

If you don't want me to push my open-source projects in your sales threads, then don't peddle your products in threads pertaining to my open-source projects.

@justinjja - I think I've figured out what's going on - just an issue of the switch from the internal 1.1V voltage reference up to the 5V reference. Working on a fix. :)

Trevor
 
Last edited:
Joined
Sep 20, 2008
Messages
17,622
Points
113
If you don't want me to push my open-source projects in your sales threads, then don't peddle your products in threads pertaining to my open-source projects.

Trevor

Touch a nerve did we.....

The OP had an obvious problem with a glitch in his Arduinio
project using our EagleEye Data Logging Software Exclusively
bundled with our LaserBee LPM products...
We simply pointed out a solution to his problem...

You sound like you are loosing $$$$ on your FREE Open Source
project... Am I missing something.....:thinking:

I would have thought you would be more open to having
more options available for LPM users as you have touted
in the past...


Jerry
 
Last edited:

Trevor

0
Joined
Jul 17, 2009
Messages
4,386
Points
113
Touch a nerve did we.....

The OP had an obvious problem with a glitch in his Arduinio
project using our EagleEye Data Logging Software Exclusively
bundled with our LaserBee LPM products...
We simply pointed out a solution to his problem...

You sound like you are loosing $$$$ on your FREE Open Source
project... Am I missing something.....:thinking:

Jerry

So, is this an invitation to propose my open-source projects as solutions to people's problems in your sales threads? I know that would make you angry beyond words, but you are perfectly happy to peddle your trinkets here. Just saying.

Your attempts to squash open-source projects are blatantly obvious. It might seem subtle when you're pasting links sitting at your keyboard, but it isn't. I don't even know what you have against it - it's not like it poses a threat to you at all. A single college student stressing a registered Canadian company? Hogwash!

And yes, I am losing money. But you have to remember, not all of us are here just for the money. ;)

But I'm glad you endorse my projects at the end of the day. But I have one question for you... are you ready for me to kick it up a notch?

Trevor
 
Joined
Mar 2, 2011
Messages
692
Points
0
Ha ha, lol at you two.
Open Source FTW!!

Not sure what significance the 931 in this line has:
if( reference == 0 && sampledValue > 931 )
but changing it to 1000 appears to fix the problem.

Hopefully I'm NOT about to kill my Arduino by doing this...

laserdescription2.png
 
Last edited:

Trevor

0
Joined
Jul 17, 2009
Messages
4,386
Points
113
Okay, so something that I had forgotten about when I was writing OpenLPM was the fact that the ADC will need about 5.6us to settle when you change the voltage reference.

When I looked through my logic, everything checked out. So, in an effort to remove variables that are in play here, here's a build that accounts for this settling behavior.

http://raptureinnovations.com/OpenLPM/Beta/OpenLPM_Mk_I_Beta_0_9_3_1A.zip

Now, there is one caveat with this build that will be solved once the problem is isolated. The sample rate might slow down as you cross the 1W threshold. The reason for this is that 1V is the point where the range shift happens - going in both directions. So if the ADC is varying at 1LSB, it voltage reference might be quickly updated and the sample rate will slow down.

This can be solved by changing the threshold so that it is different depending on whether the reading is rising or falling.

EDIT: That is the 1V threshold I referred to above. ( 931 / 1023 ) * 1100 = 1V.

Trevor
 
Last edited:
Joined
Jul 27, 2007
Messages
3,642
Points
63
So you're running an Alpha with an Arduino with Laserbee software? Haha awesome man, that's fantastic :)
 
Last edited:

Trevor

0
Joined
Jul 17, 2009
Messages
4,386
Points
113
Thanks, new code is up and running, no glitches at 1W

Okay. Cool. Basically, the problem was that the Vref was oscillating and being all like "OHGODPLEASEHELPWHATAREYOUDOINGMAKEUPYOURDAMNMIND!"

I'll update the thresholds and upload a new build in the release thread.

Thanks for bringing this up! The project wouldn't work if people didn't point out bugs for me to fix. :D

EDIT: System won't let me rep you. :(

Trevor
 
Last edited:





Top