g3rard / OpenKnit

an open project about a digital knitting machine
http://openknit.org/
319 stars 90 forks source link

Purpose of the encoder and changes to the code #3

Open DomAmato opened 9 years ago

DomAmato commented 9 years ago

Sorry if I am naive but is the encoder necessary? I would understand if you were using a DC motor that had no positional awareness but if you use a stepper library like PJRC's accelStepper you can keep track of the position of the steppers or even just use a step variable and then just use the normal Stepper library from Arduino. It seems like one less thing to worry about hardware wise and in the code.

The code as it is is sort of a mess, is there any plans to implement a protocol to control things from a computer input or SD card. Like a common control language such as g-code or using a preexisting protocol like firmata. as of now it just runs a preset clothing item which is fine but it seems like it would benefit from a set firmware and then have software clients that can tell it the type of items to knit.

LokiMetaSmith commented 9 years ago

It depends on how fast the machine is going. Steppers can lose a step for mechanical reasons, like going too fast or getting in a high friction spot. With an encoder, the software can make minor corrections or halt before that happens, which allows the machine to reliably rotate the motors faster.

I'm keeping an eye on this project, but I've not built one yet. I would use g-code so you can easily incorporate some of the excellent reprap projects into this one. It would require re-writing a slicer but that needs to happen regardless.

DomAmato commented 9 years ago

I'm not sure gcode would be the best method. Its 1 axis movement and you would have to map values to handle the servos that aren't particularly standardized. I think in terms of CN machines this one has some unique features that 3d printers or cnc's don't have and so a less robust and succinct protocol would better serve it. I mentioned it but now that I think about it i don't think gcode would be right for the reasons I stated above.