page1
ControllerInit
End
Set up PIOC
Initialise IO
Set up PWM Parameters
Initialise rotation
SetTables
End
Set Direction
Map Vectors
Set up Rotation Array
Initialise Vector Table
MapTables
End
Set DC Offset
Map Vectors to Duty Cycle Buffer
Engine Stopped?
Yes
No
SensorInit
End
Set Direction
Start Sensor Poll
Initialise IO
Initialise interrupts
SetSensorUpdate
End
Stop poll
Frequency high?
Yes
No
Poll enabled?
Yes
No
Start poll with
new frequency
TC5_Handler: SensorTimer
End
Reset ticker
Call Controller Handler
SensorUpdateHandler
End
Calculate slip from field and shaft speeds
and apply smoothing
Adjust field speed from slip
Start: main
End
ControllerInit
SensorInit
SensorInit
Start stats timer
TC3_Handler: Stats
End
Get internal counters and stats
Display on Serial