@liemph and @ajb2k3 Thanks. I ordered a few. It will take several weeks, but they will be useful. Also for other projects I am working on.
Best posts made by Kees
-
RE: M5StickC and 18650C endurance
-
RE: Simple PWM example does not work
@teastain Thanks. I asked the supplier for information, but what I posted earlier was what I got. With the help you gave, some help from ChatGTP and a lot of trying and experimenting I hope to find an answer. I'll let it now here. Thanks again for the help, it is much appreciated!
Latest posts made by Kees
-
RE: Simple PWM example does not work
@Kees The above finally worked with the M5StackSimpleServo library. However it turned out that I could only control speed and direction. Using degrees 0-90 for retraction and 90 - 180 for extending. It is not possible to position, this was finally confirmed by the seller. Again searching for actuators that can position.
-
RE: Simple PWM example does not work
Tried to upload a small video to show both at work at once (with wrong extending). No privilege, not possible.
-
RE: Simple PWM example does not work
For some reason it does something now. Not really sure what made it work. It did however change the frequency to 200. Somewhere I read that that was necessary for ESP32. It seems to be working.
However, I can not position it the way I want and need it. It extracts not to the complete length of the rod (it should extract 12cm, it does about 7cm) and when retracting it keeps spinning as though it expects to retract more (that is in accordance to the not fully extending. So, anyone an idea? Something about the initial zero position and how to set this up?
Below the current 'simple' code.#include <M5Atom.h>
const int8_t linActPin1 = 33;
const int8_t linActPin2 = 23;
const int linActChannel1 = 1;
const int linActChannel2 = 2;
const int linActFreq = 200;
const int linActResolution = 8;uint8_t method;
void setup() {
Serial.println();
ledcSetup(linActChannel1, linActFreq, linActResolution);
ledcAttachPin(linActPin1, linActChannel1);
ledcSetup(linActChannel2, linActFreq, linActResolution);
ledcAttachPin(linActPin2, linActChannel2);
}void setServoPos(int8_t pos) {
ledcWrite(linActChannel1, pos);
ledcWrite(linActChannel2, pos);
}void loop() {
method = 1;
Serial.print("O");
for (int posDegrees = 0; posDegrees <= 180; posDegrees++) {
setServoPos(posDegrees);
delay(50);
}
Serial.print("I");
for (int posDegrees = 180; posDegrees >= 0; posDegrees--) {
setServoPos(posDegrees);
delay(20);
}
Serial.print("-");
} -
RE: Simple PWM example does not work
@teastain Thanks. I asked the supplier for information, but what I posted earlier was what I got. With the help you gave, some help from ChatGTP and a lot of trying and experimenting I hope to find an answer. I'll let it now here. Thanks again for the help, it is much appreciated!
-
RE: Simple PWM example does not work
@teastain Two wires go to the rod, but it seems they come from a PWM module (in the specs you can see that that is a tiny device). And that module has three wires, brown (ground I think), red (+5V perhaps), and orange (PWM wire?). I have tried different sketches also with the Arduino Library (not the right type). I did not try and did not find the ESP32 Servo Library yet.
But perhaps I blew up the rods already. I do not know how vulnerable they are. Hope to find some sign of life in it. -
RE: Simple PWM example does not work
@teastain Thanks. A few questions. The first ledcAttachPin does not apply here I presume. The math is not clear to me. 180 probably has to do with degrees, 2.000 perhaps frequency, then a 20.000.0 I do not understand, the 65536 is probably a 2 byte shift and then another number (16340 I do not understand. Perhaps you have a link to a site with some information about this.
The rods I can not reposition by hand; or actually, I do not want to use force, it does not shift easily.
The coming few days I have less time, so maybe I do not respond, this not a lack of interest, but just other things that require my attention and or time.
Thanks anyway, much appreciated.
-
RE: Simple PWM example does not work
@teastain On the controllers it says Atom Lite, nothing more. Is there another way to distinguish them, does is otherwise say Atom Lite S3?
I applied a separate power supply. This what the specs tell:- The mini electric push actuator is equivalent to a linear motor : through the red and black two power lines to provide DC power supply DC 6-7.4V to the motor rotation, and drive the telescopic rod to achieve expansion, and stroke in any position can stop, can be self-locking.
2.With PWM electric control : can be controlled by the receiver, can adjust the speed and direction.
3.PWM module parameters :
Weight:0.4g
Size:12x8.5mm
Voltage:3.5-6v
Continuing current:1A ,The biggest current: 1.5A
PWM range:1000~2000US
BEC output: No
Running direction: two-way, can be forward and reverse.
Applicable motor:Brush motor.
Maybe this is enough. I could not get it working. Except for one moment it completely expanded, however I not reverse it or achieve another position. Hope you have some advice for me.
- The mini electric push actuator is equivalent to a linear motor : through the red and black two power lines to provide DC power supply DC 6-7.4V to the motor rotation, and drive the telescopic rod to achieve expansion, and stroke in any position can stop, can be self-locking.
-
RE: Simple PWM example does not work
@All I finally added a second LED that I controlled with a digitalWrite and that worked fine (even better without the resistor used in the schematic). After playing with the connections (again) finally I saw the light (literally). I believe the contact of the pin in the Atom Lite does not make good contact (have to find something that does, otherwise quite unreliable). So this seem to work. Thank you guys for that.
However I still have a question about using it for the linear actuator. It has a three wire input. A brown one, probably ground, a red one (5V? (document states Voltage 3.5 - 6V) and an orange one (control signal). I can not find much information about connecting such a device. Tried several setups with different frequencies (1000-2000), but nothing seems to work. Maybe an external adapter is needed. Any idea how to connect it?
-
RE: Simple PWM example does not work
@teastain
The LED won't light up. However I did measure about 3.3V on the output pin before. I expected this to increase and decrease. It did not.
Now I don't have time anymore, but when have another suggestion I will try it tomorrow.
Thanks! -
RE: Simple PWM example does not work
For now a LED (but finally I hope to control a 5V linear actuator. The LED example is to experiment.