A general DC continous Motor which is controlled by 2 inputs.
A motor controller (such as Arduino or AdafruitMotorShield) is needed for the Motor service to attach.
One of the most useful methods is the motor's move(powerLevel). The powerLevel needs to be a float value between -1.0 and 1.0
0.0 is stop. 1.0 is full power in a clockwise direction, and -1.0 is full power is a counter clockwise direction. And fractional value will resolve to a fractional amount of power which the motor controller can supply. e.g. 0.5 would be clockwise at 1/2 power.
Interfacing a motor and motor controller in Python
Be aware that this service use AnalogWrite so it can not be used on all pins.
On the Arduino Uno pins 3,5,6,9,10 and 11 can be used.
On the Arduino Mega pins 2-13 and 44-46 can be used.
For other boards please check the reference below
References
https://www.arduino.cc/en/Reference/AnalogWrite
MOTOR TYPE - SIMPLE - 1 PWM & 1 DIR
-
DFRobot v1.3 Dual 2A HbridgeThis is a 4.8-46V, 2A Dual Motor Controller which is the revised version of the DF-MDV1.0. Its performance has been improved greatly. It can bear larger current due to the increased haetsink dissipation. It is easy to control, using LGS's outstanding high-power motor driver chip, the L298N. This chip allows for direct drive of two bi-directional DC motors, and incorporates high-speed short diodes for protection. Drive current up to 2A per motor output. The driver uses a broad-brush design to reduce wire resistance.
References
[[service/Motor.py]]
[[service/MotorC16.py]]
Above python code seems to be
Thank you Darek ! That is
Thank you Darek !
That is great.. the script was out of date.. I have updated your script slightly and moved it into the repo as the main example. Could you test it to be sure it works.
Thanks for the help !
my pleasure (; Now script is
my pleasure (;
Now script is working fine.
but I found small bug related to motor speed ( + direction):
What H-Bridge are you
What H-Bridge are you using?
1.0 should correspond to analogWrite 255 for a pwm pin - if that is not what your getting can you send me a no-worky (has to have DEBUG logging set or I won't get the values passed to the Arduino)?
I watched the values is a reduced script which only uses m1 .. and motor.move(1.0) gives me 255 on the pwm pin
for example :
sendMsg -> MAGIC_NUMBER|SZ 3|FN 2|P0 3|P1 127
sendMsg -> MAGIC_NUMBER|SZ 3|FN 0|P0 4|P1 0
you 'are right. I Have the
As it turned out, this driver
As it turned out, this driver need 3 wires control:
what is IN1 HIGH IN2 HIGH ?
what is IN1 HIGH IN2 HIGH ?
EXPLODE ?!?! :D
I can probably do this, I will see...
your proposal is interesting
your proposal is interesting and will hand over to producer (;
Ya 3 wire I will do.. but I
Ya 3 wire I will do.. but I was asking the question, what does you document for the H-bridge say will happen when both direction wires are high? Nothing, or will it melt the H-Bridge ?
Sorry, I did not make myself clear.
for motor DC driver high high
for motor DC driver high high state is not descreibed
for driving stepper motor - yes
datasheet:
http://www.icstation.com/ebay/IC/All%20data%20modules/1381.zip
HELLO EVERYBODY here the
HELLO EVERYBODY
here the scrip python for people use this L298 like me for drive this motor dc
thank you tony