Forum Replies Created
-
AuthorPosts
-
JuKuMember
> The deceleration should be actually starting when the switch transition occurs. Please let me know if you see evidence to the contrary – that would be a bug.
Unfortunately, I do see the contrary. These are the settings:
$z [zam] z axis mode 1 [standard] [zvm] z velocity maximum 1000.000 mm/min [zfr] z feedrate maximum 1000.000 mm/min [ztm] z travel maximum 80.000 mm [zjm] z jerk maximum 2000 mm/min^3 * 1 million [zjh] z jerk homing 5000 mm/min^3 * 1 million [zjd] z junction deviation 0.0100 mm (larger is faster) [zsn] z switch min 3 [0=off,1=homing,2=limit,3=limit+homing] [zsx] z switch max 2 [0=off,1=homing,2=limit,3=limit+homing] [zsv] z search velocity 1000.000 mm/min [zlv] z latch velocity 1000.000 mm/min [zlb] z latch backoff 25.000 mm [zzb] z zero backoff 0.000 mm tinyg [mm] ok> tinyg [mm] ok> $3 [3ma] m3 map to axis 2 [0=X,1=Y,2=Z...] [3sa] m3 step angle 1.800 deg [3tr] m3 travel per revolution 8.000 mm [3mi] m3 microsteps 2 [1,2,4,8] [3po] m3 polarity 1 [0=normal,1=reverse] [3pm] m3 power management 0 [0=remain powered,1=power down when idle] tinyg [mm] ok>
Note the long zlb value. On homing, the z travels all 25mm, even though it certainly has enough time to stop. On slower zlv settings, it does stop right after the switch clears. I tried on other axis which have different settings, but their behaviour on my machine is as you say.
Btw, I was NOT correct about the latch backoff functionality. I thought the machine would start from the “bottom” of the switch and always back off the specified amount (like my z behaves now). I think I get it now, and I need to change my settings – or maybe not, I actually like the current behaviour. Fast settings produce good clearing for the switches (although not as you intended) and the homing is swift.
And if I may phrase it a bit differently, this is how I now understand homing operation (please correct me if this is (still) not right): When the homing cycle has stopped at the “bottom” of the travel, it starts backing away at the specified speed*. When the switch clears, the machine has picked up some speed, but it stops when it can*. The resulting end position has nothing to do with latch backoff value, but is a function of the speed and jerk settings.
(*: Latch velocity and jerk homing values are used)
JuKuMemberI understood that latch backoff means the amount of travel that is done to other direction homing switch trips, and it is my responsibility to set it big enough that it actually clears the switch. Also, I thought that zero backoff is an additional parameter that I can set (if I want to) to make workspace zero different from the hardware limits.
So, what the latch backoff is supposed to be used for?
I did some more poking. Empirically, it seems that if latch velocity is small, it is ignored. The machine moves slowly and stops as you say, as soon as the switch clears. If the velocity is large, it moves the full latch backoff amount.
JuKuMemberI played with it some more this morning. I found that:
– Jerk setting has a noticeable effect to where it stops – as expected. When using the fast end of the machine, speed also has an effect. So, when I got different stopping positions at speeds 1000 and 2000, nothing is wrong.
– At slow latch and search velocities, it does not obey the latch backup setting, but stops as soon as the switch is cleared. This I think is the real issue.
My 1/3 – 2/3 results at speeds 500 was likely the “right-at-the-limit” setting for yesterday’s star positions. Today, I didn’t get any random results, the machine stopped either at the switch or the specified backup position.
Workaround: Don’t be ridiculously slow. 🙂 So, while you do want to fix this, it is not urgent for me.
- This reply was modified 11 years ago by JuKu.
JuKuMember>First, levers are less accurate than buttons as there is a lot of variation in the throw.
True, but not this much. And that does not explain the repeatable dependence from speed.
>Is the Z latch backoff long enough to always back off the lever? How much travel does it take to always back off the lever?
I haven’t examined the minimum required. The specified 6mm is certainly enough. In all the tests I can hear the switch clicking both ways. It is always clearing the switch, but it seems to have a hard time figuring out when to stop when backing away.
>Can you post your Z settings?
Those are at the top of my post. Scroll the window sideways to see all of them.
- This reply was modified 11 years ago by JuKu.
JuKuMemberFine!
I doubt not many people would want to reset the board with some other processor; those who do can figure out the polarity. The fan pinout is useful.
Off topic: for reset, I wired this over the reset connector. Rather handy when things go off and I don’t need to aim for an quick stop: http://www.sparkfun.com/products/9181. Besides, it looks kind of cool. 🙂
JuKuMemberIt is very clear and visible to me.
> Did I miss anything?
Reset and fan connector pinout/polarity.
JuKuMemberYes, I do multithread also. 🙂 But I am also doing optical alignment, and for that to work, I need to be sure the machine is not moving and the position information is updated before taking a look.
JuKuMember> I need to see what you are getting back from the end of homing.
When I started to collect data for a response, I found that the bug has to do with zero backoff. Here is a log, with some comments added:
{"xzb":0} // <======= Zero backoff to 0 {"r":{"xzb":0.000},"f":[1,0,10,2510]} g28.2 x0 {"r":{},"f":[1,0,9,4402]} {"sr":{"coor":0,"dist":1,"home":0,"cycs":3}} {"qr":28} {"qr":27} {"sr":{"mpox":-2.895,"stat":9,"momo":1,"macs":5,"mots":1}} {"sr":{"mpox":-8.465,"hold":3,"mots":2}} {"sr":{"mpox":-9.385,"hold":4}} {"qr":27} {"sr":{"mpox":-6.638,"hold":0,"mots":1}} {"sr":{"mpox":-0.929,"hold":3,"mots":2}} {"sr":{"mpox":-0.109,"hold":4}} {"sr":{"mpox":0.000,"stat":3,"coor":2,"momo":4,"dist":0,"home":1,"hold":0,"macs":3,"cycs":0,"mots":0}} {"qr":28} // <=== Homing ended cleanly with "stat":3 and "all buffers free" {"xzb":2} // <=== Setting zero backoff to != 0 {"r":{"xzb":2.000},"f":[1,0,10,5205]} g28.2 x0 {"r":{},"f":[1,0,9,4402]} {"sr":{"coor":0,"dist":1,"home":0,"cycs":3}} {"qr":28} {"qr":27} {"sr":{"mpox":-2.747,"stat":9,"momo":1,"macs":5,"mots":1}} {"sr":{"mpox":-8.415,"hold":3,"mots":2}} {"sr":{"mpox":-9.235,"hold":4}} {"qr":27} {"sr":{"mpox":-6.340,"hold":0,"mots":1}} {"sr":{"mpox":-0.779,"hold":3,"mots":2}} {"sr":{"mpox":0.041,"hold":4}} {"qr":27} {"sr":{"mpox":1.778,"hold":0,"mots":1}} {"sr":{"mpox":2.041,"stat":3,"macs":3,"mots":0}} <=== and the "stat":3 comes one message early. A bug? {"qr":28} {"sr":{"mpox":0.000,"coor":2,"momo":4,"dist":0,"home":1,"cycs":0}} {"qr":28}
> I also want to see what behavior should occur if a non-drawable line is received.
Another log:
g0 x1 {"r":{},"f":[1,0,6,4399]} {"sr":{"mpox":0.001,"stat":5,"macs":5,"cycs":1,"mots":1}} {"qr":27} {"sr":{"mpox":0.998}} {"sr":{"mpox":1.000,"stat":3,"macs":3,"cycs":0,"mots":0}} {"qr":28} g0 x1 {"r":{},"f":[1,0,5,4398]}
Here, it would be cleaner if there would have been a response {“sr”:{“mpox”:1.000,”stat”:3, … even though the second g0 x1 is an empty command in real life.
Please note, that the bug (if it is a bug; I have misunderstood things earlier! 🙂 ) or the missing status report are no problems at all. The logic above seems to work by today’s experiments, my code works just fine. And now when the behaviour is on the forum, others will not lock their code for waiting for “stat”:3 that will never come or have their machine one location message off after homing either. 🙂
- This reply was modified 11 years, 1 month ago by JuKu.
JuKuMemberAnswering my own question to share my experiences during last two days: As said, the goal is to recognize TinyG idle state, where all status variables are up to date and the machine state or position will not change anymore. The following logic seems to work for my application:
In the controlling software:
– Filter movement commands beforehand, so that commands that don’t result in movement, are not sent to TinyG.
-Home one axis at a time.In the TinyG interface setion, my communication is set up so that only full lines get processed. The line iterpretation routine logic is:
-If homing for axis q (where q is x, y or z; I don’t have homing on other axis), wait for a line that has both “mpoq”:0.000 and “coor”:2 => handle it as a status report (update all status variables), fire ready event and return.
-If line starts with {“sr”: => handle it as a status report. If it also contains “stat”:3 , fire ready event. Return.
-If line starts with {“r”:{“sr” , it is the response for asking a status report => Remove the wrapper, handle line as a status report, fire ready event and return
-If line starts with {“r”: , it is a response for asking or setting a setting or setting group => replace all “n” (where n = 1, 2, 3 or 4) with “motor_n” to get valid field names for Microsoft JavaScriptSerializer class (and other JSON interpretes, I suppose). Handle line as a settings report (updating UI where applicable etc), fire ready event and return.
—
The issues that caused some thinking were ‘no movement’ commands (that send out an empty status report) and a bug(?) in homing routine: On X axis homing, the stat:3 report comes the second to last status report, not the last. Firmware is 392.65, btw.JuKuMember>What problems are you running into?
I find very difficult to figure out when TinyG has sent all the infromation it has to send. I’d like to find a non-leaking way to patiently wait until I have all the information there is to come, but not lock up waiting for something that is not coming.
Keeping track of the buffers does not work, in some cases (homing at least) it reports 28 buffers and then does the operation. Not all status reports include the stat, and stat:3 is not always the last status report sent.
But your tips have alrady been helpful, my communication routine is already simpler and better. Maybe homing and zero movement commands are indeed the only exeptions to the stat:3 rule? If so, I think I can build workarounds.
JuKuMemberLook at your terminal program settings. Some programs can be configured to send LF ehen you press enter. At least Teraterm does this, if I recall right.
September 18, 2013 at 6:39 am in reply to: Using TinyG with SSR Relays.. Not Turning On Relays? #4534JuKuMemberThe (logic level, straight from the microcontroller) output from TinyG can’t supply the current the relay needs. You need a relay driver.
JuKuMemberI would much like this too. I would get the initial position of Z in the start of a run, and use homing without reset as a probe for component height on my pick and place build. (The pick-up needle is spring loaded with a sense switch.)
JuKuMemberDoh, user error. Too many settings for my simple brain. I was ignoring the aam setting. Setting that to 1 gets the expected behaviour. Thank you for your support!
JuKuMemberApparently it was noise on my switch lines. Even though I have shielded motor lines and shielded switch lines ans everything is properly grounded, filtering the switch input helped.
For the record, I put 100R in series with the switch line and 100n capacitors to ground after the 100R. This cured the noise issue. The extra protection does not hurt either. (You might want to add a note to the wiki snd maybe, if there ever is going to be v8…)
-
AuthorPosts