Wiznet makers

norths

Published October 27, 2022 © Apache License 2.0 (Apache-2.0)

0 UCC

0 VAR

1 Contests

0 Followers

0 Following

Laser Scripter

Laser Scripter is Remote controlled Laser engraver to print script on card. The contend is controlled by mobile or remote computer.

COMPONENTS Hardware components

WIZnet - WizFi360-EVB-Pico

x 1


Arduino - Arduino MotorShield Rev3

x 1


seeed - Gear Stepper Motor Driver Pack

x 1

Software Apps and online services

Arduino - Arduino IDE

x 1


PROJECT DESCRIPTION

1 Laser Scripter is Remote controlled Laser engraver to print script on card. The contend is controlled by mobile or remote computer.

2 Install Board Support for Arduino IDE 2.0 and Connect WizFi360 Board

3 Install and run LaserGBRL

4 Porting the GBRL library for Arduino

There has been library for Arduino AVR board only, I have port the drive to Wizfi360 in VS code

The full code is attached in zip file 

The code is complete in structure for G-code which is used for robot arm control and 3D engraver or laserEnscriptor, this is fully functional project.

And verify and upload to the board successfully

This time, I use the UART port only, in fact the wifi is test and better for LaserGRBL control over the air.

Core of the program is as follows to control the laser engraver in loop

#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "config.h"
#include "nuts_bolts.h"
#include "settings.h"
#include "planner.h"
#include "stepper.h"
#include "spindle_control.h"
#include "coolant_control.h"
#include "motion_control.h"
#include "gcode.h"
#include "protocol.h"
#include "limits.h"
#include "serial.h"
#include "report.h"

// Declare system global variable structure
system_t sys; 

int startGrbl(void)
{
  serial_init(); 
  st_init(); // Setup stepper pins and interrupt timers
  
  memset(&sys, 0, sizeof(sys));  // Clear all system variables
  sys.abort = true;   // Set abort to complete initialization
  sys.state = STATE_INIT;  // Set alarm state to indicate unknown initial position
  
  for(;;) {
    if (sys.abort) {
      // Reset system.
      serial_reset_read_buffer(); // Clear serial read buffer
      plan_init(); // Clear block buffer and planner variables
      gc_init(); // Set g-code parser to default state
      protocol_init(); // Clear incoming line data and execute startup lines
      spindle_init();
      coolant_init();
      limits_init();
      st_reset(); // Clear stepper subsystem variables.
      sys_sync_current_position();

      sys.abort = false;
      sys.execute = 0;
      if (bit_istrue(settings.flags,BITFLAG_AUTO_START)) { sys.auto_start = true; }
      #ifdef HOMING_INIT_LOCK
        if (sys.state == STATE_INIT && bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE)) { sys.state = STATE_ALARM; }
      #endif
      if (sys.state == STATE_ALARM) {
        report_feedback_message(MESSAGE_ALARM_LOCK); 
      } else {
        sys.state = STATE_IDLE;
        protocol_execute_startup(); 
      }
    }
    
    protocol_execute_runtime();
    protocol_process(); // ... process the serial protocol
    
  }
  return 0;   /* never reached */
}

 

The picture is loaded in the LaserGRBL and send to Wizfi360 to drive servos

 

 

 

Documents
  • LaserGRBL

    LaserGRBL porting

Comments Write