ControllerF32.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #include "ControllerF32.h"
  2. #include "Error.h"
  3. void ControllerF32::test_pid_f32()
  4. {
  5. for(int i=0; i < this->nbSamples; i++)
  6. {
  7. *this->pDst++ = arm_pid_f32(&instPid, *this->pSrc++);
  8. }
  9. }
  10. void ControllerF32::test_clarke_f32()
  11. {
  12. float32_t Ialpha;
  13. float32_t Ibeta;
  14. for(int i=0; i < this->nbSamples; i++)
  15. {
  16. arm_clarke_f32(0.1,0.2,&Ialpha,&Ibeta);
  17. }
  18. }
  19. void ControllerF32::test_inv_clarke_f32()
  20. {
  21. float32_t Ia;
  22. float32_t Ib;
  23. for(int i=0; i < this->nbSamples; i++)
  24. {
  25. arm_clarke_f32(0.1,0.2,&Ia,&Ib);
  26. }
  27. }
  28. void ControllerF32::test_park_f32()
  29. {
  30. float32_t Id,Iq;
  31. for(int i=0; i < this->nbSamples; i++)
  32. {
  33. arm_park_f32(0.1,0.2,&Id,&Iq,0.1,0.2);
  34. }
  35. }
  36. void ControllerF32::test_inv_park_f32()
  37. {
  38. float32_t Ialpha,Ibeta;
  39. for(int i=0; i < this->nbSamples; i++)
  40. {
  41. arm_inv_park_f32(0.1,0.2,&Ialpha,&Ibeta,0.1,0.2);
  42. }
  43. }
  44. void ControllerF32::test_sin_cos_f32()
  45. {
  46. float32_t sinVal,cosVal;
  47. for(int i=0; i < this->nbSamples; i++)
  48. {
  49. arm_sin_cos_f32(0.1,&sinVal,&cosVal);
  50. }
  51. }
  52. void ControllerF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  53. {
  54. std::vector<Testing::param_t>::iterator it = params.begin();
  55. this->nbSamples = *it;
  56. samples.reload(ControllerF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  57. output.create(this->nbSamples,ControllerF32::OUT_SAMPLES_F32_ID,mgr);
  58. switch(id)
  59. {
  60. case TEST_PID_F32_1:
  61. arm_pid_init_f32(&instPid,1);
  62. break;
  63. }
  64. this->pSrc=samples.ptr();
  65. this->pDst=output.ptr();
  66. }
  67. void ControllerF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  68. {
  69. }