Skip to content

Commit b3f463e

Browse files
committed
added simple foc shield v1.2 short description
1 parent 55d1abc commit b3f463e

File tree

5 files changed

+76
-3
lines changed

5 files changed

+76
-3
lines changed

README.md

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ Alternatively the library supports the arduino based gimbal controllers such as:
4343
- HMBGC V2.2 ([Ebay](https://www.ebay.com/itm/HMBGC-V2-0-3-Axle-Gimbal-Controller-Control-Plate-Board-Module-with-Sensor/351497840990?hash=item51d6e7695e:g:BAsAAOSw0QFXBxrZ:rk:1:pf:1))
4444

4545

46-
## Arduino FOC Shield v1.1
46+
## Arduino FOC Shield V1.2
47+
48+
At this moment we are developing an open source version of Arduin shiled specifically for FOC motor control.
49+
We already have prototypes of the board and we are in the testing phase. We will be coming out with the details very soon!
50+
***Let us know if you are interested!***
51+
52+
You can explore the [3D model of the board](extras/ArduinoFOCShieldV12.pdf)
53+
54+
<img src="extras/Images/AFSV11_side.png" height="300px"> <img src="extras/Images/AFSV11_top.png" height="200px"> <img src="extras/Images/AFSV11_bottom.png" height="200px">
4755

4856

4957
## Arduino UNO + L6234 breakout broad
@@ -322,10 +330,75 @@ Examples folder structure
322330

323331

324332
# Debugging
325-
- TODO
333+
To debug control loop exection in the examples we added a funciton `motor_monitor()` which log the motor variables to the serial port. The funciton logs different variables based for differenc control loops.
334+
```cpp
335+
// utility function intended to be used with serial plotter to monitor motor variables
336+
// significantly slowing the execution down!!!!
337+
void motor_monitor() {
338+
switch (motor.controller) {
339+
case ControlType::velocity_ultra_slow:
340+
case ControlType::velocity:
341+
Serial.print(motor.voltage_q);
342+
Serial.print("\t");
343+
Serial.print(motor.shaft_velocity_sp);
344+
Serial.print("\t");
345+
Serial.println(motor.shaft_velocity);
346+
break;
347+
case ControlType::angle:
348+
Serial.print(motor.voltage_q);
349+
Serial.print("\t");
350+
Serial.print(motor.shaft_angle_sp);
351+
Serial.print("\t");
352+
Serial.println(motor.shaft_angle);
353+
break;
354+
case ControlType::voltage:
355+
Serial.print(motor.voltage_q);
356+
Serial.print("\t");
357+
Serial.println(motor.shaft_velocity);
358+
break;
359+
}
360+
}
361+
```
362+
This is just a template funciton to help you debug and create your own functions in future.
363+
The funciton accesses the motor variables:
364+
```cpp
365+
366+
class BLDCMotor
367+
{
368+
public:
369+
...
370+
// current elelctrical angle
371+
float elctric_angle;
372+
// current motor angle
373+
float shaft_angle;
374+
// current motor velocity
375+
float shaft_velocity;
376+
// current target velocity
377+
float shaft_velocity_sp;
378+
// current target angle
379+
float shaft_angle_sp;
380+
// current voltage u_q set
381+
float voltage_q;
382+
...
383+
}
384+
```
385+
Additionally it is possible to use encoder api directly to get the encoder angle and velocity.
386+
```cpp
387+
388+
class Encoder{
389+
public:
390+
// shaft velocity getter
391+
float getVelocity();
392+
// shaft angle getter
393+
float getAngle();
394+
}
395+
```
396+
397+
398+
326399
# Future Work Roadmap
327400
- [ ] Encoder index proper implementation
328401
- [ ] Timer interrupt execution rather than in the `loop()`
329-
- [ ] Proper introduction of the **Arudino FOC Shield V1.1**
402+
- [ ] Proper introduction of the **Arudino FOC Shield V1.2**
330403
- [ ] Make the library accesible in the Arduino Library Manager
331404
- [ ] Publish a video utilising the library and the samples

extras/ArduinoFOCShieldV12.pdf

499 KB
Binary file not shown.

extras/Images/AFSV11_bottom.png

101 KB
Loading

extras/Images/AFSV11_side.png

207 KB
Loading

extras/Images/AFSV11_top.png

147 KB
Loading

0 commit comments

Comments
 (0)