Changes

Jump to navigation Jump to search
2,512 bytes added ,  07:01, 25 January 2021
added sample configurations
Line 291: Line 291:  
| GND
 
| GND
 
|}
 
|}
 +
 +
== Sample Configurations ==
 +
 +
=== Measure Resistance/Inductance ===
 +
 +
Configuration:
 +
 +
<pre>link rl</pre>
 +
 +
Manually run:
 +
 +
<pre>rl0.en = 1</pre>
 +
 +
After it finishes (the graph will settle down and the noises will stop), the measured resistance and inductance can be printed by printing the state of the following pins using the console:
 +
 +
<pre>rl0.r
 +
rl0.ld</pre>
 +
 +
=== Commutation Test ===
 +
 +
Configuration:
 +
 +
<pre>link pid
 +
link pmsm
 +
# whichever type of feedback is being used
 +
link enc_fb0
 +
link misc
 +
 +
# motor winding characteristics
 +
conf0.r = 3.256717
 +
conf0.l = 0.025102
 +
# motor current/torque rating
 +
conf0.max_force = 14.8
 +
conf0.max_ac_cur = 5
 +
# inertia, which is dependent on the mass (technically moment of inertia) being spun
 +
conf0.j = 0.00005
 +
# how many electrical "revolutions" per mechanical revolution
 +
conf0.polecount = 1
 +
 +
# for basic quadrature encoders
 +
conf0.mot_fb_res = 5000
 +
# if index isn't available, disable looking for it
 +
#enc_fb0.en_index = 0
 +
 +
# correct the feedback polarity/offset
 +
conf0.mot_fb_rev = 0
 +
conf0.mot_fb_offset = 0.0
 +
 +
# correct the (open loop) output direction (clockwise/counter-clockwise)
 +
conf0.out_rev = 0</pre>
 +
 +
Run manually:
 +
 +
<pre>link com_test</pre>
 +
 +
If the motor is turning in a very choppy manner, then the test current might be too low. Change <code>hv0.d_cmd</code> from the default value of 1.0 to something higher:
 +
 +
<pre>hv0.d_cmd = 2.0</pre>
 +
 +
If absolute angle is available (index pulse enabled and seen, or if using an absolute encoder), then you can keep correcting the feedback offset (the units are radians):
 +
 +
<pre>conf0.mot_fb_offset = 0.2</pre>
 +
 +
You may need to zoom in to do fine adjustments. This is done by decreasing the period (increasing the frequency) of <code>term0.send_step</code>:
 +
 +
<pre>term0.send_step = 20</pre>
 +
 +
=== Jog Test ===
 +
 +
<pre>link pid
 +
link pmsm
 +
# whichever type of feedback is being used
 +
link enc_fb0
 +
link misc
 +
# this is the important part
 +
link jog_cmd
 +
 +
# ...
 +
# (same configuration used after tuning with com_test)
 +
# ...
 +
 +
# configure the max speed and acceleration
 +
stp0.max_vel = 20
 +
stp0.max_acc = 1000
 +
# allow turning further in the same direction
 +
stp0.min_pos = -1000
 +
stp0.max_pos = 1000</pre>
 +
 +
You may have to play with the <code>conf0.j</code> parameter, be careful as having it too high can easily cause oscillations. Be ready to disable the motor!
 +
 +
<pre>conf0.j = 0.0001</pre>
 +
 +
You can also increase the motor's top speed:
 +
 +
<pre>stp0.max_vel = 200</pre>
 +
 +
And later see how much the acceleration can be pushed:
 +
 +
<pre>stp0.max_acc = 40000</pre>
    
== Replacement Parts ==
 
== Replacement Parts ==

Navigation menu