By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Forum House Ad Zone

Electronic Lead Screw Project

The aim of this thread is to detail the build and give help where needed

All Topics | Latest Posts

Search for:  in Thread Title in  
Phil Grant25/02/2020 16:40:56
107 forum posts
21 photos

Dias,

See if this helps

how to identify coils

dcosta25/02/2020 20:21:23
496 forum posts
207 photos

Hi Phil and others,

Thank you for your help.
With your encouragement, and based on the connections from another small stepper motor in another project, and using the multimeter to test, I tried a new connection that I think is called BIPOLAR PARALLEL.
So,
I connected the RED wire and the BLUE wire,
I connected the YELLOW wire and the BLACK wire - constituting winding A
I connected the WHITE wire and the BROWN wire
I connected the PURPURA wire and the GREEN wire - constituting the B winding.
NOTE: in the meantime I found an ArcEuroTrade file (HYBRID STEPPING MOTOR MODEL 160-010-00400) which also describes these BIPOLAR PARALLEL connections as possible.

Now, the stepper motor has been connected for approximately three hours and has heated up to, perhaps, 45º (the hand supports the temperature well) and, as far as I can see, it works as well as before.
Thanks to the help received, I am finally satisfied and will be able to move forward on the project.

best regards
Dias Costa

Phil Grant25/02/2020 22:53:30
107 forum posts
21 photos

Dias,

That's great news, I suspected it would be the wiring of the coils.

Phil

dcosta26/02/2020 23:41:49
496 forum posts
207 photos

Hello John,

Thank you for sharing information about your project.
I am interested in trying to add the functionality you refer to in your post to the program.
I have already started the process but, out of ignorance, I was forced to suspend the attempt.
I stuck in point 3. - here: "add this to UserInterface.h
int ButtonStateMachine (bool incrementButtonPressed, bool decrementButtonPressed) ";

Although I have professionally been a programmer / analyst for almost three decades, not having programmed in 'C', I am not sure where in the UserInterface.h file should I insert the line.

Could you do me a favor and tell me where that line should be inserted?

Thanks in advance
Dias Costa

Johnboy2527/02/2020 09:45:38
avatar
260 forum posts
3 photos

Hi Dias

If you’re looking for the fast scroll mod/hack it’s here:-

**LINK**

It took me a while to get the code inserted correctly - I had help from a friend who’s an experienced C++ programmer as my C programming skill are a lot be be desired! 😳

I will look at the code file to find where it inserted for you.

I really think this is a useful mod.

John

Edited By Johnboy25 on 27/02/2020 09:48:10

SillyOldDuffer27/02/2020 11:14:40
10668 forum posts
2415 photos
Posted by dcosta on 26/02/2020 23:41:49:

Hello John,

"add this to UserInterface.h
int ButtonStateMachine (bool incrementButtonPressed, bool decrementButtonPressed) ";

Although I have professionally been a programmer / analyst for almost three decades, not having programmed in 'C', I am not sure where in the UserInterface.h file should I insert the line.

Could you do me a favor and tell me where that line should be inserted?

Thanks in advance
Dias Costa

Hi Dias,

Though not into this particular project I am an ex C/C++ programmer.

Looking at userinterface.h I found a short file, starting with a comment section containing licence blurb. The action starts at line 27 :

#ifndef __USERINTERFACE_H
#define __USERINTERFACE_H

#include "ControlPanel.h"
#include "Core.h"
#include "Tables.h"

typedef struct MESSAGE
{
Uint16 message[8];
Uint16 displayTime;
const MESSAGE *next;
} MESSAGE;

