mesa7i76e + 7i85s stepper motor + encoder feedback
- Raban
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
05 Mar 2024 14:10 #295230
by Raban
mesa7i76e + 7i85s stepper motor + encoder feedback was created by Raban
Good morning everyone ,
My 3-axis xyz milling machine is equipped with stepper motors that work properly.
However, sometimes it happens that the Z axis loses steps due to the weight of the axis.
To improve the situation I added an encoder
to the ball screw.
Now I would like to add feedback to the z axis....
I tried to study the linux cnc documentation, if I understood it I'll highlight the lines of the hal file that I should modify.
net z-pos-fb <= hm2_7i76e.0.stepgen.02.position-fb ( actual configuration)
net z-pos-fb <= hm2_7i76e.0.encoder.xx.position (future configuration)
where xx is the encoder number
logically then I will also modify the ini file to scale the encoderAm I on the right path?
Thanks everyone for the help
My 3-axis xyz milling machine is equipped with stepper motors that work properly.
However, sometimes it happens that the Z axis loses steps due to the weight of the axis.
To improve the situation I added an encoder
to the ball screw.
Now I would like to add feedback to the z axis....
I tried to study the linux cnc documentation, if I understood it I'll highlight the lines of the hal file that I should modify.
net z-pos-fb <= hm2_7i76e.0.stepgen.02.position-fb ( actual configuration)
net z-pos-fb <= hm2_7i76e.0.encoder.xx.position (future configuration)
where xx is the encoder number
logically then I will also modify the ini file to scale the encoderAm I on the right path?
Thanks everyone for the help
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23297
- Thank you received: 4938
05 Mar 2024 14:40 #295233
by andypugh
Replied by andypugh on topic mesa7i76e + 7i85s stepper motor + encoder feedback
What you suggest there will detect following errors, but will not recover from lost steps.
You probably need to modify the hardware too. (Bigger stepper, lower gearing, closed-loop stepper, pneumatic countrbalance, something else)
You probably need to modify the hardware too. (Bigger stepper, lower gearing, closed-loop stepper, pneumatic countrbalance, something else)
Please Log in or Create an account to join the conversation.
- Raban
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
06 Mar 2024 09:38 #295305
by Raban
Replied by Raban on topic mesa7i76e + 7i85s stepper motor + encoder feedback
Thanks for the suggestion, the motor is a very large 12A, reduced 3:1 and the accelerations are also low.
How should I modify the hal file to also have a recovery of lost steps?
How should I modify the hal file to also have a recovery of lost steps?
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 20112
- Thank you received: 6845
06 Mar 2024 10:56 #295311
by tommylight
Replied by tommylight on topic mesa7i76e + 7i85s stepper motor + encoder feedback
What drives are you using?
The only open loop drives that are capable of actually doing something to compensate for lost steps are Lam Technologies drives, the DS series being the entry level, they have a Boost pin that can be used to send more current (programmable) to motors in case of lost steps/feed error, i did test that and it works properly.
Otherwise, with normal drives if the stepper stalls, sending more steps at the same rate or higher will not help, sending slower rates might help.
Maybe something can be done in hal to stop the stepgen and start it from 0 to try to move again after stall, but i never tried this.
The only open loop drives that are capable of actually doing something to compensate for lost steps are Lam Technologies drives, the DS series being the entry level, they have a Boost pin that can be used to send more current (programmable) to motors in case of lost steps/feed error, i did test that and it works properly.
Otherwise, with normal drives if the stepper stalls, sending more steps at the same rate or higher will not help, sending slower rates might help.
Maybe something can be done in hal to stop the stepgen and start it from 0 to try to move again after stall, but i never tried this.
Please Log in or Create an account to join the conversation.
- meister
- Offline
- Platinum Member
-
Less
More
- Posts: 527
- Thank you received: 331
06 Mar 2024 13:33 #295318
by meister
Replied by meister on topic mesa7i76e + 7i85s stepper motor + encoder feedback
Why not using a pid controller if you already have an encoder,
you can add a pid loop to the hal
you can add a pid loop to the hal
Please Log in or Create an account to join the conversation.
- Raban
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
11 Mar 2024 08:18 #295621
by Raban
Replied by Raban on topic mesa7i76e + 7i85s stepper motor + encoder feedback
thank you meister ,
That's exactly the idea, but how is it configured?
Can you direct me to some specific document?
That's exactly the idea, but how is it configured?
Can you direct me to some specific document?
Please Log in or Create an account to join the conversation.
- meister
- Offline
- Platinum Member
-
Less
More
- Posts: 527
- Thank you received: 331
11 Mar 2024 08:32 #295622
by meister
Replied by meister on topic mesa7i76e + 7i85s stepper motor + encoder feedback
Hi Raban,
not realy, i can show you my related part of the .hal
but don't know how to do this with mesa and how to do the real PID-tuning
```
setp pid.0.Pgain [JOINT_0]P
setp pid.0.Igain [JOINT_0]I
setp pid.0.Dgain [JOINT_0]D
setp pid.0.bias [JOINT_0]BIAS
setp pid.0.FF0 [JOINT_0]FF0
setp pid.0.FF1 [JOINT_0]FF1
setp pid.0.FF2 [JOINT_0]FF2
setp pid.0.deadband [JOINT_0]DEADBAND
setp pid.0.maxoutput [JOINT_0]MAXOUTPUT
setp rio.stepdir15.velocity-scale [JOINT_0]SCALE_OUT
setp rio.stepdir15.position-scale [JOINT_0]SCALE_IN
net j0vel-cmd <= pid.0.output => rio.stepdir15.velocity
net j0pos-cmd <= joint.0.motor-pos-cmd => pid.0.command
net j0pos-fb <= rio.stepdir15.position => joint.0.motor-pos-fb
net j0pos-fb => pid.0.feedback
net j0enable <= joint.0.amp-enable-out => rio.stepdir15.enable
net j0enable => pid.0.enable
```
```
[JOINT_0]
# stepdir15
P = 50.0
I = 0.0
D = 0.0
BIAS = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
DEADBAND = 0.01
MAXOUTPUT = 300
```
not realy, i can show you my related part of the .hal
but don't know how to do this with mesa and how to do the real PID-tuning
```
setp pid.0.Pgain [JOINT_0]P
setp pid.0.Igain [JOINT_0]I
setp pid.0.Dgain [JOINT_0]D
setp pid.0.bias [JOINT_0]BIAS
setp pid.0.FF0 [JOINT_0]FF0
setp pid.0.FF1 [JOINT_0]FF1
setp pid.0.FF2 [JOINT_0]FF2
setp pid.0.deadband [JOINT_0]DEADBAND
setp pid.0.maxoutput [JOINT_0]MAXOUTPUT
setp rio.stepdir15.velocity-scale [JOINT_0]SCALE_OUT
setp rio.stepdir15.position-scale [JOINT_0]SCALE_IN
net j0vel-cmd <= pid.0.output => rio.stepdir15.velocity
net j0pos-cmd <= joint.0.motor-pos-cmd => pid.0.command
net j0pos-fb <= rio.stepdir15.position => joint.0.motor-pos-fb
net j0pos-fb => pid.0.feedback
net j0enable <= joint.0.amp-enable-out => rio.stepdir15.enable
net j0enable => pid.0.enable
```
```
[JOINT_0]
# stepdir15
P = 50.0
I = 0.0
D = 0.0
BIAS = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
DEADBAND = 0.01
MAXOUTPUT = 300
```
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18479
- Thank you received: 5048
11 Mar 2024 15:46 #295645
by PCW
Changing the joint feedback source and tuning parameters are needed for encoder feedback.
(along with getting the encoder feedback in the correct direction and scaled properly)
Tuning can be done live using the calibrate menu.
_BUT_ as others have mentioned, simple adding encoders to a step/dir system will not solve a
missed step issue (though it can halt the system if this occurs) This is because when a missed
step occurs, the drive had insufficient torque and skipped one or more pole positions (1/50th of a turn)
Having the controller simply add more steps will not fix this (and least not without slowing the motion
significantly so the torque becomes higher)
Replied by PCW on topic mesa7i76e + 7i85s stepper motor + encoder feedback
If you use pncconf to create the original hal/ini files, a PID loop will already be setup for each joint.thank you meister ,
That's exactly the idea, but how is it configured?
Can you direct me to some specific document?
Changing the joint feedback source and tuning parameters are needed for encoder feedback.
(along with getting the encoder feedback in the correct direction and scaled properly)
Tuning can be done live using the calibrate menu.
_BUT_ as others have mentioned, simple adding encoders to a step/dir system will not solve a
missed step issue (though it can halt the system if this occurs) This is because when a missed
step occurs, the drive had insufficient torque and skipped one or more pole positions (1/50th of a turn)
Having the controller simply add more steps will not fix this (and least not without slowing the motion
significantly so the torque becomes higher)
The following user(s) said Thank You: meister
Please Log in or Create an account to join the conversation.
- Raban
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
12 Mar 2024 08:46 #295724
by Raban
Replied by Raban on topic mesa7i76e + 7i85s stepper motor + encoder feedback
Thanks PCW, it's very clear.
the goal is for the milling machine to stop if for some reason the z axis stalls.
otherwise, a rapid crossing with the z in the wrong position can cause a disaster
the goal is for the milling machine to stop if for some reason the z axis stalls.
otherwise, a rapid crossing with the z in the wrong position can cause a disaster
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.082 seconds