Hi,
Having read Ben's instructions, I am now a little confused about the table of speeds at the bottom of the article.
I understand with PWM, a set voltage is applied to the motor for a set period of time, and then switched off for a period of time. By switching the power on and off with different ratios, the motor runs at different speeds as the on/off voltage averages out. Please correct me if I'm wrong.
The instructions say that a mark space of 0 gives 100% off - ie no power is applied through that cycle. If the mark is 255, then power is applied for the whole 255 (1 byte) cycle, so the motor is running at full speed for the voltage applied.
From this, I would presume that a mark of 50% (ie 128) would run the motor at half speed, and 25% (ie 64) would run at quarter speed etc...
A separate bit is used to indicate if the motor is to spin forwards, or backwards.
However, the table shows..
0 mark 0 direction = stopped - OK
0 mark 1 direction = Max Speed ? - Surly 0 mark=0 speed!
64 mark 0 direction = Stopped ? - Surly 64=quarter speed
64 mark 1 direction = Half Speed - Again, why not quarter speed...
and so on.
I'm obviously missing something here. Please explain!
Many thanks,
Dave
PWM with FF Buggy
Moderator: Benj
-
- Posts: 26
- Joined: Thu Jul 12, 2007 4:59 pm
- Location: Nr Ipswich, Suffolk, England
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
In Forwards mode the current travels from the direction pin and out through the PWM pin. This means that the more off the PWM is the more current flows through the motor.
In backwards mode the opposite occurrs so that the current travels from the PWM pin through to the direction pin.
Also the motors only start to respond about 50% of the way through the PWM cycle. Eg when the current is travelling more then 50% of the time.
There is an update for flowcode being released today with any luck that will contain the Formula Flowcode component. This is a much simpler way to control the Micro-mouse.
In Forwards mode the current travels from the direction pin and out through the PWM pin. This means that the more off the PWM is the more current flows through the motor.
In backwards mode the opposite occurrs so that the current travels from the PWM pin through to the direction pin.
Also the motors only start to respond about 50% of the way through the PWM cycle. Eg when the current is travelling more then 50% of the time.
There is an update for flowcode being released today with any luck that will contain the Formula Flowcode component. This is a much simpler way to control the Micro-mouse.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel