Thank you @o_lampe - with v1 I am not able to get velocity higher than 12, with v2 i can get up to 30 etc. So, that is why I kept to 3v. However, I will change it to v1.
Currently testing without the Commander but I am going to connect the controller to CM4. So probably will use Commander in deployment.
Correction, it does not work under 2v. It goes up to 12 in velocity with 2v.
If you have provided an enable pin to the driver configuration (in your case it is pin # 8) then calling this will disable the driver, and the motor won’t be powered (and won’t get hot any more).
If I set L0, I believe it sets the voltage to Zero. However, after that, only way I can get it going again is by rebooting. I tried giving L3 and then try to set position T10 but no result. I seem to be disabling it completely after setting L0. Any suggestion?
Yes, please take a look at our “full control” examples. Basically, you use the commander.motor() function to enable full control of all the motor parameters via serial.
Assuming you assign the letter ‘M’ to the motor like in the documentation, you can then type:
Now that I do understand a bit more about SimpleFOC, I want to take advantage of more features and have some questions relating to that:
My motor is going to move my device from one side to another on a rope. At the end of the rope (on one of the sides, obviously), there is a docking station for charging. With help of simpleFOC, i want to gracefully dock the device for charging.
currently I am trying this BGC 3.1 clone that comes with 6050 gyroscope and accelerometer sensor. Can I utilise this sensor to slow the device when it is about to approach the dock and smoothly dock itself? So, basically getting it to remember how far or close to the docking station it is. Because its on a rope, there will be a slight upward angle at the end.
I am not using any encoder at the moment, is that ok or would you recommend it for this task? My assumption is that the rotation of the motor drive wheel is not as relevant as distance calculation because the wheel may slip on the rope. A slipped wheel will have rotation counted but that will impact the distance accuracy.
These MCU6050 tend to drift over time. That’s why they are often used with other sensors to compensate. Sensor fusion is a complicated chapter. Beside one user project, I haven’t seen sFOC examples how to implement it.
There is a good Arduino-library, tho. Maybe there you can find some ideas about sensor fusion.
You should definitely add a position sensor. SFoc is running blind without it and the motor is very unefficient. (No torque to speak off, but getting hot)
There are other sensors to detect distance to an object. Inductive or capacitive sensors (LJ12A… or LJC18…) with either analog signal or switch mode. Then there is the Arduino-robotics ultrasonic sensor HC-SR04 . It can reach upto a few meters.
Yes, but these cost extra, and still don’t guarantee the charger connection is made.
If the connection is mechanically stable, which is has to be in order to charge, why not detect the connection? Simple and reliable, and ultimately measuring the quantity you’re really interested in, rather than a stand-in quantity (distance to end) which you hope has the same meaning.
But you’re right that explicitly measuring the distance would be better than using an IMU. For this I would recommend STMicro’s VL53Lxxx line of ToF sensors - https://www.st.com/en/imaging-and-photonics-solutions/time-of-flight-sensors/products.html
They’re a nice replacement for the old-style sonar sensors, with better accuracy and (much) smaller package size.
Yes, the charge connection will be used to detect end stop, battery temp etc. However, because it is upward slop i dont want to go in charging fast and then have sudden stop with a jerk. I also thought of rfid a 100mm prior to warn it of upcoming stop. Would that be a good idea?
Based on all the feedbacks, encoder seems like a must for efficient running of a motor.
I do have some motors with back cover and encoder that fit perfectly for my use case. I am just not sure of this encoder…is this good? " AS5048A magnetic encoder"
Do you think it is compatible with my controller board?
If you are cv using an encoder and your device is pulled by a string, you have an implicit indicator for your distance to the charger, by simply calculating how much of the string is left on the spool. Detecting the far end is also easy then (position doesn‘t change as expected). This should solve your problem of slowly approaching the docking station.
And here is the encoder…what puzzles me is that it has only 3 wires. I read everywhere that an A variant should have 6 wires. I took a close up photo with my phone and it certainly says AS5048A. If 3 is ok, which 3 should i connect here?