EtherCAT + RPi build log along with questions

More
4 years 2 months ago #249630 by LAUSCH
Hi pseudo,

Would it be okay for you to share one of your working parameter file from Motion Studio?
Right now I am wondering what is the best setup for parameter P1.15 Control Switching Mode. There are several options.

Cheers
The following user(s) said Thank You: pseudo

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

More
4 years 1 day ago #255620 by pseudo
Hey Lausch, apologies again for the belated response, I'm not on here much.
I just saw your messages and they were actually surprisingly helpful for me... there's been a few issues with my prototype that, in the context of your message, appear to all be related to the issues you covered. My machine has rapids of 60m/min on one axis and the following error can be up to 6mm during a rapid traverse.... which doesn't matter too much for the rapids but I was getting weird cases where the system would overshoot past soft limits which I'd not seen with linuxcnc before... I've been pretty swamped with developing the rest of the machine (I can't post pics/details of it here just yet for business reasons outside my control, I'll try and DM you when I get a chance) so figuring out the source of these issues was on the backburner while I built the rest of it.
The project is getting close to finished and all the 'not right now' problems are getting addressed which lead me to check this thread and your input has made a lot of motion oddities suddenly make sense, thanks :)


Feel free to upload your current hal/ini if you like, it's highly likely I'll learn a lot from it.

I'll reply later (heading out the door at the moment) with more details from my end but needless to say my config is likely less optimised than yours ;)
The following user(s) said Thank You: LAUSCH

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

More
3 years 8 months ago - 3 years 8 months ago #263783 by pseudo
Hi Lausch, how did you go with your setup?
I noticed something in one of your posts about leadshine setup that isn't ideal: "Pr0.2 Real-time auto-gain tuning = 2 (position mode)" - that's for point to point motion not interpolated motion... that happens a lot in the manual, a lot of things that have 'position' in their name are for point to point, usually it says in a footnote or somewhere in the 5.2 section of the manual.

Also Pr0.0 Mode Following Control = 1 (automatically sets bandwidth) it says "If multi-axis synchronous movement needed , set Pr000 as the same for all the axes", where 0(auto) or 100+ is valid. I dramatically reduced my following error by increasing it up to 2000... though then I ran into a weird issue where the stiffness settings would be fine in the leadshine motion test page (ie smooth, low following error, no noise) but would get noisy if you moved the motor via ethercat/lcnc.... so I had to lower it which brought some following error back in.

oh and pr1.15... yeah I'm confused as well, digging into that one myself.

An interesting side note of the mode following control value is the timing portion of ethercat - some of the random forum posts etc I've read mentioned that the sync0cycle time should match the position/velocity loop of the drive, and from what I can tell pr0.00 is where you set that.... I think.

If you get a chance upload your ini/hal etc, I'm having trouble setting up the velocity mode with PID and cia402 though I've likely missed something simple. Did you need to change anything on the drive?

I've upped one of my leadshine configs though I'm no expert on them or anything.

Edit: had to zip the leadshine conf file
Last edit: 3 years 8 months ago by pseudo. Reason: attachment format

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

More
3 years 8 months ago #263791 by pseudo
Ooook trying to replicate your work took forever... because I was missing one small part: CIA402 in velocity mode needs a setp cia402.0.velo-scale xxx  line in your hal (see attached modified CIA402 example hal)... I could not find this info anywhere so I ended up reading through the cia402.comp hal component to figure it out. Adding it here so others don't have to spend ages figuring it out like I did.

Also adding some search terms... setp cia402.0.csp-mode 0 comes up with zero results beyond the github and I spent ages looking for more info

Search junk:
cia402 velocity mode csv
cia402.0.drv-target-velocity cia402.0.velocity-cmd
The following user(s) said Thank You: LAUSCH

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

More
3 years 8 months ago #264010 by LAUSCH
Hi pseudo,

Now I'm the one with the late answer - sorry for that, but I've been really busy with work over the last few months.
The setup and fine-tuning of the drives not only took a lot of time, but also had its ups and downs. In the meantime, I have a working setup (you can find all the files attached to this post), but there were many lessons to learn and there are still many things to learn and optimize.

