-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra needles selected when knitting lace #40
Comments
Probably same as #41? |
When I moved #161 out of the Desktop section, I intentionally created two separate firmware issues #40 and #41, as the symptom with the Lace carriage was sufficiently different that it could be a separate bug from the K-carriage one. And in both cases, the symptom is different from what I see described in #48 and #50, so I'm reserving judgment until I have a working build and can retest these. I hope I'm wrong and both #40 and #41 are indeed fixed by PR #50, but I won't be surprised if they're not. I see both #40 and #41 as belonging in the "Needs Testing" category for now. |
I have knit 9 different patterns with the L-carriage (KH910 with Shield V1 version 0.95). I used the full bed (192 needles because the left 8 are not selected if the L-carriage comes from the left). Only with the last pattern I saw 1 wrong needle selection (pattern 105 with 27 repeats). Sorry, I see now that it is alreadt known that knitting past the turnmarks is working correctly. |
@Adrienne200 ... So are you saying someone needs to add the ready - please test label to #40 and #41 ? I guess @dl1com has the power to do that ... |
thanks for the prompt! |
I have knitted many rows with the lace carriage and 1.0 build test230626, without any mispatterning. I think this long-standing issue is finally fixed, thanks everyone. |
I've tested this with v1.0 and while it no longer selects adjacent extra needles for me, there are other selection problems. Namely, after knitting some rows (around 10), needle selection when pushing to the left gets broken (selects no needles in my test pattern). The patterning seems to work OK with K carriage, other than that there are some blank rows where some needle selection happens with both K and L carriage, but that was a problem for me before already. So in short - after about 10 rows of knitting on my test pattern, the L carriage stops selecting needles when pushing to the left. I can't exclude there isn't something funky in my test pattern, so will also try with ones supplied under this issue. You can find my test pattern below. |
My 910 machine has been working perfectly, but as soon as I moved to my 930, it's right back to frequent mispatterning with the lace carriage. (No sightings so far of the similar issue with the K carriage (#41) so maybe that's fixed across the board, to be determined as more testing happens.) |
@AllYarnsAreBeautiful/ayab-contributors anybody who can take a look into this? |
I can repro on @Adrienne200's 930. It is much more common when the carriage is moving quickly. I'm guessing it's old state stuck in the solenoid buffer. Need to do more digging. |
This also reproduces on my 910 so it's not machine specific. |
@Adrienne200 I just followed your latest instructions on my 910 (I know you said to test on a 930 but since @clholgat reproduced it on a 910 I figured I should be able to see it as well) and found no mispatterning, even when moving the carriage very fast, crossing the turn marks any number of times, etc. |
Still seeing this on a 930 with Beta3 Desktop and firmware. Left-right only, and somewhat speed dependent. I'm air-knitting, and if I zoom across faster than you'd go when actually knitting it fails multiple times per row. It is shadowing, that is it repeats a D needle 16 later in the direction of travel. At more reasonable speed it only fails occasionally, but the issue is still there. I've never seen it on a 910 since 0.95 or very early in the 1.0 cycle, and I've used more than one different 910. But it is speed dependent, so could be more about different machines than different models. |
With another round of testing on my KH910, looking closely at I think I finally understood what was happening: in the affected direction (left to right), solenoids are switched slightly too late. In fact, by changing the value in the firmware to trigger solenoid activation just one needle later, I managed to reproduce on my KH910 the exact behavior described in this issue. So, it should be a simple matter of tweaking that value so that activation occurs a bit sooner, right? Well there's another problem that rears its head when you do that: when knitting a full-width pattern, starting with the lace carriage from the left, the first few needles (on the left of the bed) may not be correctly selected on the very first pass of the lace carriage (further passes in either direction correctly select all needles). Although it may seem related, this is not caused by the time it takes (or rather, used to take in previous releases) for the desktop app to send the first line's data to the firmware once the carriage is identified. In fact the problem can be seen even if you move very slowly across the left turn mark, or take a long pause right after the first beep. What happens is that by the time the firmware decides the current carriage is a lace carriage, the carriage center has traveled well past the turn mark and needle L100, and is closer to needle 4-5. And because on the lace carriage, the needle selectors are so close to the center (12 needle widths on either side), at this point it is too late to activate the solenoid that would influence the selection of needle L100. Now, part of the reason why the carriage is detected so late is that when we detect an S magnet in front of the left sensor, we can't be sure it is not a garter carriage's first magnet of its right-side N-S pair. So, the firmware waits until at least So it looks like there's some fine-tuning to be done here, to make sure we can reliably both distinguish a garter carriage from a lace carriage, and also start activating solenoids soon enough for the first needles to be selected correctly. It can be done obviously since the Brother firmware manages it just fine. |
You shouldn't wait for more than 3 needles after a first detection to make a carriage decision |
The thing is, In fact, in |
ayabAsync is setting carriage position 3 needles after detection and therefore, for L, code sets position to exactly 3 while updating solenoid 3-4=-1 at the same/that time. If you move offset to -3 then it will start with solenoid 0 while with -2 it will start with 1 ... and you will miss 0 (not because of cam/solenoid timing/... but because you start with 1/too late) => with -4 ayabAsync should therefore never miss L100 (by construction, no marginalities here) NB: I may be off by one here, I'll check tomorrow code & simavr (you are running latest version I suppose ?) |
Yes, I just tested with jpcornil-git/ayabAsync-firmware@60fa8a3 and jpcornil-git/simavr@ca908be . Command line: With
|
Just had a look at the ayabAsync code and this is expected. When the carriage is detected (carriage position sets to 3 and solenoid to set at 3-4=-1), the first linereq message is issued and therefore the pattern to knit not yet available, i.e. solenoid 15 (-1) is reset. One needle later (carriage center at 4 and solenoid to set at 0), pattern should be available and solenoid (at 0) set. => If you shift this by one (-3 iso -4) then the first solenoid will always (i.e. no uncertainty here) be reset while with -4 L100 will never be missed. You have to make sure of course that the pattern is available on time from desktop and that the firmware doesn't lag behind. Next rows will be less critical wrt that as you will get the reqline well before (at least 16 needles for L, 12 + 4) |
@Adrienne200 could you check that https://code.jonathanperret.net/ayab-webtool/#pr=209 has no similar issue (can then be used as working baseline to investigate differences) ? |
Yes, this is demonstrated clearly in simavr as shown above : But my point is that Now, there’s a possibility that But other than that there’s no blocking in |
In the longer term we could change the API so that line data is available before carriage detection (even though it would not technically not require new message types, the order of messages would change so that’d be a breaking API change). This would be helpful not to save on transmission time (again, milliseconds) but because it would let the firmware start activating solenoids even before the exact carriage type is known (i.e. see an L magnet => start selecting for L). Observe that the magnet-to-selector distance is the same (12 needles) between the L carriage and the G carriage, so selecting the first needles as for an L carriage would actually be correct even if it turns out it’s a G carriage! This might not be a coincidence… |
carriage-4 is optimal for L apriori, just when the armature is against the solenoid (the 'no click' scenario), when firmware and hardware positions match perfectly (mismatch of +/- 1 possible). I believe it is safer to set the solenoid earlier on (ready ahead of being against the armature) rather than later and, if correct, -3 would therefore be a better choice than -5 to absorb position mismatch (but not for a correct L100 handing)
I thought about that as well but this is not integrating well as firmware "moves" with position changes as of today.
This is only a solution for issues where the desktop doesn't reply quickly enough (doesn't seem to be the case but there could be old/slow serial implementation)
Not sure I understand that one,
|
Exactly, which is why I want to move it to
I don't know about I've tried the necessary change, it works in the simulator but the unit tests are giving me a bit of trouble.
Actually, it is a solution for the issue even without serial timing problems, as I tried to explain above. Having the data sooner lets the firmware start activating solenoids as soon as the L magnet is seen (i.e. center at needle 0), by assuming it is an L carriage. We cannot be sure it's not a G carriage until needle 2-3 is passed (what
Regardless of the carriage in use, the solenoid used for needle L100 can only be solenoid Your "solenoid to set" values here appear to be timing values, i.e. Anyway, what I meant is that the distance between the (rightmost for G) L magnet and the needle selector is the same for both carriages: Mechanically this means that for needle |
OK I see what you meant now, it is valid at both sides, i.e. needle to select for L/G is -4/+4 at the Left/Right side wrt magnet position (inner one for G) and beltshift is also not playing a role if detection is incorrect (beltshift is the same at the left side while at the right side they are opposite but L/Regular == G/Shifted wrt In fact, G carriage can be seen as a L carriage centered around the inner magnet (right/left one when moving to the right/left) This observation could indeed help to start selecting solenoid earlier; this is only required if:
You have to take Note also that desktop would require some adaptation as well as I don't believe it tracks carriage changes (would be nice in general to track carriage changes) |
Agree, but we should rather change the Q&A direction, i.e. Desktop App sends a |
Yes, as we discussed before I agree it would be saner for the commands to be one-way, with only acknowledgements and status updates coming from firmware (or status updates could be omitted in favor of polling by the host, there are benefits to either approach I think). I agree too that the firmware has no business knowing the row number — in advanced multicolor modes it's not even a simple pattern row index. |
Yes, the desktop needs to change to send the data before knowing the carriage type (in fact, the whole "start machine" state is not necessary IMHO, you could treat the first row just like any other, and just start in "unknown carriage" state); but it wouldn't see a carriage change in that case, as the firmware wouldn't report a carriage type until enough needles have been passed to make sure it is not a G carriage, as currently. Alternately, the firmware could report an L carriage immediately and a G carriage later — this would actually "work" with the current desktop app. But as you said the desktop app doesn't handle carriage changes currently, so it would show an L carriage when using a G carriage. |
Agree with that as well, the first row is nothing special for the machine and can be transmitted before carriage detection/after machine configuration, it should also include start/stop needles to enable variable pattern width (and reqStart removed/agreed). API could therefore be something like:
No specific test mode/state/console either, everything can be driven from the above API. Should probably be discussed in a different forum/not the purpose of the issue :-) |
Comments from Discord for the records
From:@jonathanperret
From:@jpcornil-git
|
ISR processing starts with
... but, if there is an issue with that, it should apply to all carriages, not sure I understand how Wrt beltPhase, there is a difference with ayabAsync as well (I sample it at the extremum of the sensor waveform while ayab-firmware samples it at the first threshold crossing occurence -> bias to 'early' and more sensitive to threshold level) but it is less critical for Lace than others (South is more centered within the beltPhase waveform than North) -> shouldn't lead to a wrong beltshift selection for L but a more probable shift by 1 of the carriage position. Is my understanding of the issue below correct ?
|
As I mentioned, the V1/V2 naming in my report is arbitrary, I didn't care to check back with the service manual because it was not relevant here — particularly since it is clearly handled the same between the two firmwares. Also note I measured the time from encoder pulse to solenoid change, which is downstream from whichever ISR/main loop arrangement the firmware uses. My theory for how a difference in reaction time could make the lace carriage fail was that if
Interesting but since the waveforms are practically identical in the end between the two firmwares it seems unlikely there was a problem reading the belt phase signal. Note that the belt phase signal is not used to determine carriage position so an error reading it could not lead to a shift by 1 of the position. However the carriage position is indeed reset by There may still be an idea here. It might be that Adrienne's 930 is such that reading the left Hall sensor at the threshold vs extremum does lead to a ±1 difference in carriage position, but this doesn't happen on my machine. I'll try to think of a test that Adrienne could run to see if that could explain the difference. Thanks for the suggestion.
All good questions, I'll let @Adrienne200 fill in as I'm interested in the answers as well. |
The "directionality" tends to indicate that there is a bias of the carriage position but I believe you tested that on simavr and didn't see a difference. I'll wait for @Adrienne200 feedback as well. |
... 0.5s to cross the needle bed was extremely fast, you should apply for a guinness book world record :-) We should probably take 5ms/a 2x margin wrt expected worst case. Stress point for ayab-firmware will be when you are out of the active needles (less resistance/higher speed) and get Serial rx activity (consuming irq budget; ~100 instructions@16MHz or max. 10us/byte, and at 115200 baud about one byte/100us -> max. 10%/90% left/OK based on your measurement above). Hopefully the issue is sticky, i.e. when not there it is never there, as this would point towards initial carriage positioning (given that timing is the same as ayabAsync that doesn't seem to have the issue but has a different alignment strategy). Directionality points into that direction as well (too early in one direction means too late in the other, former is usually OK but not the latter, mostly left->right => shifted to the right=too early detection ?) while speed is probably related to inertia/mechanical ability for the solenoid to still pull the armature while already passed for a needle or two ... |
One thing you could do to test this hypothesis is to make a test build with START_OFFSET modified for KH910 when heading to the right (leave to the left as-is) with |
OK so there may be something in this sensor hypothesis. At least, I’ve managed to create a configuration in simavr, where To do this I changed the width of the sensor detection area in simavr to be 5 needles wide instead of just 1. Note that to exhibit the bug you’d also need my patch that simulates the inability to grab an armature when the cam isn’t pushing it down (see jonathanperret/ayab-simavr@5514458). Triggering the sensor for 5 needle widths seems excessive (on my 910 it is triggered for two needle widths), but not inconceivable if that machine’s sensor is particularly sensitive. Looking at the code in With a 5-needle wide trigger area, this means the position computed by Even a 3-needle wide area would cause a one needle position difference between the firmwares. |
5 is probably a strech but 3 is very common and varies over time, e.g. from old ayabAsync log files with L carriage:
|
You may also enable continuous reporting in ayab-desktop to fetch sensor data and confirm or not the above hypothesis |
So I just opened #218 — full writeup there but in essence what I'm trying is to use the left edge of the sensor signal instead of the right edge. Note that I kind of like what |
Just added some comments to #218 (mostly additional code cleanup), the same change should be applied to the right sensor (same problem -> you should use the first detection event as well). Proposed changes should fix the current issue if we are correct about the root cause, only side-effect is that there will be an offset of 2 on average between the position sets by the left and right sensors but this should be OK (offset in a safe direction) |
Users have reported mispatterning in lace quite often; I've seen it myself from the beginning. I originally thought that because the symptom is similar to the issue I logged in #161 of the Desktop software, its report should go there too. But it's quite likely that the lace issue is different, so while I'm moving #161 to the firmware section where it belongs, I'm splitting it into two separate reports. The lace one might even be easier to diagnose.
Here's the report from #161 about the lace carriage, edited slightly. Still reproducible in v0.95:
For this you need a lace carriage; typically the problem happens within 30-50 rows, (or fewer, I've see under 20) no need to knit hundred of rows.
Tips for using the lace carriage:
never let it select two needles forwards side by side, it MUST be only single needle patterns. The carriage will jam on the next row if 2 needles are selected together. Only use patterns designed for lace.
to actually knit from the sample lace pattern, you need to Mirror the image. That is, put it back to the way Brother designed it; for lace the automatic mirroring is not what you want. Not needed if you are just air-knitting to see this issue.
Use the pattern “910 lace 10-35 60x30.png” (attached) basic settings as usual, 2-color, start from row 0, start/stop=30, Infinite Repeat, Single, center.
Knit as usual, except using the lace carriage instead of the K carriage. If air-knitting, no need to use the K-carriage at all.
Keep knitting, waiting for the beep every row as usual. it’s OK to cross a turn mark sometimes, it will still fail anyway.
Notice that the pattern is regular, every row has only one needle selected per repeat, 10 needles apart.
Watch the selection, the every-10th pattern is consistent, until after 30 - 50 rows suddenly one row it’s different. It has selected some extra needles. They are regular, usually 4 needles offset from the actual pattern.
The rest of #161 is discussion that may not apply to the lace-carriage issue. Except there's this statement from Chris:
"The decision which pixel has to be taken for setting the needle is slightly different for the L carriage (https://github.com/AllYarnsAreBeautiful/ayab-firmware/blob/master/knitter.cpp#L315 and https://github.com/AllYarnsAreBeautiful/ayab-firmware/blob/master/knitter.cpp#L340, depending on the direction of the carriage) because it has a different mechanical length than the K carriage. These values were found empirically and therefore might be not perfect.
But in terms of timing for recognition of the current carriage position, it's the same as for the K carriage."
Lace.zip
The text was updated successfully, but these errors were encountered: