# Motor doesn't turn in FOC mode

**URL:** https://community.simplefoc.com/t/motor-doesnt-turn-in-foc-mode/144
**Category:** hardware support
**Created:** [October 4, 2020, 7:05am UTC](https://community.simplefoc.com/t/motor-doesnt-turn-in-foc-mode/144 "2020-10-04T07:05:33Z")
**Posts on this page:** 1
**Showing post:** 29

<div class="post-metadata">

### Author: ![Antun\_Skuric](https://community.simplefoc.com/user_avatar/community.simplefoc.com/antun_skuric/32/21_2.png) [@Antun\_Skuric](https://community.simplefoc.com/u/Antun_Skuric)
#### Post date: [October 23, 2020, 6:29am UTC](https://community.simplefoc.com/t/motor-doesnt-turn-in-foc-mode/144/29 "2020-10-23T06:29:38Z")

</div>

Hey @lulezi,

Were you able to get around this problem?  
I would suggest you not to use the approach that you have shown but just use a function like this:

```cpp

void changeZeroAngle() {
  
  // a string to hold incoming data
  static String received_chars;
  
  while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read();
    // add it to the string buffer:
    received_chars += inChar;
    // end of user input
    if (inChar == '\n') {
      
      // chage the guess
      float guess = received_chars.toFloat()*2*_PI/360;
      motor.zero_electric_angle = guess;      
      // reset the command buffer 
      received_chars = "";
    }
  }
}

```

And then just add this function to your `loop()`:

```cpp
void loop(){
    ...
   changeZeroAngle();
}

```

Then you just send a number in between 0 and 360 through serial. This will allow you to guess quicker and more precisely.

Otherwise, since this is very strange problem and it is troubling me a bit I would be happy to sned you an additional _SimpleFOCShield_ hoping that that might resolve the issue 😃

---

_[View the full topic](https://community.simplefoc.com/t/motor-doesnt-turn-in-foc-mode/144)._
