Hello Guest it is July 10, 2020, 06:09:08 PM

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.


Messages - Kawgomoo

Pages: 1
1
General Mach Discussion / Re: Arduino Charge Pump Code/Sketch?
« on: September 22, 2014, 05:33:08 PM »
In the 48 hours that mach support felt needed to "teach me a lesson" i already authored my own code and got it working fine.

Marris Freimans charge pump design is bulky and noisy. Not to take anything away from him, but he even points this out in his instructions.

I ask a question about coding arduino, and get the reply buy different hardware.

Yet i am the one who is rude for not accepting such off base off topic answers?

I have lost all interest in using Mach3. There are other solutions out there without a fanboy attitude when it comes to questions being asked. Every question i have asked regarding Mach3, on any forum, i have gotten a reply with someone trying to sell me something. I don't want anyones junk, i am in this to learn this, for myself.

The point of asking a question is for others with experience to weigh in. If the correct way to do everything was to learn every aspect of everything that an assembly needs, no one would ever achieve anything.

Its called working together, take what you know, add it to what i know, and in the end have something new to enjoy.

But since i asked a question on writing code, apparently that makes me some idiot hack.

Im sure you can step into my shoes and do my job just as well as I. What a poor poor stupid hack i am.

fyi i didnt download any code. i was given code that was authored for me, and it didnt work. so then i took it upon myself to learn the coding so i could do it entirely myself, and not have to ask questions where i get such rude replies…an on top of that a 48 hour ban for putting up with your crap.

And mach thinks this is how you run a successful business? LOL

You can count me out.

2
General Mach Discussion / Re: Arduino Charge Pump Code/Sketch?
« on: September 18, 2014, 04:14:45 AM »
because its too big too fit in my package, and teaches me nothing.

simple enough?

good.

arduino DOES NOT control anything in this machine, except the charge pump.

{stop trying to figure out what I'm building, you'll never guess} lol

3
General Mach Discussion / Re: Arduino Charge Pump Code/Sketch?
« on: September 17, 2014, 10:41:19 PM »
The cnc4pc board doesn't really fit the bill. {though on paper it more or less does what i need}

Ahh but how simple life would be if it did.




4
General Mach Discussion / Re: Arduino Charge Pump Code/Sketch?
« on: September 17, 2014, 01:05:11 AM »
So far i have made a little progress.

I looked up the FreqMeasure library, and as per their suggestion, tried the FreqCount sketch.

Using analog pin 5 as my input, i am able to watch the frequency monitor output its sample about once a second to the serial monitor window.

With Mach3 running i am seeing 12680 steadily and 0 when i click the reset button {flashing}.

Now i need to figure how to enable or kill my desired outputs using this data.

I thank you for the great suggestion, it seems to have me pointed in the right direction.

Code: [Select]
#include <FreqCount.h>

void setup() {
  Serial.begin(57600);
  FreqCount.begin(1000);
}

void loop() {
  if (FreqCount.available()) {
    unsigned long count = FreqCount.read();
    Serial.println(count);
  }
}

5
General Mach Discussion / Re: Arduino Charge Pump Code/Sketch?
« on: September 16, 2014, 02:17:46 PM »
Thank you very much for your reply.

I did not author this code, it was given to me on the arduino forum.

I have also never used an arduino before. I purchased the inventors kit and am currently working my way through spark fun's 8hour introduction video {super noob}

My poor results in searching stem from the fact that i really don't know what I'm looking for, or looking at!

I will experiment with the freq measure sketch and do some more research on attachInterrupt, and how i can implement this into code.

I agree the charge pump monitor should be fairly simple, and have a fairly wide range for "on".

The last charge pump solution i built used the hardware approach posted on the mach3 website. It works, but its a little noisy.

my long term goal is to have this on an attiny45 for imbedding easily into various machines.

6
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