Hello Guest it is August 11, 2020, 06:59:56 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Kawgomoo

Pages: 1
1
This is a DYI plasma table using the little red Langmuir controller. {USB Motion Controller}

Under Motor Tuning i have the X and Y axis set to 200ipm max velocity. I have the Z axis set to 50ipm.

The problem arises when i run G-Code. The Fusion Mach3 post doesnt allow me to specify a seperate Z axis feed rate, so it sets it at the same 180ipm i want to be cutting at. Problem being the axis cant move that fast and stalls during each commanded Z move. I cant find a way to get Mach3 to limit this. If i go to Jog and the feed rate is set to 200 it will only jog at 50 on that axis like it should. But when running under g code it seems to try to run at whatever feed it commands and just stalls.

Is there a setting? am i doing something wrong? glitch in the matrix?


2
General Mach Discussion / Arduino Charge Pump Code/Sketch?
« on: September 16, 2014, 10:52:52 AM »
Hello all. I am new to all of this, CNC, electronics, programming. You name it, I'm a newb!

What i am looking for is an example or snippet of code that allows the Arduino to "read" the mach3 charge pump signal.

I just want to arm or disarm 2 outputs based off the presence or lack their of of the mach3 charge pump signal.

I will post the code i was given, however i have not had any luck with it. Trying to troubleshoot the code myself at this time is proving daunting.

Also any external circuitry required to make it work would be appreciated!

I have of course searched this topic, quite a bit. And have gotten nowhere. Any pointing in the right direction would be much appreciated.

Quote
typedef enum
{
  sInitialize,
  sMonitor,
  sDead
}
state_t;

static uint8_t state;

static unsigned long PreviousMicros;

static bool PreviousClock;
static unsigned short Clocks;

const float WAVELENGTH = (1.0 / 10000.0) * 1000000.0;
const unsigned long WINDOW = 2.5 * WAVELENGTH;

void setup( void )
{
  state = sInitialize;
 
  // Make A1 and A0 outputs
  bitSet( DDRC, DDC1 );
  bitSet( DDRC, DDC0 );
 
  // Ensure they start LOW (not necessary but documents our intent)
  bitClear( PORTC, PORTC1 );
  bitClear( PORTC, PORTC0 );
 
  // Make digital pin 8 (PB0) and input (not necessary but documents our intent)
  bitClear( DDRB, DDB0 );
}

void loop( void )
{
  unsigned long CurrentMicros;
 
  CurrentMicros = micros();

  // Count toggles of digital pin 8 (PB0)

  if ( bitRead( DDRB, DDB0 ) )
  {
    if ( ! PreviousClock )
    {
      ++Clocks;
      PreviousClock = true;
    }
  }
  else
  {
    if ( PreviousClock )
    {
      ++Clocks;
      PreviousClock = false;
    }
  }

  switch ( state )
  {
    // Wait for the first toggle
    case sInitialize:
      if ( Clocks > 0 )
      {
        // Go live
        bitSet( PORTC, PORTC1 );
        bitSet( PORTC, PORTC0 );
        // Monitor the clock signal
        state = sMonitor;
        Clocks = 0;
        PreviousMicros = CurrentMicros;
      }
      else
      {
        // Light an LED to indicate waiting?
      }
      break;
     
    case sMonitor:
      // Check each window for...
      if ( CurrentMicros - PreviousMicros >= WINDOW )
      {
        // No clock signal?
        if ( Clocks == 0 )
        {
          // Go dead
          bitClear( PORTC, PORTC1 );
          bitClear( PORTC, PORTC0 );
          state = sDead;
        }
        else
        {
          // Reset for another window
          Clocks = 0;
          PreviousMicros = CurrentMicros;
        }
      }
      break;
     
    case sDead:
      // Light an LED?  Sound an alarm?  Cry in your beer?
      break;
  }
}

Pages: 1