Hello fellow Arduino project concept thinkers. I am developing a machine that when attached to a engine block will run a hone up and down the cylinder until I tell it to stop. I'm using an Arduino Mega controller, A DM542T stepper controller to control a High Torque Nema 23 CNC Stepper Motor that runs a rail up and down that will handle the honing stroke, A ELEGOO 4 Channel DC 5V Relay Module that will switch power to a high torque worm gear motor to drive the hone spin in the cylinder. I've got all the mechanical work done and the electronic all mounted, wrote a short code the drive the stepper motor back and forth. This is as far as I have gotten. I have a basic knowledge of programming, but lack the skills to bring all this together.
Here is what I would like to do, Powering up the electronics it should not just take off running but wait for the following inputs... A series of push buttons for these functions...
button 1, spin the stepper one or more steps at a time in one direction to position the hone at the top of the cylinder.
button 2, set the upper limit or CW rotation of the stepper motor.
button 3, spin the stepper in the other direction until the lower limit.
button 4, set the lower or CCW rotation limit.
button 5, RUN, start the stepper and the worm gear motors to spin the hone and drive it up and down the cylinder to the set limits.
button 6, STOP.
I will post pictures of the prototype soon.
If anyone has the time and skills and willing to help with the coding please let me know. Also if you have any other ideas that might be useful. Below is just the experimental code to drive the stepper up and down but rudimenty at best.
Thanks
void setup() {
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
}
void loop() {
digitalWrite(8,HIGH);
for (int x = 0; x < 4250; x++)
{
digitalWrite(9,HIGH);
delayMicroseconds(150);
digitalWrite(9,LOW);
delayMicroseconds(150);
}
delay(100);
{
digitalWrite(8,LOW);
for (int x = 0; x < 4250; x++)
{
digitalWrite(9,HIGH);
delayMicroseconds(150);
digitalWrite(9,LOW);
delayMicroseconds(150);
}
delay(100);
}
Well right now the code that I posted doesn't do anything that I trying to accomplish, and I probably shouldn't have even post that mess. The process really isn't that complicated just attempting to automate a process that is either done by hand, time consuming and tiresome.
I'm in need of programming help to do the button functions as described.
bobcom:
If anyone has the time and skills and willing to help with the coding please let me know.
If you just want someone to write the code for you then please ask in the Gigs and Collaborations section and be prepared to pay.
If you want to develop the code yourself then break it down into several small parts.
One part makes the stepper motor move while a button is pressed (button1).
Another part sets the position to ZERO when another button is pressed (button2)
The third part is like the first part but the stepper moves in the other direction and counts every step (button3)
The 4th part saves the step count when a button is pressed (button4)
The 5th part gets the motor to move between ZERO and the saved step count when a button is pressed (button5)
etc
How do you know when you're done? Visual inspection I expect. I'd be tempted to make the device do a fixed number of passes and then stop, but I know nothing about how the process is done manually.
I would think that there's a mechanical limit depending on how the device is mounted to the cylinder head that would let you have a limit switch to tell your device it's at the highest possible point. Setting depth would need user input I expect.
Attached prototype or proof of concept pictures. A little rough the next iteration will be made from a stiffer material. Also I know the picture show a UNO and not the MEGA but that change is being made now. and the buttons are not mounted yet.
I guess I'm what I asking is advise on programming the button functions and storing the variables used for the upper and lower stops for the stepper. And how to nest all that together with the code that makes the motors move.
I could have used limit switches for these but the thing is that this could be used with a wide range of different engines with longer strokes and different bores. some bore from the top others from the bottom and it needs to be easily adjustable for these variables.
Also it's important to note that I'm not developing this for any commercial applications.I'm doing this for my own use in my machine shop. Commercially available hones are ridiculously expensive which would be prohibitive to a small shop such as mine. I'm just an engineer and gear head and the software piece of this eludes me.
wildbill:
How do you know when you're done? Visual inspection I expect. I'd be tempted to make the device do a fixed number of passes and then stop, but I know nothing about how the process is done manually.
I would think that there's a mechanical limit depending on how the device is mounted to the cylinder head that would let you have a limit switch to tell your device it's at the highest possible point. Setting depth would need user input I expect.
The whole purpose is to remove the tooling marks from boring the cylinder, and to leave a pattern to hold oil to lubricate the piston ring movement in the cylinder. So, yes, visual inspection is important.
wildbill:
How do you know when you're done? Visual inspection I expect. I'd be tempted to make the device do a fixed number of passes and then stop, but I know nothing about how the process is done manually.
I would think that there's a mechanical limit depending on how the device is mounted to the cylinder head that would let you have a limit switch to tell your device it's at the highest possible point. Setting depth would need user input I expect.
Yes visual inspection, However after you do this a thousand times by hand you pretty much get a "feel" for much material needs to be removed. Were talking about thousands of an inch. The process works like this...
I use a precision boring bar the remove material and resize a cylinder to within 1000's of an inch. Then I manually use a cylinder hone attached to a drill to clean the bore and finish, leaving a smooth bore for an over-sized piston.
I was wondering if it's possible to overdo the honing. If so I would be concerned about someone kicking the device off and getting engrossed in another job.
Six buttons is six pins, plus step and direction for the stepper. Plus one more to run the worm drive motor. Best to leave pins zero and one for serial debugging. So eleven if I didn't miss anything. Uno has plenty. Cheaper to replace too if you let the magic smoke out.
wildbill:
I was wondering if it's possible to overdo the honing. If so I would be concerned about someone kicking the device off and getting engrossed in another job.
It could happen, that's why I never leave these devices unattended. This is strictly a supervised process. My boring bar is a precision instrument that can accurately remove only the required material to up to 10,000's of an inch then stops automatically, I always stop 1000th of an inch short of my target. Honing is a different story for me. It takes hours to remove the additional 1000th and boring marks to smooth cylinder and create proper cross hatch pattern.
I don't think I have seen a similar project here before. Interesting stuff, at least the mechanicals. The code should be pretty simple. I'll give you a hand with it.
wildbill:
I don't think I have seen a similar project here before. Interesting stuff, at least the mechanicals. The code should be pretty simple. I'll give you a hand with it.
Robin2:
You should be able to do that with an Uno but it won't do any harm to use a Mega.
Please make the images in your Reply #5 visible in the Reply so we don't have to download them. See this Simple Image Posting Guide
...R
I've already order the MEGA along with a screw terminal shield for it. I may want to add some additional options latter on like a counter to count the number of strokes, maybe LED's for the upper and lower limits etc... My brain is full of possibilities.
Which pins are attached where. I suggest that we use the internal pull-up resistors so you will need to wire the buttons so that they each pull their pin to ground.
Times: how often should the stepper move the honing mechanism?
wildbill:
Which pins are attached where. I suggest that we use the internal pull-up resistors so you will need to wire the buttons so that they each pull their pin to ground.
Times: how often should the stepper move the honing mechanism?
That'll do for starters.
Right now I'm using pin 8 and 9 see the motor control code I posted earlier. However I am making the change to a MEGA so we can change anything at this point. I have the resistors and push buttons on order and should be here in a day or so. As for the stepper the up and down motion will be continuous, I was think a short delay at the top and bottom of each stroke for both the stepper and the worm gear drive. I don't want the hone to spin in the cylinder when the stepper is not moving.