Deadband not behaving as expected.

More
15 Dec 2014 21:05 - 15 Dec 2014 21:09 #54020 by guymalpass
Hi,
I am running 2.8.0-pre1 and trying to tune the PID loop that feeds into a 5i25 stepgen to drive a stepper motor. I have started off with a P term of 50 and with I and D at 0. FF0=0, FF1=1, FF2=0. The stepper motor is microstepped at 3200 steps/rev and the encoder is mounted directly to it with 12000 counts/rev when in quadrature. The scales are calculated for my machine such that one microstep = 0.0049mm and one encoder count = 0.0013mm of linear travel.

My confusion surrounds the deadband, when set at 0 the axis oscillates around the commanded position at about +/- 1 microstep, as would be expected. When the deadband is set at the desired 0.01 the oscillation stops, all good. However if the motor is manually forced out of position the PID will only try to correct itself when the deadband is set at 0, if set to anything but zero the motor is happy to stay in it's now erroneous position.

Presumably deadband is set in machine units? Any guidance would be much appreciated.

Many thanks,
Guy Malpass
Last edit: 15 Dec 2014 21:09 by guymalpass.

Please Log in or Create an account to join the conversation.

More
15 Dec 2014 23:09 #54024 by PCW
Deadband is set in machine units

You should be able to check what's going on by watching the output of the PID component
and ferror while turning the encoder. Either Axis "show machine configuration --> watch -->pins"
or halscope will do

Can you set your ustep ratio higher? that may allow a smaller deadband

Please Log in or Create an account to join the conversation.

More
16 Dec 2014 00:34 #54026 by guymalpass
Hi Peter,
Results from a bit PID output watching with motor disconnected:
  1. With deadband set at 0.01; I input an MDI of g1 x2 f100, the pid output briefly shows a correcting figure but then goes to 0....even though the motor and hence encoder haven't moved.
  2. With a deadband of 0 (or something very small like 0.00001) the pid output is maintained until I manually move the motor/encoder to the commanded position

I can increase the microstepping on my drivers upto 25600 steps/rev. Do you intend for this to be a tool for diagnosing the problem or a solution? The reason I ask is because I want to minimise microstepping in order to retain torque.

Please Log in or Create an account to join the conversation.

More
16 Dec 2014 00:52 #54028 by PCW
Hmm what is ferror in case 1? sounds like the PID values are wrong

can you post your hal and ini files?

Also you _do not_ lose stall torque by increasing the u-stepping ratio. Its almost always best to
set this as high as possible within the step generators and the drives step/dir timing limits.

Please Log in or Create an account to join the conversation.

More
16 Dec 2014 02:18 #54033 by guymalpass
Ini and hal files attached.
Is it the dynamic ferror you require from halscope or the figures with the ini?
You make an interesting point about microstepping as it seems to be to the contrary to many things I have read, eg: www.micromo.com/microstepping-myths-and-realities



File Attachment:

File Name: Mesa.txt
File Size:3 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
16 Dec 2014 02:19 #54034 by guymalpass

File Attachment:

File Name: Mesahal.txt
File Size:11 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
16 Dec 2014 02:32 #54035 by guymalpass
Attached is a photo of watched hal pins during the g1 x2 move.
Attachments:

Please Log in or Create an account to join the conversation.

More
16 Dec 2014 02:49 - 16 Dec 2014 02:54 #54036 by PCW
One fairly obvious thing that needs fixing in the hal file is the PID maxerror (its was set for a specific inch config)
you probably need to set it to 0 (unlimited)

On the microstepping, I think people tend to misunderstand that pages use of the term _incremental_ torque.
higher ustep ratios _do not_ affect the _stall_ torque so until you get into diminishing returns
(around 32 to 64 usteps/step on good drives/motors) its always good to go as high as you can
resulting in improved smoothness.

Imagine the stepmotor as a rotor pulled around by a spring in the stator.
At low ustep ratios the stator end of the spring can only move to rather coarse
positions, at high ustep ratios the stator end of the spring can move in smaller steps
This does not affect the stiffness of the spring, so the force needed to displace the rotor
1 ustep from its unloaded position is inversely proportional to the ustep ratio
(so incremental torque goes down with increasing ustep ratios simply because a single ustep gets smaller),
but the force needed to displace the rotor 1 full step (the stall torque) remains the same
Last edit: 16 Dec 2014 02:54 by PCW.
The following user(s) said Thank You: guymalpass

Please Log in or Create an account to join the conversation.

More
16 Dec 2014 02:57 #54037 by guymalpass
Thankyou, I will go and change that. I will also increase my microstepping in that case, I'll go and put it at 12800 steps/rev which would result in a linear travel of 0.0012mm and set my deadband at 0.005.

Please Log in or Create an account to join the conversation.

More
16 Dec 2014 03:14 #54038 by guymalpass
Mixed success, I still have the same deadband issue whereby with it set at 0.005 the pid output shows a brief output and then goes to 0 regardless of what's happening with the encoder. However with the increased microstepping resolution the motors will settle at the commanded position with a deadband of 0 and correct themselves if moved.

Please Log in or Create an account to join the conversation.

Time to create page: 0.165 seconds
Powered by Kunena Forum