Hello. We use the SparkFun RedBoard Artemis ATP microcontroller board to control two gimbal SparkFun 12V 3-Phase BLDC motors with encoders AS5048A via two SparkFun 11V Brushless TMC6300 motor-drivers. A short SimpleFOC code (please see below) was uploaded to check whether or not each motor works. Notice that motor.controller = MotionControlType::velocity_openloop used in the code does not require any sensors (encoders). The motors did not move at all. Then, we used an oscilloscope.
The oscilloscope showed just noise when we consequently connected its terminal to the microcontroller board pin ~18, ~37, ~44, please see photo attached. It was evident that the short SimpleFOC code was not supported by the microcontroller board. Next we connected the oscilloscope terminal to pin ~19 and uploaded a short code with digitalWrite(PIN, HIGH) with delay(3000) without any SimpleFOC code. The oscilloscope showed a good square curve.
Thirdly, we used the short SimpleFOC code for the motor #1. We connected pin ~19 to the oscilloscope terminal. The oscilloscope showed just noise again. It is evident that the SparkFun RedBoard Artemis ATP board does not work with the SimpleFOC code for some reason. Could somebody please clarify what is wrong? Is the short SimpleFOC code below wrong? Here is the short SimpleFOC code:
/*
The following code was built based on the example SimpleFOC control
code published on this webpage Position Control example | Arduino-FOC by editing the example SimpleFOC control code.
*/
#include <SimpleFOC.h>
#include <Arduino.h>
// Setting Motor #2 having 11 coil pairs
BLDCMotor motor2 = BLDCMotor(11);
// Initialize 6PWM motor-driver
const int VIO_PIN2 = D1;
BLDCDriver6PWM driver2 = BLDCDriver6PWM(D37, D18, D45, D44, D42, D43, VIO_PIN2);
float target_velocity = 12.0; // radians per second
void setup() {
driver2.voltage_power_supply = 7.4;
driver2.init();
motor2.linkDriver(&driver2);
motor2.voltage_limit = 7.4;
motor2.controller = MotionControlType::velocity_openloop;
motor2.init();
}
void loop() {
motor2.loopFOC();
motor2.move(target_velocity);
}
Thank you.





