stmbl servo drive setup with smart serial.

More
07 Feb 2024 18:59 #292774 by freemoore
Found at least one of my mistakes, now have better motor behaviour that I've had so far with the stmbl.

Turns out that inductance value is entered in Henrys, not milliHenrys (argh) so the config line
conf0.l = 1.082
should read
conf0.l = 0.00182

because as well as a magnitude error, I made a straight typo.

Motor is now sounding fine and turning with Axis jog keys.

Next, something's wrong in the config to do with position command and feedback. Posting process notes in case anyone knows the answer or I find it myself:

I had the following lines in the config as a way to try getting comms working stmbl-linuxcnc. Removing now as one of them is clearly a bit wrong; with these in, lcnc pos_fb value stays within 2pi (from -pi to pi) giving an error when the pos_cmd differs from pos_fb by more than the ferror value (currently FERROR=10 for testing).

rev0.in = sserial0.pos_cmd
sserial0.pos_fb = enc_fb0.pos

Removing them both kills comms with lcnc - pos_cmd and vel_cmd both change in halshow but no response from motor...commanded pos seems appears on servoterm graph but no movement and no feedback.

adding just sserial0.pos_fb = enc_fb0.pos doesn't fix it, motor becomes jittery but doesn't move.

replacing that with rev0.in = sserial0.pos_cmd...
axis jog keys now move motor but lcnc receives no feedback, motor moves til Ferror value is reached.

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

More
07 Feb 2024 21:21 #292786 by freemoore
Hi all. My config is now this:
link pid
link pmsm
link enc_fb0
link misc
link sserial

conf0.r = 0.2
conf0.l = 0.00182
conf0.j = 0.012319

conf0.max_ac_cur = 20
conf0.max_vel = 209.4395
conf0.max_acc = 1000
conf0.max_force = 23

conf0.psi = 0.191666666
conf0.polecount = 4

conf0.mot_fb_polecount = 1
conf0.mot_fb_res = 8000
conf0.mot_fb_offset = 1.16
conf0.max_pos_error = 0
io0.out0 = fault0.mot_brake

rev0.in = sserial0.pos_cmd

idx_home0.index_en <= sserial0.index_out
linrev0.scale = 6.28318530718
sserial0.pos_fb = linrev0.fb_out

The last two lines replace what I have above: sserial0.pos_fb = enc_fb0.pos

It seems that the linrev component scaled to 2pi and linked to sserial.pos_fb has the desired effect of matching the motor's pos_cmd and pos_fb values. I can now jog the motor to a position of just past 9mm (+ or -), at which point it suddenly runs away to about +/- 50mm before giving amp fault in lcnc and CMD error in servoterm.

Giving up for the night cos Cambs is freezing. Good progress though. Would still be v pleased to see anyone else's working stmbl/lcnc configs.

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

More
09 Feb 2024 17:30 #292951 by freemoore
After trying a few more things, I have something like a good stmbl config that doesn't seem to error out or run away, connects to linuxcnc, releases the brake on lcnc 'enable', jogs with the axis keys as far as I care to jog them, and will go to an MDI commanded position. Here it is in case anyone can use it:

link pid
link pmsm
link enc_fb0
link misc
link sserial

fault0.cmd_error = 0

conf0.r = 0.2
conf0.l = 0.00182
conf0.j = 0.012319
conf0.max_ac_cur = 20
conf0.max_vel = 209.4395
conf0.max_acc = 20000
conf0.max_force = 23
conf0.psi = 0.191666666
conf0.polecount = 4
conf0.mot_fb_polecount = 1
conf0.mot_fb_res = 8000
conf0.mot_fb_offset = 1.16
conf0.max_pos_error = 0
io0.out0 = fault0.mot_brake

term0.wave4 = linrev0.cmd_in
term0.wave7 = linrev0.cmd_out
term0.wave5 = sserial0.pos_fb
term0.wave6 = sserial0.pos_cmd
term0.gain0 = 10.000000
term0.gain1 = 10.000000
term0.gain2 = 10.000000
term0.gain3 = 10.000000
term0.gain4 = 20.000000
term0.gain5 = 10.000000
term0.gain6 = 10.000000
term0.gain7 = 20.000000

linrev0.scale = 6.28318530718
sserial0.pos_fb = linrev0.fb_out
linrev0.cmd_in = sserial0.pos_cmd

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

More
09 Feb 2024 17:33 - 09 Feb 2024 17:34 #292952 by freemoore
I've also started a Google Sheets document which is a pretty minimal attempt at a component guide - basically I've read a few of the stmbl HAL components' code files, listed their pins and made a stab at working out what they are for. Very obvious in some cases, a bit more obscure in others, but I haven't found this information anywhere else. Not sure of the wisdom of publishing the link for anyone/everyone to edit but fingers crossed it's there for anyone more knowledgeable than me to improve. Here's the link:

docs.google.com/spreadsheets/d/1Q-4kneBV...usg/edit?usp=sharing

There are many, many more components to be added.
Last edit: 09 Feb 2024 17:34 by freemoore.
The following user(s) said Thank You: tommylight

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

Time to create page: 0.124 seconds
Powered by Kunena Forum