2012/12/20 Andrew <[email protected]>: > >> Motors have a load - they are installed in the machine. Sometimes PID >> gets saturated and runs away as soon as I touch jog button. Restarting >> LinuxCNC solves the issue and I can jog motor normally. > > > That might be wrong Hall pattern. >
This morning I went through _all_ Hall patterns. Pattern no 25 was the only one turn motor equally smooth in both directions. _All_ remaining patterns made the pid controller to saturate. > > I suggest you to set bldc scale positive (I have a feeling it's meant > positive) and invert encoder scale instead. > If that wont't work, try different Hall patterns. > Also, are you sure about 8 poles? Bldc receives its encoder data from encoder rawcounts pin, which is not affected by input_scale parameter. I should swap encoder phases to reverse the direction of motor movement in which rawcounts would increase in positive direction. Yes, I am totally sure about 8 poles, because: 1) motor datasheet says so; 2) I did not trust chinese datasheet, so I checked for myself - one full turn of motor shaft equals to 4 cycles of hall pattern, which means - there are 4 electrical revolutions in one "real" turn, which means 4 pairs of poles = 8 poles. 2012/12/21 andy pugh <[email protected]>: > On 20 December 2012 21:03, Andrew <[email protected]> wrote: > >>> I suggest you to set bldc scale positive (I have a feeling it's meant >> positive) > > No, negative is equally likely to be correct in the bldc component as > positive. > > I would try the motors in pure-h mode and see how it works out. I did these things: 1) Removed motor from its place Based on Peter's suggestion I jogged it back and forth while trying to hold the motor shaft. Torque seemed to be equal in both directions. Then I continued to jog it back and forth for a minute or two and then repeated "torque test". It was still felt the same in both directions. If I managed to grab it strong enough to stop the motor, PID went saturated (I also watched pid.output pin in HalMeter). Motor catched up its position as soon as I released the shaft. 2) Then I simply turned the motor by hand in any direction up to a full turn away and then released the shaft to see, if it will return to its position. Every time it did return. What I observed is that pid got saturated as the motor was 20-30 degrees from its commanded position. I guess that tuning is pretty tight. 3) In HAL file I set bldc cfg=h for that particular motor. Then I tried to jog it around - motor turned smoothly. I did the "torque test" - it felt the same in both directions. I even installed it back in its place - it was fine. The thing is that first time after I switched back to cfg=qh, it got saturated as soon as I touched jog button. Restarting LinuxCNC solved it and here is a screenshot from HalScope with encoder velocity, pid output and following error charts: http://picpaste.com/halscope_cfg_qh-vjwycpRH.png How can I make those lines smoother? I am trying to play with P, I and D, but I do not see any improvement. I can get the overall ferror bigger or smaller, but I would like to make the line itself smoother - it seems too much of vibration there (although I do not hear/see it on motor). It oscillates by 0.005 mm, encoder scale is 2000, which means 0.0005 mm per pulse, difference is 10 times. It also shows that pid output reaches approximately 0.25, while limit is 0.65. This motor moves the Z axis, which has plasma torch mounted on it, so the load should remain approximately as it already is there. I do not see any reason for the pid controller to get saturated due to load. -- Viesturs If you can't fix it, you don't own it. http://www.ifixit.com/Manifesto ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
