Skip to content

Commit

Permalink
Update isp_bldc_motor.spin2
Browse files Browse the repository at this point in the history
- adjust offset constant from 20 to 43 (43 is measured outcome)
  • Loading branch information
ironsheep committed Aug 15, 2023
1 parent 27053b4 commit 97e3bc4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/isp_bldc_motor.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,32 @@ PRI offsetsForMotor(eMotorType) : fwdDegrees, revDegrees | ofsDegr
other:
' 4 degrees per tic, offset was actually 5 tics!
' or 20 degrees (0.0556 of rotation)
{ Doug's motor
ofsDegr := 20
fwdDegrees := ofsDegr
revDegrees := 360 - fwdDegrees
}

' Chips values (orig driver)
' CHIP ORIG: offset_fwd long 280 frac 360 '280 frac 360 (Doug's motor) 20
' CHIP ORIG: offset_rev long 230 frac 360 '230 frac 360 (Doug's motor) 340

' my values from characterization at 18v5:
ofsDegr := 43
fwdDegrees := ofsDegr ' chip #1 fwd 280 / rev 80
revDegrees := 360 - fwdDegrees
{
' In the following smaller value is FWD, 360 - smaller is REV
ofsDegr := 80
fwdDegrees := ofsDegr ' chip #1 fwd 280 / rev 80
revDegrees := 360 - fwdDegrees
'}
{
' In the following smaller value is FWD, 360 - smaller is REV
ofsDegr := 130
fwdDegrees := ofsDegr ' chip #2 fwd 230 / rev 130
revDegrees := 360 - fwdDegrees
'}

PRI getInternalDetectMode(eDetectMode) : eValidMode, bUserOverride | legalMode
' ensure suer specifies a good value
Expand Down

0 comments on commit 97e3bc4

Please sign in to comment.