Software Support > Automated Projects
Drive L298n with mrotate.
pixel.arcade:
hello people
Finally decided to put the project into practice to rotate the screen using the arcade excellent program "Mrotate."
In the initial test'm having problems with starting the windows, because during the startup the engine gets mad, let's look at the situation in the video.
DaOld Man:
Ah yes, the main axe to grind with the printer port.
During bootup, windows (and the PC BIOS) does some crazy things. Outputs are turned on and off.
If you have inputs wired to your printer port, try attaching one to the printer port ground, see if it acts differently.
(NOTE: I said INPUTS which are pins 10,11,12,13, and 15, DO NOT connect any other pins other than these directly to the ground! You can fry your printerport if you connect an output directly to ground or +5vdc)
The way I got around this was to use one output that always stayed on after the bootup, to disable the drive so the motor wouldnt turn.
I found on several PCs that this magic output was pin 4.
MRotate, when it first starts up, sets all outputs low.
So the trick was to make pin 4 "kill" the drive if it was high.
I did this with a pnp transistor.
Does your drive have a enable input? If so you can do this pretty easily.
Here is a rough drawing which might explain how I did it:
In this drawing I used printer port connections that are standard, the outputs you actually used may be different.
Pin 2 and pin 3 go to the drive direction inputs.
Pin 5 goes to drive enable input.
pin 4 turns the transistor on and off.
If pin 4 is high, the pnp transistor is turned off, so the drive is disabled by the drive enable input being tied to ground through R2.
When pin 4 goes low, the transistor turns on, so if pin 5 goes high, the drive enable input is turned on through form pin 5 through Q4. If pin 5 goes low then drive enable is turned off regardless if pin 4 is high or low.
This circuit is basically a cheap inverter, inverting pin 4's output
If you dont have a drive enable, or you dont want to use it, you can double the circuit to kill the cw and ccw drive inputs much the same way.
The rule is to find which PP output stays high from power up till windows boots, and use it as the disable output.
This can be tricky, because the printer port reader does not work until after windows boots.
I would try pin 4, it has always worked for me, if you have a spare led and resistor (350-400 ohms), you can hook it to pin 4 and ground and watch it while the PC boots. I would almost bet that it stays lit until yo turn it off in printer port reader.
edit: If you dont want to hook the led to pin 4, a lot easier way to test this is to unhook one of your drive inputs and hook the other to pin 4. Boot the pc, if the motor stays on throughout the whole boot up process then this is the one you want to use to control the drive enable. I say unhook one drive input because if both drive inputs are high, the drive goes into braking mode and the motor doesnt run. That is why the motor stops when windows does it thing and turns on all the PP outputs. (I notice in the video that all the outputs are on when pport reader starts.)
Nice video, I appreciate you taking the time to do it, it helps a lot, pictures are worth a thousand words, videos are worth a million or more.
Instead of the transistor you can also use an opto isolator. All parts should be available at radio shack, let me know if you need part numbers.
DaOld Man:
Ive been thinking about this (where did I put that bottle of tylenol?)
Can you post a link to the drive you are using?
if your drive has an input called NOT ENABLE (may be labeled EN or ENABLE with a line above it), then you may be able to tie this directly to the pport pin 4. If it has the NOT EN input, if this input is high, the drive should be disabled.
You will still have to find the magic pport output that stays high throughout the whole boot process, and since the pport outputs cant supply much current, and Im basically anal about being cautious, I would put a 400 ohm resistor between the output and the NOT EN drive input, to limit current draw on the pport pin, just in case. (This may not be necessary, perhaps specs on the drive will tell max current draw on that input).
pixel.arcade:
hello great master "DaOld Man" :notworthy:
The configuration of the pins on Mrotate are as follows: Pin 3 = Enable
Pin 4 = Reverse
Pin 6 = Forward
I am following the design
http://imageshack.us/a/img812/5295/projeto1n.jpg
I'm using a module L298N, see details:
DaOld Man:
Only thing Im master of is my dog, and sometimes I wonder about that!. LOL
The number you gave (L298N) is the chip on the drive (it is really the drive, but the other parts on the board interface the real world to the drive and do some vital functions.)
Are those jumpers on the enable inputs? I was wondering how the motor would still run when you had output 3 set low in the video. Do you need to remove the jumper to use the enable?
Do you have a link to the place where you got the drive? Any documentation?
If that jumper is to be removed to use the enable, you definitely want to do that.
Im thinking with the jumper in, the enable is set high all the time by the drive's circuit. But I may be wrong.
Anyway, back to your printer port outputs: If you can use pin 4 to enable/disable the drive like I mentioned in my first post, you will need to select a different output in Mrotate for reverse.
May I suggest Pin3=Enable Pin 5= reverse Pin 6= Forward.
Without drive documentation its kinda hard to tell for sure how to wire the drive.
In your video it looks like there are 4 wires coming from printer port, one of course is ground, but the other three seem to be going to the input pins on the drive. Can you draw me a pic of which pport pin connects to which drive pin?
Im thinking the drive enable jumper needs to be removed and the enable output from pport attached in its place, but in your video it looks like the jumper is still in on the drive.
Navigation
[0] Message Index
[#] Next page
Go to full version