1.) I have also come to the point that Pr0.02 must be 1 for "Velocity Mode".
2.) The machine works when Pr0.00 is set to 1 for all axes, but your comment is correct and I missed that statement in the manual. I will try 0 or 100+ and report back on the results.
3.) Regarding my experience with PID: As you can see in my INI/HAL, there is a PID put in place. Initially the parameters were set to achieve the lowest possible following error (<0.01mm) while still keeping the machine stable at higher speeds (10m/min). But when operating the machine, cracking noises could be heard. At first I thought these were coming from the mechanics, later I found out that this was coming from the PID. Then the PID was disabled by setting all parameters to 0 except FF1 which is set to 1. The machine worked although having larger follwing errors and the results were amazingly good! BUT - and of course there has to be one - I had another strange problem. When the machine was switched off after moving to any position, the current set position was set equal to the commanded position, thus ignoring/overwriting the feedback from the abosolut encoder! Since there is always a small difference between the commanded position and the target position, there were growing deviations when several parts were machined in succession without a zero point being set in between, or when the machine was switched off and on several times for a single part.
Therefore, you can now find very low values for the integral part of the PID with P=5.

As the machine is running and the first projects were granted higher priority there was not much more fine tuning and optimization the past months. But knowing there is someone working on the same setup is motivating me againg to look deeper into the topic. I hope that we can find the best setup for this sort of setup and can post it soon.

Many thanks for your input!

PS: Please apologize for the messy HAL/INI file with german and english comments all mixed up.
PPS: I am very curious about your machine and would be happy to know more about it. You can find a picture of mine in the attachments (the first to be uploaded at all)

Cheers Christian
 

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

More
3 years 8 months ago #264081 by pseudo
Hi Lausch, no need to apologise, I've been pretty busy too.

Setting up the drives took a while: yeah... they're capable but I suspect that there's a bunch of 'smart' things happening that are making them useless in position mode (eg they'd settle with a huge steady state error etc) and the documentation/software isn't clear on what might be doing that... but PID back to LCNC in vel mode works well. I guess that's the difference between a $10k yaskawa setup and these :shrug:

PID: yeah, I have mixed settings:
  • Z axis has a ~1:1 inertia ratio (aka ~100 in the software), but is horizontal (ie not impacted by gravity) and has the least mass to move. It only needed ff1=1 and a P of 40
  • Y axis has a ~1:1.5 but has ~10-15kg to lift on a 10mm pitch screw so gravity has a huge impact. I couldn't figure out the bias value in time for a deadline so it's got a less than ideal tune but still does very well, P=70, I=0.5, D=1.2. FF1=1. Bias is 0 but it needs one I think, very asymmetric load.
  • X axis is another story... I'm not sure what the inertia ratio really is... the software craps out around the 1000 mark (ie 1:10) but prior to the LCNC PID change I got it to tune with 888 value though with less than ideal following error. This axis is a 400W servo directly into a dual output 5:1 very low backlash servo gearbox, with a shaft running to either side of the gantry to a pulley. The axis drives itself along a pair of ATL5 belts in omega configuration (ie fixed belt, pulley crawls along the belt, basically the quiet version of a rack and pinion). The LCNC PID for this axis is... also not great, but vastly better than it was. I haven't been able to get a tight tune though I'll revisit it before the prototype goes to its owner. The issue I have is oscillations, both high frequency ones and very low frequency ones. Low P value relative to the others, and Fortunately this application has the X axis predominantly doing long swooping back and forth motions (4m travel) so it works well with lower accelerations and a slightly looser tune (following error is still <0.5mm on 60m/min rapids)... I've since done a test cut at 40m/min in the cut (foam) and it cut perfectly... finally. P=70, I=15, D=0.15. FF1=1. Lotta room for improvement on this one though.
One of the issues with tuning the LCNC PID is you're competing with the drive's PID/other settings. One thing I realised halfway through my tune (with deadline looming that day...) is I still had some command smoothing and filtering on the drives... which made tuning much easier once I disabled. I actually tuned the drives with a laptop plugged into the drives and was playing with the leadshine tune simultaneously; for example I was able to increase stiffness on the drive without adding noise while in this velocity mode.
There's still a lot of drive-side tuning I could do, need to dig through the manual with velocity mode in mind to find it all though. If the budget could stretch to a bigger gearbox (400W rated one was $500) to suit my spare 750w motor I'd change over X and solve a bunch of issues.

Your deviation problem is interesting.. I don't have absolute encoders on mine so I haven't had that issue, I need to home before use. I vaguely recall seeing something in one of the ethercat threads about updating lcnc using the absolute encoder but I can't find it nor remember enough to give you a good search term.

Do you have an email I can send you links to video of my machine? I can't post it here yet for business reasons outside of my control, but once it's released I will update on the forum. Feel free to edit your post to remove your email once I've sent you one.
 
The following user(s) said Thank You: LAUSCH

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

Time to create page: 0.276 seconds
Powered by Kunena Forum