]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/commitdiff
Correction.
authorMartin Prudek <prudemar@fel.cvut.cz>
Sun, 10 May 2015 14:52:23 +0000 (16:52 +0200)
committerMartin Prudek <prudemar@fel.cvut.cz>
Sun, 10 May 2015 14:52:23 +0000 (16:52 +0200)
pmsm-control/test_sw/main_pmsm.c

index a85e65fd62739a86409b17582f0d800468ef78f7..26e83089f0ead662a149ba3c1879fcd44ddb28cd 100644 (file)
@@ -236,8 +236,9 @@ void * pos_monitor(void* param){
 /*
  * \brief
  * Multiplication of 11 bit
 /*
  * \brief
  * Multiplication of 11 bit
+ * Zaporne vysledky prvede na nulu.
  */
  */
-inline int16_t mult_cap(int32_t s,int d){
+inline uint16_t mult_cap(int32_t s,int d){
        int j;
        int res=0;
        for(j=0;j!=11;j++){
        int j;
        int res=0;
        for(j=0;j!=11;j++){
@@ -263,11 +264,11 @@ int sin_commutator(int duty){
 
                 /* 2nd phase */
                 sin = pxmc_sin_fixed_inline(pos+DEGREE_120,10); /*10+1 bity*/ /*-240*/
 
                 /* 2nd phase */
                 sin = pxmc_sin_fixed_inline(pos+DEGREE_120,10); /*10+1 bity*/ /*-240*/
-                rps.pwm2=mult_cap(sin, duty);;
+                rps.pwm2=mult_cap(sin, duty);
 
                 /* 3rd phase */
                 sin = pxmc_sin_fixed_inline(pos,10); /*10+1 bity*/
 
                 /* 3rd phase */
                 sin = pxmc_sin_fixed_inline(pos,10); /*10+1 bity*/
-                rps.pwm3=mult_cap(sin, duty);;
+                rps.pwm3=mult_cap(sin, duty);
         }else{
                duty=-duty;
 
         }else{
                duty=-duty;