Set both fermi choppers to phase mode.

You can set both speed and phase delay in phase mode.
This commit is contained in:
Ferdi Franceschini
2013-05-08 07:15:55 +10:00
parent c50d73740b
commit 50dbadc811

View File

@@ -2,7 +2,7 @@
# Speed (RPM) {veto {KpCW KpCCW} {KiCW KiCCW} {KthCW KthCCW} # Speed (RPM) {veto {KpCW KpCCW} {KiCW KiCCW} {KthCW KthCCW}
# NOTE: You can use the motor direction register value to lookup the gains because motdir=0 is CW and motdir=1 is CCW # NOTE: You can use the motor direction register value to lookup the gains because motdir=0 is CW and motdir=1 is CCW
# TEST # TEST
global SCode Ecode global SCode ECode fcRPM fcPHASE
array set SCode { array set SCode {
OKOK 1 OKOK 1
HWIdle 2 HWIdle 2
@@ -21,6 +21,8 @@ array set ECode {
MOTFAIL 0 MOTFAIL 0
MOTOK 1 MOTOK 1
} }
set fcRPM 0
set fcPHASE 1
proc handle_exception {status message args} { proc handle_exception {status message args} {
switch $status { switch $status {
@@ -575,6 +577,7 @@ namespace eval ::chopper {
proc mkFSpeedMot {fmot hdbroot chnode addr lowlim uplim} { proc mkFSpeedMot {fmot hdbroot chnode addr lowlim uplim} {
clientput [info level 0]
Motor $fmot tclmot [subst {\ Motor $fmot tclmot [subst {\
getpos "::chopper::imot_SGetpos $hdbroot $chnode $addr"\ getpos "::chopper::imot_SGetpos $hdbroot $chnode $addr"\
run "::chopper::imot_SRun $hdbroot $chnode $addr"\ run "::chopper::imot_SRun $hdbroot $chnode $addr"\
@@ -607,6 +610,7 @@ proc mkFSpeedMot {fmot hdbroot chnode addr lowlim uplim} {
} }
proc mkFPhaseMot {fmot hdbroot chnode addr lowlim uplim} { proc mkFPhaseMot {fmot hdbroot chnode addr lowlim uplim} {
clientput [info level 0]
Motor $fmot tclmot [subst {\ Motor $fmot tclmot [subst {\
getpos "::chopper::imot_PhGetPos $hdbroot $chnode $addr"\ getpos "::chopper::imot_PhGetPos $hdbroot $chnode $addr"\
run "::chopper::imot_PhRun $hdbroot $chnode $addr"\ run "::chopper::imot_PhRun $hdbroot $chnode $addr"\
@@ -671,3 +675,6 @@ proc mkFermiMotors { master maddr {slave "EMPTY"} {saddr "EMPTY"} } {
} }
mkFermiMotors mch 2 sch 3 mkFermiMotors mch 2 sch 3
mchs mode $fcPHASE
schs mode $fcPHASE