Jump to content

Arduino stuff/ programing/so cheap


flyingbrick
 Share

Recommended Posts

  • Replies 399
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

IMG-20190929-WA0005.thumb.jpeg.0da7bc9c164d472e5c1a0dec9be03df5.jpeg

 

I managed to get my electronic leadscrew on the BarryLathe to cut its first thread today. The lathe probably hasn't cut a thread in 20 years. I still need to wire up a control panel so I can set the parameters without reprogramming it, but it is great being able to cut literally any thread pitch without changing a single gear. (Thread in image is a bodgy attempt at M16x1.5 with a random piece of HSS cutter)

  • Like 1
Link to comment
Share on other sites

14 hours ago, ajg193 said:

IMG-20190929-WA0005.thumb.jpeg.0da7bc9c164d472e5c1a0dec9be03df5.jpeg

 

I managed to get my electronic leadscrew on the BarryLathe to cut its first thread today. The lathe probably hasn't cut a thread in 20 years. I still need to wire up a control panel so I can set the parameters without reprogramming it, but it is great being able to cut literally any thread pitch without changing a single gear. (Thread in image is a bodgy attempt at M16x1.5 with a random piece of HSS cutter)

you seen this guy?

 

  • Like 1
Link to comment
Share on other sites

On 26/09/2019 at 21:52, Ghostchips said:

https://youtu.be/onQO9h5A83M

HomeBrewElectronicTImer.JPG

Finally.
Feels weird driving a car that used to have buzzing points.  Now it only has this digital thing running the show.
Torn between continuing the coil on plug thing or coding some decent ignition timing for it.

You planning on designing a custom PCB for that now that you have a working solution? Looks bloody great :)

Link to comment
Share on other sites

On 30/09/2019 at 20:32, ajg193 said:

Yeah, his videos came up about the same time I started ordering bits

This is great, really love the concept as its something that I'd never seen before on any manual lathe. 

I wonder how he will deal with disengagement and reengagement of the carriage and lead screw when doing multiple cuts. Eg, manually with lever and indicator arrow (as per lots of traditional lathes), reverse the spindle to drive the carriage back without disengaging (as per traditional lathes when you dont trust or have an indication arrow thing) or some kind of software reverse on just the lead screw.. hmmmn

Link to comment
Share on other sites

It works perfectly in every case, only issues are if you don't have a strong enough stepper or miss pulses from the encoder

 

You can even make multi start threads by offsetting the spindle position by X degrees in the software.

 

It's pretty much superior to a gear driven system in every way.

 

You will have issues with using the thread dial for metric threads using an imperial leadscrew though, you could probably get around that by encoding the position of the carriage too. Doing that would allow you to compensate for machine wear, effectively allowing you to cut a perfect thread until the machine falls apart.

  • Like 1
Link to comment
Share on other sites

Could someone tell me why this

  if (analogRead(inPin) <= sensorThreshold)
  {
      if (coilState == LOW && coilPin == LOW) {
      coilState = HIGH;
      coilPin = HIGH;
      digitalWrite(outPin, !(digitalRead(outPin)));
      previousMicros = currentMicros;
     }
    if (coilState == HIGH && coilPin == HIGH && currentMicros - previousMicros >= coilCharge)
     {
      digitalWrite(outPin, LOW);
      coilPin = LOW;
      previousMicros = currentMicros;
     }
    if (coilState == HIGH && coilPin == LOW && currentMicros - previousMicros >= dwell)
    {
      previousMicros = currentMicros;
      coilState = LOW;
      coilPin = LOW;
    }
  }
  else
  {
    digitalWrite(outPin, LOW);
  }


Runs way slower (as in, ignition retarded with the sensors and engine speed the same) and noticeably less smooth than....

This?

  if (analogRead(inPin) <= sensorThreshold)
  {
    digitalWrite(outPin, !(digitalRead(outPin)));
    delay(2);
    digitalWrite(outPin, LOW);
    delay(10);
  }
  else
  {
    digitalWrite(outPin, LOW);
  }
}


Link to comment
Share on other sites

Your code looks way better than it used to.

The rest of the system influences the code you show, so without knowing how the how often this is called, how pins are wired, when previousMicros is updated, what the incoming duty cycle is, and if dwell is set for 10million, it's a bit hard to tell.

What is sensorThreshold for, and what is the inPin reading? (Too busy to puzzle it out, pics are good).

Hint. You operator order for working out the time is probably correct, but I can never remember the precedences for all the languages, and putting brackets in there can make it explicit / easier to read.

Also comments like

// found a leading edge going high

// trigger after dwell_uS

Can also really help.

Also, I'm assuming thisng are active high, but don't really know, so there's 2^3 = 8 different ways to think about it to work out what is doing. Pin names can have clues like POINTS_IN_LOW and IGN_OUT_HIGH to help.

Keep it up, you're going places.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...