Page 2 of 3
Re: project 001 servo multiway controller
Posted: Thu Jul 09, 2015 9:11 am
by davezx
It should work now.
Re: project 001 servo multiway controller
Posted: Thu Jul 09, 2015 9:46 am
by B.Goode
davezx wrote:It should work now.
Oh, the number of times I've said that... !
Re: project 001 servo multiway controller
Posted: Thu Jul 09, 2015 12:11 pm
by BMS Doug
so what voltage did you apply to get it to open, what did you change to get it to shut?
Re: project 001 servo multiway controller
Posted: Thu Jul 09, 2015 3:24 pm
by davezx
I just applied 6v direct from a battery holding wires in hand.
Re: project 001 servo multiway controller
Posted: Sat Aug 22, 2015 8:49 pm
by davezx
Update.
I've been very much let down unfortunately by a 'friend' who said it would be easy for him to write the software for this project.
Is there anyone in here that writes software programs that is available to help please?
This is for a multimedia system for my car and is needed to be all done and installed into my car before september 10th.
It will take me about 2 days to fit in car properly.
Please if anyone can help let me know.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 12:13 pm
by BMS Doug
davezx wrote:Update.
I've been very much let down unfortunately by a 'friend' who said it would be easy for him to write the software for this project.
Is there anyone in here that writes software programs that is available to help please?
This is for a multimedia system for my car and is needed to be all done and installed into my car before september 10th.
It will take me about 2 days to fit in car properly.
Please if anyone can help let me know.
I don't think that anyone will be able help without a better description from you of how this operates.
Have you solved automating the open / close issue?
when you say you connected a 6v battery to the motor and it drives, does that mean it will endlessly drive open and shut while the battery is connected without any further alteration by you? Or do you need to reverse the battery to drive it the other direction?
Do you have a multimeter? can you test to find continuity when the end-switches make (as the screen reaches the fully open and fully closed positions)?
Please take some pictures and post them to a picture hosting website and post the pictures here.
Until there is a definition of how the unit operates there is no way that anyone can write a control program for it.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 1:05 pm
by davezx
All I did to open it was place 9v directly on the motor and reversed the current to close it
To make sure it still worked as it should.
It does have a circuit with limit switches that the motor plus into but they don't seem to work.
So I'm hoping to use the nano v3 to move the motor in one direction to open it and opposite direction to close it at the push of a button for each way.
I will take a picture when I get home of inside the unit (I've already striped it down).
For now I'm hoping to use a program to run the motor in either direction for the correct time (I could modify the time limit on the program to only be in for the time it takes to do a complete open/close cycle).
But I would like to learn too how to make it automatically close again when the car is turned off.
To help with this I bought a timer circuit that stays on to keep the power to the nano for a set time after power is turned off thus allowing it to close fully.
Please bear with me as I find it hard to explain properly.
Overall I'd like to make it appear that it was fitted from factory and therefore try to get it to work as such.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 1:19 pm
by joan
Neither a Pi nor an Arduino can drive a DC motor by itself - you also need a motor driver board.
Originally you were going to use a servo. Both a Pi and an Arduino can drive a servo without a motor driver board.
I think you should document how you think this will all work.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 1:44 pm
by BMS Doug
I agree with Joan
BMS Doug wrote:
do you have any details of the motor you have?
you will need a
motor driver circuit (servos have them built in) such as a L293D or L298N (most of these come packaged as dual h-bridge, you will only need to use half of this).
As I said awhile back, to control a motor you will need a H-bridge Motor driver (you could make your own but really why bother? they are very cheap to buy). The specifics of the motor driver you need will depend on the motor voltage and current but I'd be surprised if a L293D or L298N wouldn't be good enough for your needs. I doubt if you would need a heat sink (the motor won't be continuously running) so I'd probably suggest the L293D.
You need to confirm the operation of the end switches or get the drive time exactly right.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 2:16 pm
by davezx
So the nano v3 can't be programmed to turn the motor on and off as required?
The small motor is already housed in the unit, I thought the nano could be programmed to switch it on and off.
It's just a pain simple 9-12v dc motor with a plain 2pin power connector.
I've just ordered a h bridge driver board.
So I take it the nano is of no use to me for switching the motor.
I was going to use it in connection with the pi but was advised to use the nano seperate to the pi as it's only to switch the motor on and off when I press a button.
This is my first project with any linux programming.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 2:56 pm
by texy
No neither the nano nor the pi can be used to directly control the motor. Not unless the current draw is a few mA's, which I doubt it is.
As you have a motor control board on the way, I can see not need of the nano at all - you should be able to connect the motor to the board and the board to the pi.
Whilst you are waiting for the motor control board, research how to drive it with the pi.
Lets hope you got a board that is compatible with the pi, ie 3.3v input level.
Texy
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 2:58 pm
by BMS Doug
The Nano is a small micro-controller (does some of the same jobs as the Pi but is smaller, quicker to start up, and is much better at cope with unexpected power downs).
Micro-controllers generally need a motor driver if they are going to drive a motor (they can't handle the power directly).
Which H-bridge have you ordered? (link please)
The H-Bridge can be connected to either the Pi or the Nano.
The Pi and the Nano can also be connected together so that the Pi can tell the Nano to open or close the display and the Nano can tell the Pi to shutdown or wake up (wake-up is probably slightly harder).
I'm not certain that you will be able to get this working by September the 10th.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 3:59 pm
by davezx
Thankyou, it's good to know that they can at least still all work together.
This is the board Ive ordered.
http://www.ebay.co.uk/itm/391205303147? ... EBIDX%3AIT
Hopefully it's the correct one.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 4:28 pm
by joan
I'd get a L9110S based board and keep that motor driver board for future use with an Arduino. It'll be a pig to connect that to a Pi or a Nano. See
http://www.ebay.co.uk/itm/301582158434
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 4:54 pm
by davezx
Is that any good tho for a motor? I'm not using a stepper motor just a plain straight forward motor.
Will the one I've got do the job?
Can't just keep buying loads of bits to make a motor simply go forward and backwards.
Was originally told the pi would do it in its own and then a nano v3, then the one I just ordered, now this one, lol.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 5:01 pm
by joan
davezx wrote:Is that any good tho for a motor? I'm not using a stepper motor just a plain straight forward motor.
Will the one I've got do the job?
Can't just keep buying loads of bits to make a motor simply go forward and backwards.
Was originally told the pi would do it in its own and then a nano v3, then the one I just ordered, now this one, lol.
Yes, it will do the job.
You were told a Pi would do it on its own when you said you would be using a servo. A DC motor is driven differently. I doubt you have the skills needed to get that Arduino board to work with the Pi.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 5:26 pm
by davezx
Thats very true, I haven't a yet, but I enjoy learning.
This is why I'm trying to learn how to do the basic code to get the motor to work by using a single push button switch to open and close it.
Then I will try advance to linking then together so that it will work with the pi.
Surely if the nano can switch on and off a light bulb for a timed amount then same application could be used for this.
But I will learn how to do it, no matter what it takes.
Re: project 001 servo multiway controller
Posted: Mon Aug 24, 2015 7:05 pm
by davezx
This is the motor in the housing unit.
Re: project 001 servo multiway controller
Posted: Tue Aug 25, 2015 7:14 am
by BMS Doug
davezx wrote:Is that any good tho for a motor? I'm not using a stepper motor just a plain straight forward motor.
Will the one I've got do the job?
Can't just keep buying loads of bits to make a motor simply go forward and backwards.
Was originally told the pi would do it in its own and then a nano v3, then the one I just ordered, now this one, lol.
Unfortunately you seem to buy something as soon as it is mentioned without understanding how it can be used.
I told you that the Nano V3 was an example of a small arduino microcontroller that could do the same job as the Pi (controlling the opening and closing of the screen either by directly controlling a Servo or by driving a H-bridge motor driver chip).
This wasn't inteaded as a suggestion that you buy one, just that you needed to decide whether a Pi was the correct microcontroller for your application.
You then bought a Nano V3.
We told you that a motor driver was necessary but the one you have chosen is designed to sit on top of an Arduino Uno. You don't have anything with the Pin Layout of an Arduino Uno so the driver board you have chosen is unsuitable for the task at hand. Wiring up the board you have purchased to either a Pi or a Nano V3 would be possible but complex.
I agree with Joan that the level of complexity is beyond your current skill.
The
L9110S that Joan suggests is much smaller and far easier to connect.
The seller of the L293D you selected offers a 60 day return policy, if you contact him/her they may not have sent it out yet. (if they have sent it then you are out by £1.70 as it will cost more than that to return it).
Re: project 001 servo multiway controller
Posted: Tue Aug 25, 2015 7:19 am
by BMS Doug
Davex: where in the UK are you?
Once you have all the correct pieces you may be able to find a
local makers group where someone might be able to help in person (such things are much easier face to face).
Re: project 001 servo multiway controller
Posted: Wed Aug 26, 2015 9:59 am
by davezx
I'm in Doncaster, South Yorkshire.
Is there a book on learning how to write scripts specifically for motor projects?
Re: project 001 servo multiway controller
Posted: Wed Aug 26, 2015 10:12 am
by joan
davezx wrote:I'm in Doncaster, South Yorkshire.
Is there a book on learning how to write scripts specifically for motor projects?
I doubt it.
viewtopic.php?f=45&t=16118 shows how I got your shield (at least I think it's the same) to work with the Pi. Some could replicate what I did, some couldn't.
The L9110S in comparison is a doddle. Connect ground and two GPIOs to the board. Set 1 GPIO high the other low for forward, change the polarity for reverse, set both to 0 to stop.
Re: project 001 servo multiway controller
Posted: Wed Aug 26, 2015 12:32 pm
by davezx
Thank you for your advice Joan.
Im going to learn how to do this but it's going to take time.
The nano was bricked after I plugged it in to the laptop so that's now in bin.
So to start with I'm going to break it down into sections.
Firstly I want to learn how to write a script to make the motor move the unit from point to point and then stop there, activated by pressing a push button.
Press it again to reverse the unit back to home position Using a Iindependent board.
So I will make that my first goal hopefully leaving the pi free to add on to it at a later stage.
This will hopefully help me learn and get the project started in the right direction.
Re: project 001 servo multiway controller
Posted: Wed Aug 26, 2015 2:39 pm
by BMS Doug
Fish the Nano out of the bin, it may be salvageable later (once you understand more about how these things work).
Break your project down even further:
Stage 1:
Have a program that registers when a button is pushed.
Stage 2:
have a program that will drive an LED on for 10 seconds.
Stage 3:
Have program that registers button push and turns on LED for 10 seconds.
Stage 4:
add a second LED, have program turn on LED 1 for 10 seconds when button is pushed and then when button is pushed again it will turn on LED 2 for 10 Seconds.
Stage 5:
replace LED's with enable signals for motor driver chip.
Re: project 001 servo multiway controller
Posted: Wed Aug 26, 2015 7:32 pm
by davezx
Them steps seem fine to me, this way can build it up to the eventual workings.
So question is,where to get the necessary guide to be able to write the scripts needed.