Wir müssen uns unbedingt mal treffen :).
Yes, I use abz mode. Other modes do not suit me, because initially my goal is to build a steering wheel for the simulator of games))))). I receive the control signal from the stm32 board with emc firmware, and it, in turn, works only with encoders in abz mode. So I connected one encoder to two handkerchiefs in parallel. It works, but the hoverboard motor heats up, and has a deformation of the body)))))) because of which I had to shift the electric angle for each direction of rotation. Having weakened the Magnetic Field, the motor does not heat up so much. It is better of course to organize all this on one mk, but my knowledge is too small for this
Hi. I tried to connect mt6701 via the SSI line and get strange readings. When the rotor turns, the values go from 3.14 to 6.28. Then it resets again to 3.14 and so on in a circle.
Hey, thanks for reporting it!
Not sure what is happening, because there was some similar reports before, I think it is maybe MCU dependent.
Was this the dev branch code or the official library?
Actually the dev branch and master are the same for this code.
On August 19th I committed a fix for a similar problem which affected RP2040 MCUs… which MCU are you using?
Momentan benutze ich ESP32))
@runger Hello. Another, probably stupid question, but still ask. MT6701_CPR 16384 steps are indicated. I am always confused in such places . If the account comes from a zero position, does this mean that the indicated value should be 16383. I only study, why do not scold me strictly:blush:
Hallo!
Der MT6701 hat 14 bit Genauigkeit, also heißt das 14 Bit = 2^14 = 16384 mögliche Positionen pro Umdrehung…
Der Null-Punkt ist durch die Ausrichtung von Magnet und Sensor bestimmt, und ändert sich nicht (also nur wenn du Sensor oder Magnet neu montierst). Der Sensor ist also „absolut“.
Das Problem in diesem Fall ist das wir den Sensor, der eigentlich SSI Protokoll hat, mit der SPI hardware der MCUs einlesen… hier gibt es anscheinend Unterschiede bei den MCUs bei den Timings die dazu führen dass bei manchen MCUs ein Bit zu viel eingelesen wird… dann gibts das Problem das Du beschreibst, weil alle Bits um 1 versetzt sind.
Ich werde das bei ESP32 berücksichtigen, und mach Dir dann eine neue Version der MT6701 Sensor Klasse… aber momentan bin ich Skifahren…
Hope you have great snow ! PCBs are in production.
@nikolaewich1988 Why do you insist on making the MT6701 work. I suppose they are cheep compared to the MT6835, I guess? Did you purchase a lot of them ?
There are more important stepper aspects / potentials / development at hand. And since the MT6835 is working for you, move with the flow. Great idea to get a NEMA34 moving. Was just looking at a disassembly video, and they actually look kinda easy to re-wire. That could lead to some interesting experiments.
Danke für Deine Erklärung.
Ich fand eine Library für mt6701 mit i2c Anschluss. Selbst funktioniert mit esp32 gut. Aber wenn ich gebe Simplefoc dazu, dann startet esp32 unendlich neu
Yes, I have about 10 mt6701 pieces. And only two 6835. In addition, I have not yet seen examples of connecting mt6835 via spi or something else. I have them set to 3000 pulses in abz mode. This is still less than mt6701 in ssi mode. Would be happy to connect mt6835 to nema 34 via spi but no libraries
Correct me if I am wrong, but didn’t @runger release the preliminary SPI lib in the dev. branch ?
I understand it is a pain to let those 10 sensors go, but your time is more valuable then those ten. Sometimes we just have to let stuff go. I suspect you will have a lot of trouble with the MT6701, although you may get ok results eventually, no where near the MT6835 though. So what is your aim. Decent results with a perhaps non-linear sensor or best in class 21 bit.
Regarding the AliExpress thing, you can order directly from MagnTek.
Yeah, you’re right @Juan-Antonio_Soren_E , there is a driver for the MT6835 in the dev branch of our drivers library…
I’ve now had a chance to test it, and the code works for reading angles.
So you could definitely try the dev branch code.
So far however my test setup with a flycat 5010 motor hasn’t worked so well - it seems the MT6835 is quite sensitive, and while it seems to work fine with the motor off, when the motor is powered it reacts strongly to the commutation and accurate readings are impossible. So I have to improve my test setup with a stronger magnet or moving the magnet and sensor further from the motor…
I see, hmm they do have the coils very close to the shaft. I suspect it will behave differently on a NEMA23 or NEMA34. Or like you say, move the sensor/magnet further away.
@runger @Juan-Antonio_Soren_E
My nema 34 looks like this. Magnets 10x3. I have 40mm distances. I’ll try plugging in a library of dev branches für mt6835 .
Wow now that’s what I’m talking about! Be careful…
@runger Hallo. Gibt es ein Beispiel, wie man Library mt6835 mit simplefoc benutzen kann? Ich wollte per serial Port schauen ob es funktioniert. Aber hatte Pech, da ich nicht verstand, welche Variable ich benutzen soll. Meine C Sprachkenntnisse ist nicht genug dafür
#include "Arduino.h"
#include "Wire.h"
#include "SimpleFOC.h"
#include "SimpleFOCDrivers.h"
#include "encoders/MT6835/MagneticSensorMT6835.h"
#define nCS 5
float getSensorAngle();
// TODO code example
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(getSensorAngle());
}
So bekomme ich fehler
Ich bin grad Skifahren kann es also nicht ausprobieren, aber folgender Code sollte eigentlich funktionieren… Kompilieren für ESP32 tut es:
#include <Arduino.h>
#include "SimpleFOC.h"
#include "SimpleFOCDrivers.h"
#include "encoders/mt6835/MagneticSensorMT6835.h"
#define nCS_PIN 5
MagneticSensorMT6835 sensor = MagneticSensorMT6835(nCS_PIN);
long timestamp;
void setup() {
Serial.begin(115200);
delay(2000); // wait 2s for serial monitor to open
while (!Serial) {
; // wait for serial to connect
}
sensor.init();
timestamp = millis();
}
void loop() {
sensor.update();
long now = millis();
if (now - timestamp > 1000) {
Serial.print("Angle: ");
Serial.println(sensor.getAngle());
timestamp = now;
}
delay(50); // wait 50ms, e.g. execute this loop 20 times per second
}
Ich probierte es gerade aus und es funktioniert. Vielen, vielen dank. Gute Fahrt
Hi, freut mich das es jetzt geht!
Am dev branch der drivers library habe ich jetzt auch die Änderung für den MT6701 auf ESP32 drin:
Wenn Du die dev branch version ausprobieren kannst sollte sie dein Problem hoffentlich lösen…
Hallo @runger, danke für deine Nachricht. Ich probiere es später, nachdem ich ein Problem mit meinem Laptop löse. Ich bekam eine Windowsaktualisierung, jetzt habe ich keine Wi-Fi und Bluetooth. Unglaublich