Knitting Machine Automation - need help with powering a crank

Hey there!
First of all, happy new year! :slight_smile:

I'm kinda stuck with my current project and I hope you can help me:
I'd like to automate a knitting machine for my sister. Usually they're meant to be used by hand using a crank.

This is how it looks like:

My goal is to apply a motor to it. Then I'd like to add some logic to automatically stop the machine if my sister needs to change the whool or if the knitting is done. To be honest, I'm new to all hardware related stuff, since I'm a web developer.

What I did so far:

My first approach was using a stepper motor, because I wanted the project to be as accurate as possible, so no additional knitting rows can occur.

I also glued (please don't hate me) this little guy...

... on the center of the crank in order to transfer the movement to the knitting machine.

I soon realized that stepper motors take a lot of voltage while being too slow for my approach. For one knitting round I need about 5 seconds by hand while the stepper motor took about 25 seconds.

I recently switched from a Raspberry Pi to a Arduino Mega and now I'm stuck with the following questions:

  • How do I find out what kind of motor is suitable for this?
  • What specs are required for that motor? How do I calculate them?
  • Is there a better way to move that crank besides glueing something to it?

Thanks in advance! Hope you'll have a nice day.

Best regards,
HowlingCoder

what size stepper motor did you use?
I would guess at a minimum you would require something like a Nema 34
if you do a web search for arduino large stepper motor you will get plenty of links including to youtube videos, e.g.

Hello horace,
thank you for your reply and the video you sent!

I used a Nema 17 stepper motor which was obivously not strong enough. I took a quick look at the Nema 34 and tbh it's a bit too expensive for me. I'm not sure if a stepper motor at all is "too much" for a knitting machine, mainly made out of plastic.

I guess I could also use a regular DC Motor as long as it doesn't continue turning irregulary after I turned off the power. But then it's still the question how I can calculate what kind of specs that motor would need.

Thanks in advance!
HowlingCoder

Nema 17 and Nema 34 are not very useful descriptions. The number is the size of the front plate - 1.7 inches or 3.4 inches

There are dozens (or hundreds) of different motors in each size with widely varying torque characteristics. You need to post a link to the datasheet for the motor you have.

Also, what motor driver are you using and what motor power supply (volts and amps) are you using. Stepper motors work better with higher voltages - assuming they are controlled with a specialized stepper motor driver.

Having said all that, the first thing you should do is measure the torque required to rotate the knitting machine. There is a simple method for doing so in Stepper Motor Basics.

Finally (for now) you seem to have a very small pulley on the knitting machine. If you use a big pulley on the knitting machine and a small pulley on the motor shaft you will multiply the motor torque.

...R

Hello Robin,
thank you too for your quick response.

Nema 17 and Nema 34 are not very useful descriptions. The number is the size of the front plate - 1.7 inches or 3.4 inches

I see. The stepper motor I'm using is 17HD40005-22B. I uploaded the datasheet here: Imgur: The magic of the Internet

As a motor driver I used this one: TB6600 Datasheet

The power supply was some universal power supply with 2250mA and 12V.

So it wasn't wrong to use a stepper motor for my use case?

Finally (for now) you seem to have a very small pulley on the knitting machine. If you use a big pulley on the knitting machine and a small pulley on the motor shaft you will multiply the motor torque.

Good idea! I'm going to get a bigger one and maybe remove the crank at all. Should be way better than gluing some tiny pulley on it.

I did the measuring. I removed the handle of the crank and bound a selfmade balance pan through that whole. The average weight needed to move the crank was ~160g. The point is 5,5cm away from the center, so I assume I need 880gm/cm, correct?

Thanks in advance for your help!

Best regards,
HowlingCoder

Much easier for people if the image is visible here. See this Simple Image Guide

...R

HowlingCoder:
I did the measuring. I removed the handle of the crank and bound a selfmade balance pan through that whole. The average weight needed to move the crank was ~160g. The point is 5,5cm away from the center, so I assume I need 880gm/cm, correct?

I often get these things mixed up but I think that is well within the scope for your motor.

When the motor was running slowly, how was the motor connected to the knitting machine and what Arduino program were you using?

...R

Sorry for the image link, I'm going to include the images in the posts directly from now on :slight_smile:

Actually I glued one side of the pully to the machine and fixed the motor itself using the screws inside the pully. It was a dirty fix since using pullies didn't work at all. Maybe this was the issue?

I did that on my Raspberry Pi using Python. I can port this quickly to Arduino but I don't think it would be any different. I'll wire everything up once I get home.

HowlingCoder:
Actually I glued one side of the pully to the machine and fixed the motor itself using the screws inside the pully. It was a dirty fix since using pullies didn't work at all. Maybe this was the issue?

I did that on my Raspberry Pi using Python. I can port this quickly to Arduino but I don't think it would be any different. I'll wire everything up once I get home.

You are not providing any information that would help us to help you.

How about a diagram or a photo showing how the motor was connected with sizes of pulleys and important distances.

How about posting the program you were using.

Have you done tests to operate the motor without it driving any load? What was the result? What program did you use? Show a schematic diagram of all the electrical connections.

...R

As I mentioned earlier I switched from a raspberry pi to an arduino not to long ago. Since I failed on a working solution for my pi, I don't have any old code or diagrams.

But basicly I went to this website and adapted everything for my pi. Something must have gotten wrong while doing that because I just applied everything to my arduino and the stepper motor spins quite fast now - much faster than with my raspberry pi.

The wiring is identical to this schematic:

The code now is identical to the one of that website

int PUL=7; //define Pulse pin
int DIR=6; //define Direction pin
int ENA=5; //define Enable Pin
void setup() {
  pinMode (PUL, OUTPUT);
  pinMode (DIR, OUTPUT);
  pinMode (ENA, OUTPUT);

}

void loop() {
  for (int i=0; i<6400; i++)    //Forward 5000 steps
  {
    digitalWrite(DIR,LOW);
    digitalWrite(ENA,HIGH);
    digitalWrite(PUL,HIGH);
    delayMicroseconds(50);
    digitalWrite(PUL,LOW);
    delayMicroseconds(50);
  }
  for (int i=0; i<6400; i++)   //Backward 5000 steps
  {
    digitalWrite(DIR,HIGH);
    digitalWrite(ENA,HIGH);
    digitalWrite(PUL,HIGH);
    delayMicroseconds(50);
    digitalWrite(PUL,LOW);
    delayMicroseconds(50);
  }
}

I still don't have any idea why there's a difference now. Maybe it was a wiring issue although I checked everything a dozen times. Especially the code...


Before I did the wiring I made some quick schematics on my first two approaches.

The first one used two pullys, while the motor rested on the table. It didn't work at all.
But I'll try this again with the improved stepper motor spinning. I'll also use the bigger pullys to improve the result.

The second approach had a pully on the maschine with the Nema fixed inside the pully. The motor was also fixed on a wooden block. I'm gonna try out this method tonight again, as soon as the glue is ready. Maybe I'll notice some improvement.

In any case I have to thank you! Without your help I wouldn't have rewired everything on my arduino since my assumption was a problem with the motor itself. Thanks again! I'll post an update as soon as I tried one of my solutions. Hopefully everything turns out well :slight_smile:

Best regards,
HowlingCoder

The code in Reply #9 seems to be producing a step pulse every 100 microseconds - 10,000 steps per second. That is much too fast for testing. Slow it down to about 100 steps per second, or maybe even just 2 or 5 so you can count them.

And get it to do just a single revolution so you can easily see if it is missing steps.

It is also crap code. There is no need to update the enable and the direction pins for every step in a sequence. In fact it's probably sufficient just to set the enable pin once in setup(). And just change the direction pin when the direction changes.

Neither do I like to see code that has the same time for the step pulse and the interval between steps. If I was writing that code I would do it like this (for the exact same timing as the code in Reply #9

digitalWrite(PUL,HIGH);
delayMicroseconds(10);
digitalWrite(PUL,LOW);
delayMicroseconds(90);

Then if you want to change the speed just change the bigger number - the interval between steps.

Finally (for now) while delayMicroseconds() is OK for testing you will probably want non-blocking code for your finished project so that other things can happen while the motor is moving. See the second example in this Simple Stepper Code

...R

Hello,

Like HowlingCoder, I'm working on a solution to automate the Addi Express. The nema 17 (17HD34008-22B), with a A4988 driver, works fine with the machine, when you make the machine turn without yarn. But it's more difficult to make it work using yarn. There is a lot of friction, and the motor have a lot of difficulties to overcome the friction. Any idea ?

@Robot561, post a link to the datasheet for your motor.

...R

Hey,

Sorry, but I'm not able to find a datasheet for this motor. You can find this kind of motor on Ebay

Here is the description :

Description:

  • 100% Brand new and high quality

  • 1m wire, one connect electrical machine, on the other end has variety optional ports; heat shrink tubing effect to prevent the wire tangled up

  • Suitable for 17HD34008-22B mixing type stepping motor

  • Outside view: Show as the picture

  • Drive mode: Chopping wave constant current drive

  • Exciting mode: Two-phase 4-wire, it is available for rotation of forward and reverse

  • Turn to: The order of power is AB-BC-CD-DA, from shaft end see C.W

  • Rated current (one-phase): 1.5A DC

  • Rated voltage: 3.45V

  • Stepping angle: 1.8°
    Specifics:

  • Operating Conditions: Environment Temperature: -20~50℃; RH: 90%MAX; Mounting Position: Axis horizontal or vertical installation

  • Direct-current winding resistance (25℃): 2.3&;±10%

  • Wnding inductance: 3mH±20%

  • Cogging torque: 12mN.m REF.

  • Holding torque: ≥300mN.m(I=1.5A)

  • Max. no-load starting frequency: ≥1500pps

  • Max. no-load running Frequency: ≥8000pps

  • Temperature rise: <80K

  • Step Angle Accuracy: 1.8°± 5%

  • Rotary inertia: 38g.cm2

  • Motor Weight: 0.23Kg/PC REF.

  • Insulation resistance: Cold insulation resistance should be more than 100m&; (between the Motor stator core and Terminal)

  • Dielectric strength: The space between the Motor stator core and Terminal should be able to withstand AC600V/1s without breaking down. Leakage current is less than 1mA.

  • Size(LWH): Approx. 42 x 42 x 34mm / 1.65 x 1.65 x 1.34 inch

Here is the code I use :

const int stepPin = 3;
const int dirPin = 4; 
int customDelay,customDelayMapped; 
 
void setup() {
  pinMode(stepPin,OUTPUT);
  pinMode(dirPin,OUTPUT);
 
  digitalWrite(dirPin,HIGH); 
}
void loop() {
  
  customDelayMapped = speedUp(); 
  digitalWrite(stepPin, HIGH);
  delayMicroseconds(customDelayMapped);
  digitalWrite(stepPin, LOW);
  delayMicroseconds(customDelayMapped);
}
int speedUp() {
  int customDelay = analogRead(A0); 
  int newCustom = map(customDelay, 0, 1023, 300,4000); 
  return newCustom;  
}

Hope this can help. The motor is able to make the machine knit only at slow speed. According to my observations, I would need a motor a bit similar, with about twice the torque.