Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of priustroller_current by
main.cpp@48:28edb4c5c04b, 2015-04-17 (annotated)
- Committer:
- nki
- Date:
- Fri Apr 17 05:19:21 2015 +0000
- Revision:
- 48:28edb4c5c04b
- Parent:
- 47:f5b1ff02c656
- Child:
- 49:0603121a0538
temp commit before revert
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bwang | 0:54cf32d35f4d | 1 | #include "includes.h" |
| bwang | 11:dccbaa9274c5 | 2 | #include "transforms.h" |
| bwang | 11:dccbaa9274c5 | 3 | #include "filters.h" |
| bwang | 11:dccbaa9274c5 | 4 | #include "context.h" |
| bwang | 1:1f58bdcf2956 | 5 | #include "core.h" |
| bwang | 1:1f58bdcf2956 | 6 | #include "meta.h" |
| bwang | 11:dccbaa9274c5 | 7 | #include "sensors.h" |
| bwang | 11:dccbaa9274c5 | 8 | #include "callbacks.h" |
| nki | 27:846c08fb3697 | 9 | |
| bwang | 11:dccbaa9274c5 | 10 | int main() { |
| bwang | 42:e4f35ff78d91 | 11 | Context *context = new Context(false); |
| nki | 36:11766b5da6ed | 12 | context->ConfigureOutputs(D13, D3, D6, D2); |
| nki | 33:e7b132029bae | 13 | context->ConfigureCurrentSensors(A1, A2, 0.01f, 0.7f); |
| nki | 37:09373294ff22 | 14 | context->ConfigureIdPidController(0.00001f, 0.0f, 0.0f, 1.0f, -1.0f); |
| nki | 37:09373294ff22 | 15 | context->ConfigureIqPidController(0.00001f, 0.0f, 0.0f, 1.0f, -1.0f); |
| nki | 36:11766b5da6ed | 16 | context->ConfigureThrottle(A0, 0.9f, 2.5f, 0.8f); //last term is LPF strength |
| nki | 36:11766b5da6ed | 17 | context->ConfigurePositionSensor(A3, A4, 0.366f, 0.655f, 0.355f, 0.626f, 205.0f); |
| nki | 36:11766b5da6ed | 18 | context->ConfigureReference(80.0f); // max phase current |
| bwang | 42:e4f35ff78d91 | 19 | //context->ConfigureDebugger(2, 4000); |
| bwang | 46:bd39f7e6e37f | 20 | context->Start(); |
| bwang | 42:e4f35ff78d91 | 21 | for (;;) { |
| bwang | 42:e4f35ff78d91 | 22 | fast_test2(context); |
| nki | 48:28edb4c5c04b | 23 | wait_us(500); |
| nki | 48:28edb4c5c04b | 24 | slow(context); |
| bwang | 42:e4f35ff78d91 | 25 | } |
| bwang | 42:e4f35ff78d91 | 26 | /* |
| bwang | 42:e4f35ff78d91 | 27 | context->AttachCallBack(&fast, 5000); |
| bwang | 38:232c51b6853f | 28 | context->AttachCallBack(&fast_test, 5000); |
| bwang | 38:232c51b6853f | 29 | context->AttachCallBack(&slow, 20); |
| bwang | 11:dccbaa9274c5 | 30 | context->AttachCallBack(&debug, 10); |
| bwang | 24:f1ff9c7256b5 | 31 | context->AttachCallBack(&log, 500); |
| bwang | 11:dccbaa9274c5 | 32 | context->Start(); |
| bwang | 42:e4f35ff78d91 | 33 | */ |
| bwang | 0:54cf32d35f4d | 34 | } |
