Skip to content

Instantly share code, notes, and snippets.

@garaemon
Created February 1, 2016 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garaemon/6f154c2169d50ecc9d96 to your computer and use it in GitHub Desktop.
Save garaemon/6f154c2169d50ecc9d96 to your computer and use it in GitHub Desktop.
diff --git a/VSProjects/TransHost/TransHost/robot_settingsjaxon_red.fs b/VSProjects/TransHost/TransHost/robot_settingsjaxon_red.fs
index a271e38..10c1cf8 100755
--- a/VSProjects/TransHost/TransHost/robot_settingsjaxon_red.fs
+++ b/VSProjects/TransHost/TransHost/robot_settingsjaxon_red.fs
@@ -36,13 +36,17 @@ let waist_default_motor_param =
let dgain48 = -10*16
(default_maxcurrent,default_motortemplimit,pgain48,dgain48)
-let leg_default_motor_param =
- let default_maxcurrent = 50us // 50 * 1.38105 = 69.1 [A]
+let leg_default_motor_param_with_maxcurrent maxcurrent =
let default_motortemplimit = 150us
// let default_motortemplimit = 200us // unlimited
let pgain48 = 3*16
let dgain48 = -10*16
- (default_maxcurrent,default_motortemplimit,pgain48,dgain48)
+ (maxcurrent,default_motortemplimit,pgain48,dgain48)
+
+let leg_default_maxcurrent = 50us // 50 * 1.38105 = 69.1 [A]
+let leg_default_motor_param =
+ leg_default_motor_param_with_maxcurrent(leg_default_maxcurrent)
+
// confs
let armconf st_adr motor_settings =
@@ -95,12 +99,24 @@ let legconf st_adr motor_settings =
das
|> List.zip motor_settings
|> List.mapi (fun i (motor_setting,da) ->
+ let ratcheting_current =
+ [44.7;
+ 63.5;
+ 101.6;
+ 101.6;
+ 101.6;
+ 101.6;
+ 37.2;
+ 44.4] // [A]
+ |> List.map (fun x -> uint16(floor (x / 1.38105)))
+ let ratcheting_current_i = ratcheting_current.Item i
+ let leg_default_motor_param_with_ratcheting_current = leg_default_motor_param_with_maxcurrent(ratcheting_current_i)
let (rc,wc,rch,wch) =
- motor_driver_conf_common leg_default_motor_param da motor_setting
- if motor_setting = 0 then
- (rc,wc,rch,wch)
- else
- (rc,wc,rch,wch) )
+ if ratcheting_current_i < leg_default_maxcurrent then
+ motor_driver_conf_common leg_default_motor_param_with_ratcheting_current da motor_setting
+ else
+ motor_driver_conf_common leg_default_motor_param da motor_setting
+ (rc,wc,rch,wch))
|> List.reduce append_conf
|> append_conf <| power_input_conf st_adr
let endat_confs =
@@ -259,6 +275,48 @@ let convertRuleVel =
]
|> List.concat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment