Skip to content

Feat h7 current sensing #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/arduino_mbed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: MDED
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update
project-type: library
build:
name: Test compiling
runs-on: ubuntu-latest

strategy:
matrix:
arduino-boards-fqbn:
#- arduino:mbed:giga # arudino giga
- arduino:mbed:nanorp2040connect # arduino nano rp2040 connect
- arduino:mbed:nano33ble # arduino nano 33 ble
- arduino:mbed:envie_m7 # arduino portenta

include:
- arduino-boards-fqbn: arduino:mbed:nanorp2040connect
sketch-names: open_loop_position_example.ino

- arduino-boards-fqbn: arduino:mbed:nano33ble
sketch-names: open_loop_position_example.ino

- arduino-boards-fqbn: arduino:mbed:envie_m7
sketch-names: open_loop_position_example.ino

# - arduino-boards-fqbn: arduino:mbed:giga
# sketch-names: single_full_control_example.ino


# Do not cancel all jobs / architectures if one job fails
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@master
- name: Compile all examples
uses: ArminJo/arduino-test-compile@master
with:
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
required-libraries: ${{ matrix.required-libraries }}
platform-url: ${{ matrix.platform-url }}
sketch-names: ${{ matrix.sketch-names }}
sketches-exclude: ${{ matrix.sketches-exclude }}
build-properties: ${{ toJson(matrix.build-properties) }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![RP2040 build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/rpi.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/rpi.yml)
[![SAMD build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/samd.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/samd.yml)
[![Teensy build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/teensy.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/teensy.yml)
[![MBED build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/arduino_mbed.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/arduino_mbed.yml)

![GitHub release (latest by date)](https://img.shields.io/github/v/release/simplefoc/arduino-foc)
![GitHub Release Date](https://img.shields.io/github/release-date/simplefoc/arduino-foc?color=blue)
Expand Down
11 changes: 7 additions & 4 deletions src/BLDCMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ int BLDCMotor::init() {
P_angle.limit = velocity_limit;

// if using open loop control, set a CW as the default direction if not already set
if ((controller==MotionControlType::angle_openloop
||controller==MotionControlType::velocity_openloop)
&& (sensor_direction == Direction::UNKNOWN)) {
sensor_direction = Direction::CW;
// only if no sensor is used
if(!sensor){
if ((controller==MotionControlType::angle_openloop
||controller==MotionControlType::velocity_openloop)
&& (sensor_direction == Direction::UNKNOWN)) {
sensor_direction = Direction::CW;
}
}

_delay(500);
Expand Down
12 changes: 8 additions & 4 deletions src/HybridStepperMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ HybridStepperMotor::HybridStepperMotor(int pp, float _R, float _KV, float _induc
void HybridStepperMotor::linkDriver(BLDCDriver *_driver)
{
driver = _driver;
SIMPLEFOC_DEBUG("MOT: BLDCDriver linked, using pin C as the mid-phase");
}

// init hardware pins
Expand Down Expand Up @@ -64,10 +65,13 @@ int HybridStepperMotor::init()
P_angle.limit = velocity_limit;

// if using open loop control, set a CW as the default direction if not already set
if ((controller==MotionControlType::angle_openloop
||controller==MotionControlType::velocity_openloop)
&& (sensor_direction == Direction::UNKNOWN)) {
sensor_direction = Direction::CW;
// only if no sensor is used
if(!sensor){
if ((controller==MotionControlType::angle_openloop
||controller==MotionControlType::velocity_openloop)
&& (sensor_direction == Direction::UNKNOWN)) {
sensor_direction = Direction::CW;
}
}

_delay(500);
Expand Down
11 changes: 7 additions & 4 deletions src/StepperMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ int StepperMotor::init() {
P_angle.limit = velocity_limit;

// if using open loop control, set a CW as the default direction if not already set
if ((controller==MotionControlType::angle_openloop
||controller==MotionControlType::velocity_openloop)
&& (sensor_direction == Direction::UNKNOWN)) {
sensor_direction = Direction::CW;
// only if no sensor is used
if(!sensor){
if ((controller==MotionControlType::angle_openloop
||controller==MotionControlType::velocity_openloop)
&& (sensor_direction == Direction::UNKNOWN)) {
sensor_direction = Direction::CW;
}
}

_delay(500);
Expand Down
Loading