Joint following error right after clicking on Machine Power ON (7i97 LCNC 2.9)

More
23 Nov 2020 20:33 #190142 by shadab
Hello Everybody,
We are trying to retrofit an old servo drive system for a VMC and we want to use the MESA 7i97 along with LinuxCNC to make it all work.
We got LinuxCNC to startup correctly by modifying the HAL/INI files provided by PCW in this link . As soon as we go into AXIS home screen we tried to turn the machine power on by clicking on the icon(or pressing F2), but immediately we face a joint 0 following error and the machine is stopped again by LCNC.

Here are the things we tried to correct the issue:
  • As suggested by some of the posts here we tried to increase the FERROR and MIN_ERROR parameters in INI file and increased them. but the error still exists.
  • Verified the encoder scale and the encoder feedback on the encoder 0 pins using HAL SCOPE
  • Tried to tune the PID by decreasing the values
  • Checked the servo thread jitter and verified that the Latency.

Our problem is as soon as the machine is powered on using F2 the machine automatically Starts to move for a small moment before we get the error. At this point we haven't even given any jog command or home command, the JOINT 0 starts to move as soon as Click on machine Power ON.

We tried to SCOPE some things (PFA below), we found that as soon as we give the power on command there is some signal on the analog-out pins and the PID loop starts to compensate for the movement as the current position command is essentially 0. We suspect that due to the current position command being 0 and there is movement and thus feedback on encoder pins we get a joint following error because no actual command was given to the motor.

We have scoped the encode channel A and pwmgen.0.value in one image and pid.0.pos and encoder0.velocity in another image. The signals you see are there as soon as we click on Machine power on, no other inputs were given.


File Attachment:

File Name: 7i97.ini
File Size:5 KB

File Attachment:

File Name: hm2-servo-7i97.hal
File Size:9 KB
Attachments:

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

More
23 Nov 2020 20:52 - 23 Nov 2020 21:04 #190143 by PCW
I would say that the P term is way too high, causing oscillations
In addition, The FF1 value is incorrect, FF1 can only be 1.0
if the output scale = the velocity at 10V.
In addition the maximum velocities in the INI file seem very low
(8.333 mm/second in X and 1 mm/second in Y)

BTW The I term should always be 0 for initial tuning
Last edit: 23 Nov 2020 21:04 by PCW.
The following user(s) said Thank You: shadab

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

More
24 Nov 2020 16:56 #190207 by shadab
Hi,
We followed your suggestions and now we don't get the F-Error immediately after turning on the machine.

We have observed that even though we don't give any jog command or home command we see that the axis keep moving. There is some type of drift happening. What can be the reason for this?

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

More
24 Nov 2020 17:02 #190208 by PCW
When it drifts, does the encoder position change? If so I would expect the feedback to correct the drift.

Can you plot the commanded position, feedback position and PID output and also paste your
current PID parameters here?

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

More
24 Nov 2020 17:41 #190209 by shadab
Yes, the encoder position does change. I have attached a couple of pics above, similar thing happens. I will get the current requested plots tomorrow.
As far as PID parameters are concerned for this JOINT: P = 1.0, and rest everything including FF parameters are set to zero.

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

More
More
27 Nov 2020 07:59 - 27 Nov 2020 08:55 #190404 by shadab
Hi,
We were following the above-mentioned servo procedure for tuning. We tuned the P gain and when we were tuning the FF1 value we got it to work for short jogs of 0.1mm as less. But on continuously jogging we found that the machine was always going in the F-ERROR.

We scoped the analog out pin of the mesa board and found that the output voltage was on; 1v when it should've been 10v.

OUTPUT_SCALE is set to 10
pwmgen.00.value was 10 at the time.

From the stepgen doc on linuxcnc site duty cycle dc=value/scale
So based on this our dc was 1.0 which should give us 10v at output but we only got 1v.

And in the pwmgen doc one parameter was missing when compared to the HAL file PCW provided us, the pwmgen.00.offset-mode was not present in the documentation for pwmgen. Are we looking at the wrong place for the documentation?

Edit: added files

File Attachment:

File Name: 7i97_2020-11-27.ini
File Size:5 KB

File Attachment:

File Name: hm2-servo-...1-27.hal
File Size:9 KB
Attachments:
Last edit: 27 Nov 2020 08:55 by shadab.

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

More
27 Nov 2020 14:37 - 27 Nov 2020 14:42 #190446 by PCW
You have

OUTPUT_SCALE = 100
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10

in your .ini file

The combination of OUTPUT_SCALE = 100 and MAX_OUTPUT = 10
will bound the analog output to +-1V

Are you using the latest master?, my hostmot2 man page shows this:
(bit input) offset-mode
              When true, offset-mode modifies the PWM behavior so that  a  PWM
              value  of  0  results in a 50% duty cycle PWM output, a -1 value
              results in a 0% duty cycle and +1 results in a 100%  duty  cycle
              (with  default  scaling)  This  mode  is  used by some PWM motor
              drives and PWM to analog converters.   Typically  the  direction
              signal is not used in this mode.
Last edit: 27 Nov 2020 14:42 by PCW.

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

More
28 Nov 2020 10:15 - 28 Nov 2020 10:32 #190499 by shadab
Hi,
We corrected the scale value, due to the tuning we were doing I had changed the scale value. Now both MAX_OUTPUT and OUTPUT_SCALE are 10 and -10 respectively.
I had checked another post where you had suggested a few things to verify while debugging this error:
forum.linuxcnc.org/38-general-linuxcnc-q...nt-0-following-error

I can confirm that my encoder scale is correct and the output scale is correct as well. We manually measured the axis movement after jogging the axis discretely for 10mm using 0.1mm jogs. Encoder direction and scale are correct.

One observation I have is that when we remove the encoder and then try jogging we get good acceleration and movement. 10v should corresponds to 75mm/sec speed in our drive. Without encoder if i use continuous jog the output voltage on mesa card and the speed of drive match.

When we connect back the encoder, the observed velocity reduced drastically, and hence we are getting the following error. The scale is -10 and pwmgen.0.value also goes till 10, in this case there should be a lot of acceleration in the drive, but the drive barely moves.

here is a screenshot of HAL_SCOPE with encoder attached.


File Attachment:

File Name: 7i97_2020-11-28.ini
File Size:5 KB

File Attachment:

File Name: hm2-servo-...1-28.hal
File Size:9 KB
Attachments:
Last edit: 28 Nov 2020 10:32 by shadab.

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

More
28 Nov 2020 10:43 #190502 by shadab
Hi,
Without the encoder as we increase our jog speed or reduce it we get the output accordingly. The movement speed also changes. When we connect the encoder the output speed is very less. According to our observation the output speed with encoder never goes above 0.5mm/min no matter what velocity we keep in jog speed slider.

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

Time to create page: 0.136 seconds
Powered by Kunena Forum