class UserInterface
{

The new line can be inserted almost anywhere apart from inside any curly brackets!

I'd put it at the top just before the typedef, roughly line 33 thus

#ifndef __USERINTERFACE_H
#define __USERINTERFACE_H

#include "ControlPanel.h"
#include "Core.h"
#include "Tables.h"

int ButtonStateMachine (bool incrementButtonPressed, bool decrementButtonPressed);

typedef struct MESSAGE
{

...

H files typically contain definitions shared by a number of source files. In this case

int ButtonStateMachine (bool incrementButtonPressed, bool decrementButtonPressed);

means: 'A function called ButtonStateMachine takes two boolean arguments and returns an integer result.'

Boring explanation, if anyone cares:

The function is defined fully somewhere else in a code tree consisting of several source files, and the statement, it's signature, is a promise to the compiler that the full definition of the function will be made available later. So a project consisting of three source files, say A, B and D, will compile A even if it calls a function in D that doesn't exist yet. When the compiler hits an unresolved but explained reference, it leaves a gap in the code ready for the link phase, which is where A+B+C get glued together with any operating system and library calls. The linker, which can see everything, fills any gaps left by the compiler and completes the working whole. It's only an error when the linker can't fill the gaps.

Clear as mud? It's a mechanism allowing programmers to separate code into manageable blocks rather than one giant source file, and then assemble the bits into the whole later. It also allows code to be shared between different projects.

Dave

 

Edited By SillyOldDuffer on 27/02/2020 11:19:57

Johnboy2527/02/2020 11:32:36
avatar
260 forum posts
3 photos

Dave...

‘Thanks for that - I’m just starching the surface with C++ so this is helpful to me.

John

dcosta27/02/2020 20:19:22
496 forum posts
207 photos

Hi Dave,

Thank you for your help.
I took your suggestion, made a correction to a curly brace in a file and was successful.
The scope of the statement really had to be that. But as I lacked confidence, and as I'm not used to the development interface, I didn't dare.

I tried that feature and didn't like it. Perhaps because I did something wrong, the buttons randomly increase / decrease the value in jumps (not sequentially). Perhaps the function requires a short delay between each value ...
Maybe I'll try to add it.

best regards
Dias Costa

Phil Grant22/03/2020 08:14:45
107 forum posts
21 photos

Following a request on the Clough42 GIT hub I put my bracket designs I made for my small WARCO (Chinese) lathe and ELS on thingiverse Here

Jimmeh26/03/2020 18:16:38
avatar
27 forum posts
12 photos

It's been very slow progress for me on this project, but a recent change in my working arrangements has saved me 3+ hours of driving to/from work each day.

I now have the whole system working on the bench and am in the progress of sorting the hardware on the lathe.

I tried my hand at using a new (to me) gravograph and the result is actually alright (don't look to closely!).

ELS Control Box

Last night I fitted the drive system, which is a nema24 hybrid stepper with HDT3 belts and pulleys.

ELS Drive Pulleys

I'm hoping to drive the encoder with an HDT5 belt straight onto the headstock gear. I should be able to try the whole system fairly soon.

Huge thank you to Phil Grant for the circuit board and components!

Edited By Jimmeh on 26/03/2020 18:18:15

Roy Vaughn14/04/2020 13:17:52
70 forum posts
4 photos

Nearing the finishing post now and starting to think about detailed functionality. It would be useful to see a visual indication of a stepper driver alarm on the control panel. James has included support for the input from the interface but I can't see any functionality attached to it in the code. Does anyone know any different?

Stay safe, Roy

Martin Connelly14/04/2020 13:30:17
avatar
2549 forum posts
235 photos

If you have closed loop hybrid servo-stepper motors and drivers from Leadshine (possibly others as well) they have an error signal that is triggered by the position feedback differing from the demanded position by a set amount (that can be changed by the used if required). This signal would be fed back to the controller to either trigger a light, audible alarm or other action. If you don't have feedback encoders on your system then this warning may not be available to you.

Martin C

Roy Vaughn14/04/2020 17:10:08
70 forum posts
4 photos

Thanks Martin, I'm familiar with the hardware requirement, it's what I have. My question concerns the software handing (or not) of an alarm signal. Roy

Martin Connelly14/04/2020 17:43:44
avatar
2549 forum posts
235 photos

The problem of acting on the alarm signal is what to do? Stopping the lathe but letting the steppers run will cause problems. Stopping the steppers but letting the lathe run will cause problems. Stopping them both will cause problems unless they all stop instantly (or at exactly the same rate) which is unlikely so also a problem. If you have a spindle encoder that keeps the steppers closely aligned to the correct position if the spindle speed runs down then you would probably be able to stop the spindle knowing that the steppers will stop at the same rate as the spindle.

The best option for the majority of users may be to trigger an alarm light so that the lathe can run to a point where the operator can take some action that will not cause problems.

If you have some means of homing the movements of the lathe and use it at the start of a session you can easily reset everything by re-homing if there is an error signal that Is acted on by stopping safely.

Martin C

Brian Oldford14/04/2020 18:44:13
avatar
686 forum posts
18 photos

I've followed this thread from its inception. I plan to drive my Super 7's lead-screw via 90 degree skew gears thus containing the stepper motor completely within the change-gear compartment. To design and make the mounting requires the removal of the banjo but I became side-tracked with other more pressing tasks.

Now I'm back on track I'll try and put up some photos of my progress,

Edited By Brian Oldford on 14/04/2020 18:48:28

Roy Vaughn14/04/2020 19:11:15
70 forum posts
4 photos

The odd missed step isn't crucial except when screwcutting, but it shouldn't happen, so the root cause (overspeed or overload) needs to be fixed by the operator. A lot of missed steps leading to a crash is another matter. If it's due to operator error that's exactly equivalent to the geared lead screw situation with the same consequences and solution. If it's due to electronics failure I imagine that the banjo will be back on the lathe in short order. The lead screw will track the spindle even after the emergency stop button has been hit, but what if there's a power cut? Put the ELS on a UPS? It all gets a bit complicated. So I agree the software best solution is to signal the alarm on the display and leave it at that.

Roy

Since it should never happen the only corrective action is to fix the source of the problem, e.g. overspeed or overload.

I envisage alarms arising from the odd missed step due to over-speed or overload, hard to notice otherwise and only important when screwcutting . If something major happens, e.g., the lead screw stops while the spindle carries on, leading to a crash, I imaging the whole lot being decommissioned and sold for parts on Ebay!

Jimmeh14/04/2020 20:14:23
avatar
27 forum posts
12 photos

I think its just a placeholder for code to be added at a later date if so desired. When testing my system (CL57T driver + stepper with encoder) I physically forced the servo out of position and it just cuts the power to the servo. Cycling the power restores everything back to normal. Likewise if you spin the rotary encoder really fast one way and then the other the system errors and power is cut. The consequences are obviously bad, but I think I'd rather the stepper powers down if there's a problem.

On a separate note I would like to try and see if I can get the whole system to power on/off with the lathe itself. I am conscious that if there is an electronic fart the carriage could move unexpectedly and I would like the E-stop to help me!

I'm almost done with my installation. I just have to adjust the lathe side cover so it fits back on and mount the control panel somewhere accessible. Its really quiet without the change wheels rattling away, and I actually use it for fine feed now. Before I never bothered as it was too much of a pain in the ass swapping everything around.

Roy Vaughn14/04/2020 21:07:41
70 forum posts
4 photos

Jimmeh

I have the same setup. I haven't tried those tests. Maybe the behaviour of the stepper controller could be changed so let the software take control by doing something over the data port. Probably in the all too difficult category.

Apologies for the junk in the end of my last email, I can't get rid of it now.

Johnboy2518/04/2020 09:17:37
avatar
260 forum posts
3 photos

Hi everyone. I’ve been following this build on James Clough’s YouTube channel (Clough42) this is an on going project and there have been updates which I have included & modified in software. There are ‘third parties’ actively adding options they consider to be useful. I have seem mods to include more safety features. This is not a ‘finished’ project and there are safe guard in place. Further info can be seen on github forum. Addition features are planned but James is currently contributing to the Corvid19 response producing PPE for hospital staff which he’s making on his 3D printers.

I have been building this system along with a friend who has a Southbend 4.1/2”. He wants to screw cut metric threads. He’s managed to get his hardware up and running and it has transformed the versatility of the lathe. I’ve been repairing/renovating the gearbox prior to fitting on my Boxford 4.1/2” metric lathe between making parts for the Loco project. I’m using this lockdown period to maximise workshop activities and trying to keep me out of harms way.

Stay well & keep away from this virulent viruse

Johnboy2518/04/2020 09:17:39
avatar
260 forum posts
3 photos

Jim

This is a mod that has been produced to use the on/off button To disable the  servo Drive.

I also intend to incorporate an E-stop activated by the lathes control system.

Edited By Johnboy25 on 18/04/2020 09:28:44

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Sign up to our Newsletter

Sign up to our newsletter and get a free digital issue.

You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy

Latest Forum Posts
Support Our Partners
cowells
Sarik
MERIDIENNE EXHIBITIONS LTD
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest

 

Donate

donate