Changes between Version 58 and Version 59 of UserGuideGit


Ignore:
Timestamp:
Nov 13, 2017, 12:53:00 PM (8 years ago)
Author:
fma
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuideGit

    v58 v59  
    5858
    5959* the origin is at the coxa joint
    60 * X and Y axes define a plane parallele to the body
     60* X and Y axes define a plane parallel to the body
    6161* X axis is along the coxa of the leg
    6262* Z points up
     
    148148
    149149A {{{Pool}}} uses a {{{Driver}}} to really make the {{{Actuator}}}s move.
     150
    150151=== Servos calibration ===
    151152
     
    160161[[Image(py4bot-gui-servocal.png, 300px)]]
    161162
    162 If you launch this tool in the dir. containing your '''{{{settings.py}}}''' config file with a previous {{{SERVOS_CALIBRATION}}} dict., it will be used as default values.
     163------------
     164
     165Most servos have a range of 180°. So, it is important to mount them on the robot so the servo neutral position (''SNP'') match the joint neutral position (''JNP''). Here is the leg neutrals usually used for a 3 DoF leg:
     166
     167{{{
     168XY plane (top view):
     169
     170  C  F        T
     171  o---o---------o-------
     172
     173XZ plane (side view):
     174
     175  C  F        T
     176  o---o---------o
     177                |
     178                |
     179                |
     180}}}
     181
     182 * C = coxa
     183 * F = femur
     184 * T = tibia
     185
     186This position should be reached when servos pulses are 1500µs (1500µs is the neutral pulse of hobby servos). It may vary a little bit, and you can fine tune this value by scanning the mechanical range of the servo, and take the middle value (neutral_pulse = (min_pulse + max_pulse) / 2). A little servo tester can be helpful.
     187
     188In the above position, ''SNP'' are all 90°, as it is standard servo neutral position for 1500µs.
     189
     190Looking how '''Py4bot''' internally manages angles (http://www.py4bot.org/wiki/UserGuideGit#a3DoFlegs), we can see that in this same position, ''JNP'' are:
     191
     192 * coxa = 0°
     193 * femur = 180°
     194 * tibia = 90°
     195
     196This means that there will be some offset between the servo angles and the framework angles.
     197
     198Another thing to tune is the ratio between pulse variation and real servo displacement. This ratio varies a lot from a brand to another. And even for a same model, it varies from a servo to another. This is especially true for low cost servos.
     199
     200Offsets and ratios are defined in the {{{SERVO_CALIBRATION}}} table. This table also has a '''pulse90''' param, to fine tune the ''SNP'' (it is not always possible to mount the servo so 1500µs is the perfect ''JNP'').
     201
     202Py4bot has a graphical tool, '''{{{py4bot-gui-servocal.py}}}''', to help set up this table once the robot is build. Here is how to use it.
     203
     204We first need to enable the servo, by clicking the '''Enable''' checkbox. Then, we need to check if the servo rotates the right direction: increasing the pulse value should make the joint turning in the trigonometric sense regarding our previous schematic. If it is not the case, click the '''Invert''' checkbox (usually, coxa joints are all the same, and other joints should be inverted for legs of one side, but it depends if there is a symmetry in the mechanics or not). Note that from within this tool, the servo direction won't change! But the ratio will be inverted, so '''Py4bot''' computes angles the right way.
     205
     206We are now ready to fine tune the ''SNP'', and set its matching ''JNP''. To do this, we move the '''Pulse''' slider until we mechanically reach the ''JNP''. Then, we move the '''Joint neutral''' slider to match the theoretical ''JNP'' for that specific joint (as we seen, coxa = 0°, femur = 180°, tibia = 90°). Then, we click the '''Set pulse''' button of the joint neutral setting. This recomputes the '''offset''' and '''pulse90''' params of the {{{SERVO_CALIBRATION}}} table.
     207
     208Then, we need to tune the ratio. This step is a little bit harder, as we need to measure the angle the joint really moves. The best way is to move up to +-90°, as it is visually easy to see, but it is not always mechanically possible, and we can restrict the range to +-45°.
     209
     210So, we move the 'Angle min' slider to -45°. Then, we move the '''Pulse''' slider so our joint really reaches -45°. Last, we click the '''Set pulse''' button of the '''Angle min'' slider to recompute the ratio.
     211
     212We of course need to repeat the procedure for the angle max. After both have been tuned, the ratio should be correct.
     213
     214And we need to repeat the entire procedure for each servo/joint, which can be tedious for a 4 DoF hexapod :o/ But after that, our robot should walk better ;o)
     215
     216Note that if we already have a '''{{{settings.py}}}''' module, we can launch '''{{{py4bot-gui-servocal.py}}}''' from the directory containing that module in order to reload the previous values (no gui values are stored, though).
     217
     218-------------------
    163219
    164220== Gaits and !GaitSequencer ==
     
    167223
    168224[[Image(design_gait.png, 300px)]]
     225
    169226==  Remote controllers ==
    170227
     
    174231
    175232As you can see on the UML diagram, a {{{RemoteControl}}} object is build with {{{Components}}}; a {{{Component}}} can be a {{{Button}}}, a {{{Analog}}} axis, or a {{{Joystick}}}, which is several {{{Analog}}} axes bound together.
     233
    176234=== Using Mappers ===
    177235
     
    185243
    186244Of course, you can define your own '''Mappers'''.
     245
    187246=== Add a new Frontend ===
    188247