PID Loop for stepper motors
- Ameone
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 8
10 Feb 2020 16:27 #156968
by Ameone
Replied by Ameone on topic PID Loop for stepper motors
Ok thanks! Regarding the encoder scale, I have a rotary encoder with a resolution of 2000 steps/rev. Since it's directly connected to the motor axis, I've concluded an encoder scale of 2000/360 = 5.55. Is it correct?
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17992
- Thank you received: 4838
10 Feb 2020 17:13 #156972
by PCW
Replied by PCW on topic PID Loop for stepper motors
Is this a rotary axis?
Is it a 2000 PPR encoder?
Is it a 2000 PPR encoder?
Please Log in or Create an account to join the conversation.
- Ameone
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 8
10 Feb 2020 17:17 #156973
by Ameone
Replied by Ameone on topic PID Loop for stepper motors
Yes, rotary acis with a 2000 ppr encoder!
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17992
- Thank you received: 4838
10 Feb 2020 17:24 #156975
by PCW
Replied by PCW on topic PID Loop for stepper motors
Right so the scale would be 22.2222222
(8000/360)
This is because a 2000 line (PPR) encoder has 8000 counts per turn
when using quadrature.
(8000/360)
This is because a 2000 line (PPR) encoder has 8000 counts per turn
when using quadrature.
Please Log in or Create an account to join the conversation.
- Ameone
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 8
10 Feb 2020 17:26 #156976
by Ameone
Replied by Ameone on topic PID Loop for stepper motors
Ok thank you very much, tomorrow I’ll retest everything and let you know if it works.
Please Log in or Create an account to join the conversation.
- Ameone
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 8
11 Feb 2020 13:31 #157050
by Ameone
Replied by Ameone on topic PID Loop for stepper motors
Ok so my mistake, the encoder has 1000 PPR. I've tried to move the axis at 90 degrees using both 1000/360 and 4000/360 encoder scales. The scale 1000/360 gives the correct effective angle, is there some problem?
Also, do you know why the axis moves so slowly, without changing speed?
Also, do you know why the axis moves so slowly, without changing speed?
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17992
- Thank you received: 4838
11 Feb 2020 13:38 #157051
by PCW
Replied by PCW on topic PID Loop for stepper motors
Maybe this is a terminology issue
A 1000 PPR encoder has 1000 slots and will generate 4000 counts per turn in quadrature 4X mode
A 250 PPR encoder has 250 slots and will generate 1000 counts per turn in quadrature 4X mode
Posting your hal/ini files would be the quickest way to diagnose your motion issues.
A 1000 PPR encoder has 1000 slots and will generate 4000 counts per turn in quadrature 4X mode
A 250 PPR encoder has 250 slots and will generate 1000 counts per turn in quadrature 4X mode
Posting your hal/ini files would be the quickest way to diagnose your motion issues.
Please Log in or Create an account to join the conversation.
- Ameone
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 8
11 Feb 2020 13:56 #157054
by Ameone
Replied by Ameone on topic PID Loop for stepper motors
Ok thanks, I'm attaching the files!
Attachments:
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17992
- Thank you received: 4838
11 Feb 2020 14:17 #157060
by PCW
Replied by PCW on topic PID Loop for stepper motors
At first glance:
you still have statements like
setp pid.a.maxerror .0005
These all need to be removed
Also you have the maxvel on the rotary axis set to 11 degrees per second which is pretty slow
you still have statements like
setp pid.a.maxerror .0005
These all need to be removed
Also you have the maxvel on the rotary axis set to 11 degrees per second which is pretty slow
Please Log in or Create an account to join the conversation.
- Ameone
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 8
11 Feb 2020 14:39 #157062
by Ameone
Replied by Ameone on topic PID Loop for stepper motors
Yeah I modified only the x axis (axis 0) to speed up the configuration. I'll modify the other ones later on.
Sorry but where did you see that 11 degrees per second speed?
Sorry but where did you see that 11 degrees per second speed?
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds