Set up using AMC AB15A100 drives, brushed DC motor Prototrak Plus with Encoders

More
29 Aug 2022 20:35 #250730 by Todd Zuercher
I think the place to start may be adjusting the loop gain (Pot-1) and leave SW-2 alone for now. Keep decreasing the frequency until you see some kind of stabilizing of the movement, either a plateau or oscillation, something to indicate the drive has achieved the velocity it is aiming for. Try 0.5hz, that would be changing direction once every second, positive for 1sec and negative for 1sec. If that is still not enough time go 0.25hz.

So far the traces you've shown for 5 and 8hz look like either the loop gain so so low it can't reach the commanded velocity. (or the move is too short to do it in.)
The following user(s) said Thank You: new2linux

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

More
30 Aug 2022 12:48 - 30 Aug 2022 16:22 #250774 by new2linux
Todd, thank you! I have slowed this way down until I get o-scope set proper. Currently, on the "test" screen the settings are: Freq=0.10 Hz; Amplitude=1.0 v, a small message flashes (it does not stay up long) across screen says "auto trigger none". I am not completely shore if the other traces were with or w/o "auto trigger" working. The traces are nothing like shown so far, because it never stops, it is always moving.
I reviewed the settings as well as I understand the scope, all looks correct, trigger on rising edge (this is 2 separate buttons, 1 for the edge & 1 for rising. There is a setting "hold off" (this will only go so low of 16 nS (I tried 30, no change) & is under 2nd fly out screen, on right). I was using "clear" then "auto" every time to start a trace (so this may not use settings I select), but this was the same way that worked before. I am thinking about tiring other probes with different channels, what is your thinking?

With the current settings, the saddle moves about 2 1/2" one way, has long "cruse" travel area. This may be slow for the feed rate, but to get trigger working, it is easy on the motor.

Many thanks

Edit: This pic is what I see when I use "auto". I can spread the trace out left to right (see #1 pic), but no "square wave", yet.
Edit: I set channel 1 as source of trigger as well as channel 2. did not seem to help.
Many thanks!

Edit: Probes are set to 10x; should it be 1x?
Attachments:
Last edit: 30 Aug 2022 16:22 by new2linux.

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

More
30 Aug 2022 16:26 #250787 by Todd Zuercher
It might just be simpler to look at it in Halscope. There, set channel1 to the analog out pin. and channel2 to the encoder's velocity feedback pin. Then set the trigger for the rising edge of channel1.

For a signal as slow as this it might not be possible to use the magic "Auto" button on the real scope. That will mean setting everything manually, and I am not enough of an expert at using a real scope to tell you how to do it, (I'd have to do a lot of fiddling with knobs and poking of buttons to find the right settings.) You might be able to set the signal to a faster setting where you were able to get a good trace using the auto feature, then slow the signal back down and without pressing the auto again, just try pressing the "single" button to see if the scope will re-trigger with the last settings.
The following user(s) said Thank You: new2linux

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

More
30 Aug 2022 16:53 #250788 by new2linux
Todd, thanks! The attached pic is the Hal-Oscope, channel 1=hm2_5i25.0.7i77.0.1.analogout1 & channel 2 = hm2_5i25.0.encode.01.velocity (are these correct?) with units ch1=5K/div & ch2=500m/div in trace.
The trace looks ok, for the 1st.
I tried the other suggestion 1st, I need to make shore I am able to set the o-scope proper before I go back to it.

Many thanks
 
Attachments:

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

More
30 Aug 2022 18:27 - 30 Aug 2022 18:30 #250794 by Todd Zuercher
The Halscope traces look good enough.

Looks like you need to back off on pot 1 a bit (CCW). At the very least smooth out that waver in the steady state. Keep removing the resistance with pot 1 to see if you can get rid of most of the overshoot.

If turning back pot 1 makes the rise too slow without helping much with the overshoot, see if adding some capacitance with the SW-2 switches helps to tame the overshoot.

Looks like the encoder scaling for the Y encoder is not right though. I made a mistake in the test.hal file when I copied the section for the X encoder and paisted it in for the Y, I forgot to renumber pin names for the Y.

That section of the file should read
#Y-encoder
setp hm2_5i25.0.encoder.01.counter-mode 0
setp hm2_5i25.0.encoder.01.filter 1
setp hm2_5i25.0.encoder.01.index-invert 0
setp hm2_5i25.0.encoder.01.index-mask 0
setp hm2_5i25.0.encoder.01.index-mask-invert 0
setp hm2_5i25.0.encoder.01.scale 27500

Even still we can calculate the velocity by dividing the number shown in Halscope by 27500 to get the velocity in inches/sec. So at 1V it looks like the motor is moving at almost 0.42 inches/sec (or about 24ipm,) That is about twice as fast as you need for your max vel of 120ipm. So it might not hurt to turn back Pot-3 a little, but it also won't hurt anything to leave it be.
Last edit: 30 Aug 2022 18:30 by Todd Zuercher. Reason: Stupid forum editor sucks
The following user(s) said Thank You: new2linux

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

More
30 Aug 2022 18:56 #250796 by new2linux
Todd. Thanks! Just to clarify, the traces in my most recent post (#250788) are of the "Y" axes, all the o-scope probes are connected. I set HAL O-scope, as prior post ch1 & ch 2, pin address as shown. Should I try the Rigol scope to see if the revised code (as to copy and paste your suggestions: # y -encoder etc... in your prior post) to see if it will work proper?
I have revised the Rigol o-scope, there is a "lock" to the auto settings it appears, like get it the way you need it & lock it & it stays. I will get to know this o-scope more if it necessary, I am willing to do what is necessary. This may take 1 or 2 tries.

The mill is only rated at 60"/min I think. I plan to edit the file with the #Y -encoder... & try again w/o any other changes. I am pondering the Pot 1 & Pot 3 suggestions, will take the wait and see approach.

Many thanks!

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

More
30 Aug 2022 19:31 #250797 by Todd Zuercher
The Halscope is going to be good enough for the rest of the tuning. If you want to get the real scope working for this is up to you, but I'm not sure it is worth the effort.

The Y-encoder scaling won't make a huge difference. (It will be big numeric difference but the trace will be the same.) It will just change the scale that you are reading the feedback in in Halscope. In your last post it was reading in encoder counts per second. Changing the code in the test.hal to what I posted will change the reading to inches per second.

Making an adjustment to Pot3 is optional at this point, adjusting Pot1 and SW-2 is not.

Make one change at a time and check to see what effect it had. Turn pot1 until you see some change. Is the change an improvement? Does turning it more make it better or worse?

Once you have things looking as good as you can get them adjusting pot1, decide if that is or isn't good enough. If it isn't good enough can you see better results switching on some of the SW2 switches?

Once satisfied that the velocity loop is tuned good enough, restart Linuxcnc and work on tuning the position loop.
The following user(s) said Thank You: new2linux

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

More
30 Aug 2022 20:05 #250799 by new2linux
Todd, Many, many thanks!! I have many more traces that what is attached. I did not see much or any change when adjusting Pot1. But if we talk about SW2, this is different, the file name has the SW2 setting, attached are the best (the 1 in the center of what you see) traces on "Y" axes. I did not remove the Rigol scope, but plan to, it was not on when testing. If you think Pot1 will tweak the trace I will try.
What trace looks good to you?? I plan to work the "x" axes tomorrow.

Many thanks
 
Attachments:

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

More
30 Aug 2022 21:17 #250801 by Todd Zuercher
I'm not sure, there is not a whole lot of difference between the SW737 and SW837 ones. The other one of those 3 has the best over shoot results. Check to see if twiddling pot1 can improve the slope and sharpen up the corner of the 1047ohm setting and even try the 1147ohm settings, then go with that one with the best corner.

When you did those tests above approximately what were the Pot1 and Pot3 settings?
The following user(s) said Thank You: new2linux

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

More
30 Aug 2022 23:11 #250808 by new2linux
Todd, Thanks! All Pot setting except Pot 2 (11 turns) are mid-point (7 turns). Attached is the SW 1.147, the next SW2 setting. I will try to use the Pot 1 as the fine-tuning, looking for sharp corner w/o over-shoot. This is the trade-off, the round corner or over-shoot, with no over-shoot allowed, will tolerate a small round corner.

Many thanks!
Attachments:

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

Moderators: piasdom
Time to create page: 0.118 seconds
Powered by Kunena Forum