Пікірлер
@kineticpaintings
@kineticpaintings Ай бұрын
Thank you for posting this video. I know it was some time ago. The library seems to eliminate (or rather hide away) most of the mind-boggling PID code (phew!) Your experiment seems to be most of what I am trying to achieve. (I will be exchanging the Pot for a distance sensor and I will need some way of homing at the start) Unfortunately I was not able to get hold of the 'PinChangeInt'* library. It doesn't seem to be available now in that I can't find it in the 'manage libraries' section(or am I wrong) therefore I commented it out and just used pins 2 & 3 for the interrupt pins (instead of 2 and 8) Sadly it does nothing, I get no motor movement at all. If the library *is available and necessary would you send a link please? Many thanks for reading
@raydike
@raydike Ай бұрын
I guess you could use Nico Hood 's PinChangeInterrupt library: github.com/NicoHood/PinChangeInterrupt . Then use this: "attachPCINT(encodPinB1, encoder, FALLING);" Check his example, you have to change the include too of course. I don't have the circuit here to test but you should be able to figure it out.
@kineticpaintings
@kineticpaintings Ай бұрын
@@raydike Thanks, kind of you to reply. I'll have a try👍
@estudiobrutto
@estudiobrutto 2 ай бұрын
J adore, c est ou ca ?
@raydike
@raydike 2 ай бұрын
Le long de la Loire à Beaugency
@thierrythibault7094
@thierrythibault7094 2 ай бұрын
Bonjour sympa la vidéo elle tourne à merveille une belle auto et les vitesses passe bien par rapport a certaine ou cela etait plutôt difficile une version carburateur se suppose ? merci que de souvenirs
@raydike
@raydike 2 ай бұрын
Oui c'est une version carburateur
@dalgrian
@dalgrian 4 ай бұрын
Very interesting!
@woldecosgrove
@woldecosgrove 5 ай бұрын
Hello Ray both program cant work at all, motor is not moving at all ! Why ?
@woldecosgrove
@woldecosgrove 5 ай бұрын
Hello Ray, i finally get it works motor is running,, but unable to control speed via PoT, could you advise ?
@woldecosgrove
@woldecosgrove 5 ай бұрын
hello i rey to duplicate this work, but compile error couldn't find this <PinChangeInt.h> could you help ??
@vanceblosser2155
@vanceblosser2155 6 ай бұрын
My first car was a 1961 404, black with a kind of off white dash. Same red interior. I also had a 403 and two 504s later. I think after the 504 they lost sight of what they had.
@amann815
@amann815 7 ай бұрын
nic sir good work
@Rammstein56
@Rammstein56 8 ай бұрын
That is a very, very early version of the legend❤ J'adore
@ganeshpingle-r3n
@ganeshpingle-r3n 9 ай бұрын
Please🙏
@ganeshpingle-r3n
@ganeshpingle-r3n 9 ай бұрын
Please
@ganeshpingle-r3n
@ganeshpingle-r3n 9 ай бұрын
But j have some question can you help me...
@ganeshpingle-r3n
@ganeshpingle-r3n 9 ай бұрын
Grate video sir
@jashugg
@jashugg 9 ай бұрын
She runs very nicely on top gear, is that direct or overdrive?
@raydike
@raydike 9 ай бұрын
That is direct drive. Unfortunately no way to fit an overdrive. I was lucky to find a new bronze gear for the differential, so that is very quiet now.
@Rammstein56
@Rammstein56 8 ай бұрын
Yacco huile de ricine for the bronze gears, like some vintage Ferrari gear boxes. Actually Enzo had a metallic grey 40r.
@roblox5413
@roblox5413 Жыл бұрын
Circuit please
@raydike
@raydike Жыл бұрын
at the website of Thomas Kim you can find the instructions on how to build this.
@whm36
@whm36 Жыл бұрын
Oh my god. Do you do repairs for others? I have a later model (slightly larger) Veglia clock in my Peugeot 404, wich has the same contact problem. This would be a perfect solution to get the clock ticking again.
@raydike
@raydike Жыл бұрын
The later model clocks (the big round ones) don't have a contact, they work through induction (ATO patent) with a single transistor. They have a very fine wire coil, difficult to modify. Sometimes you can get them running again by adjusting the coil to magnet gap and adjusting the play in the movement bearings. The Veglia ones can have a broken plastic gear, then it is end of story.
@mateogermanorjuelagalvez3820
@mateogermanorjuelagalvez3820 2 жыл бұрын
hello I would like to know, what is the engine reference?
@kifahzaidan4505
@kifahzaidan4505 2 жыл бұрын
Hi, Thanks a lot, its really greate effort and great knowledge. i need to do a project for a preset position linear actuator with a DC motor abd a stepper motor, with Arduino Mega or UNO but i am not able to write the code and the scheme, can you please help. Regards
@kifahzaidan4505
@kifahzaidan4505 2 жыл бұрын
THANKS A LOT CAN YOU PLEASE POST VIDEO FOR THE (CONTROLLING OF DC MOTOR 'ACTUATOR ' PROGRAMABLE POSITION WITH MEMORY BUTTONS USING ARDUINO. BEST
@farazjankhattak5719
@farazjankhattak5719 2 жыл бұрын
where the enable pin of l298 is connected with arduino?
@raydike
@raydike 2 жыл бұрын
enable pin is connected to +5v
@sandovaltrejocarlos3868
@sandovaltrejocarlos3868 2 жыл бұрын
Hi, I was wondering If the Encoder needs to be suplied with an independent external power suply, because I conected the encoder to the same power suply where I connected the L298 as well, Is It correct?
@raydike
@raydike 2 жыл бұрын
The encoder needs 5V this can be supplied by the 5V regulator on the L298 board or any other 5V source as long as they share a common ground.
@keshavkushwah4750
@keshavkushwah4750 3 жыл бұрын
Can you please help me to make a code for dmx stapper motor with encoder
@mouseminer2978
@mouseminer2978 3 жыл бұрын
This is amazing. Is it possible to use encoder instead of 10k pot?
@mehmetcannzam1579
@mehmetcannzam1579 3 жыл бұрын
where is pcb ?
@alexanderkokotkin4502
@alexanderkokotkin4502 3 жыл бұрын
Many thanks! Very interesting job! Can you please tell me if you now have similar ready-made software solutions for proportional control, but with an encoder instead of a variable resistor?
@gagalsarjana6138
@gagalsarjana6138 3 жыл бұрын
Readi
@mernamohamed1682
@mernamohamed1682 3 жыл бұрын
what's the type of dc motor ?
@adnansarfaraz6610
@adnansarfaraz6610 3 жыл бұрын
how we can control with two dc motors plz share code for two motors
@oigencyofficial9038
@oigencyofficial9038 4 жыл бұрын
HELLO,, working with PID has been hectic for the last two weeks! thanks a lot for this great effort!! I have done a few changes on your code to test angles from serial(userInput)! but its not accurate ! would you please help me make the angle more precise!
@David_94
@David_94 4 жыл бұрын
why interrupts are needed when implementing PID on uC?
@keesreedijk7613
@keesreedijk7613 4 жыл бұрын
It is to keep the timing constant. Otherwise if you do something else in the main loop it influences the running of your motor, especially with speed control. For the encoder interrupts are needed anyway to keep correct track of position.
@sankyppp
@sankyppp 4 жыл бұрын
Hi. I am trying to build an automatic clutch using a wiper motor for my old test car. It needs to perform the way you have shown in the first few secs. The potentiometer position determines the position of the clutch. Please confirm if the above project can be used for the functionality I am looking for. kzbin.info/www/bejne/i5iYhqScfLOme6M
@keesreedijk7613
@keesreedijk7613 4 жыл бұрын
In theory yes but you will need a motor with an encoder and a beefier H-bridge. I don't think you need feedback, just a couple of end switches and a strong enough motor will do. Or a linear actuator. Best keep it simple.
@sankyppp
@sankyppp 4 жыл бұрын
@@keesreedijk7613 Thanks for the reply.
@sinanali4564
@sinanali4564 4 жыл бұрын
What's the function of potentiometer in this?
@raydike
@raydike 4 жыл бұрын
It's the thing I'm turning in the video, it provides an input signal for position or speed
@hamidou5126
@hamidou5126 4 жыл бұрын
Thanks for your work bro but we want to know how did you do for getting a model of system ? ( transfer function )
@mehmetcannzam1579
@mehmetcannzam1579 3 жыл бұрын
PID CONTROL
@willy7346
@willy7346 4 жыл бұрын
Good Project. how to set degrees of dc motor 0-180? Like servo code (0 , 1023 , 0, 180) on your arduino code?
@raydike
@raydike 4 жыл бұрын
Output angle depends on the encoder resolution and the gearbox. If you know those then not too hard to calculate.
@jakkrapatkobkratok1436
@jakkrapatkobkratok1436 4 жыл бұрын
hello , Can you share circuit schematic? and code?! to [email protected]
@jakkrapatkobkratok1436
@jakkrapatkobkratok1436 4 жыл бұрын
I can do as you teach, but I can't.
@Mr.ultron879
@Mr.ultron879 4 жыл бұрын
I didn't got why you connected the 9 & 10 arduino PWM pins to motor controller IN1 & IN2 ?? I followed the link www.instructables.com/id/Control-DC-and-stepper-motors-with-L298N-Dual-Moto/, where it is said to drive IN1 & IN2 inputs in complementary way, while in your arduino code for position control, in the function pwmOut(output) M1 is set to drive PWM op and M2 is 0 , and vice versa ?? Please send the clear circuit diagram for speed and position cntrl.
@keesreedijk7613
@keesreedijk7613 4 жыл бұрын
It's called Sign-Magnitude control. www.pcb-3d.com/tutorials/what-is-a-h-bridge-sign-magnitude-and-locked-anti-phase-control-of-a-dc-motor/
@jakkrapatkobkratok1436
@jakkrapatkobkratok1436 4 жыл бұрын
I have followed all of you, but the motor is not working.
@raydike
@raydike 4 жыл бұрын
Go step by step. First test the motor and H bridge by sending a PWM signal to it. If that works see if there is a signal from the encoder. An oscilloscope helps. You can also use serial commands to monitor signals.
@jakkrapatkobkratok1436
@jakkrapatkobkratok1436 4 жыл бұрын
@@raydike Can you make a video tutorial?
@gerardoramirez9450
@gerardoramirez9450 4 жыл бұрын
Hi! That is such a great video, however, looking at your code for the speed control I read this line: setpoint = temp / 500; I would like to know where does that 500 comes from? Is it the resolution from the encoder? Thank you and keep it that way. XD
@raydike
@raydike 4 жыл бұрын
yes proportional to encoder resolution.
@shermeentajammal352
@shermeentajammal352 4 жыл бұрын
what is model of ur dc motor and is it with encoder
@raydike
@raydike 4 жыл бұрын
Bühler motor with optical encoder
@sadettinbalcan1769
@sadettinbalcan1769 4 жыл бұрын
Hi, How can ı see the degree of position and rpm of speed on the Serial screen ?
@sadettinbalcan1769
@sadettinbalcan1769 4 жыл бұрын
Do your PID and pinExchange libraries work on Arduino Mega2560?
@raydike
@raydike 4 жыл бұрын
@@sadettinbalcan1769 yes
@raydike
@raydike 4 жыл бұрын
add some serial commands to the code.. degrees and rpm depends on motor, encoder and gearbox, you will have to do some calculations
@chanakyakulkarni5333
@chanakyakulkarni5333 4 жыл бұрын
Which motor are you using Does it come with encoder intact???
@raydike
@raydike 4 жыл бұрын
Yes it does. Type of motor visible end of the video
@sudheerdunna5633
@sudheerdunna5633 4 жыл бұрын
What are the other components we shall use in the absence of motor encoder ??
@raydike
@raydike 4 жыл бұрын
You need some sort of position feedback, a potentiometer could work but you will have to modify the code.
@sudheerdunna5633
@sudheerdunna5633 4 жыл бұрын
Why does encoder input controlled with 2.7k resister along with 5v source before feeding it to arduino. Is it because of encoder specifications ??
@raydike
@raydike 4 жыл бұрын
Yes the encoder has open collector outputs so need pull up resistors
@mrbloodbane4129
@mrbloodbane4129 4 жыл бұрын
@@raydike is that for every encoder or just yours
@keesreedijk7613
@keesreedijk7613 4 жыл бұрын
@@mrbloodbane4129 Depends on the encoder but most require pull-up resistors
@mrbloodbane4129
@mrbloodbane4129 4 жыл бұрын
@@keesreedijk7613 thank you
@sunitamahato9230
@sunitamahato9230 5 жыл бұрын
please sir send details of this project
@raydike
@raydike 5 жыл бұрын
It's all in the description
@JoaoVictor-ir3yu
@JoaoVictor-ir3yu 5 жыл бұрын
I am trying to use pid for speed control, I am using a dc motor with integrated encoder of the same type as the video, to make a mobile robot ...
@JoaoVictor-ir3yu
@JoaoVictor-ir3yu 5 жыл бұрын
Hi man, could you help me with something? I try to double the variables etc ... to use two engines but pid stops working (pid for speed control)
@raydike
@raydike 5 жыл бұрын
You will have to use two separate pin change interrupts for the encoders and be careful with the analogWrite commands, should not interfere with the timer one function. Why not use two arduinos?
@JoaoVictor-ir3yu
@JoaoVictor-ir3yu 5 жыл бұрын
@@raydike Thank you so much for answering me, I will try to do that
@rhudithomas7582
@rhudithomas7582 5 жыл бұрын
This is great! I have been looking for DC-Closed Loop Position control for ESP chip familyn and this is the closest yet. I am trying to use something like this for all of my home automation projects but I need position based on encoder count. Having a preset count value, I would be able to control everything from mini blinds to pocket doors. There is nothing on the internet that can do this as far as I can tell. If your system could be implemented with Misan Dc control system, which I believe is used with GRBL cnc, it would be a dream. If you ever feel like building the most diversified control system on the net, please implement your system with encoder count position, and PID(to add accel and decel for smooth operation) to an ESP-32 or ESP8266 base. I guarantee it will be the hottest system out here. ;-) Thank you VERY much for sharing this great project.
@hansstahl1887
@hansstahl1887 5 жыл бұрын
Is this capable of producing holding torque as a stepper would? I'm working on a camera motion controller that requires high torque at slow speeds, with pauses in between movements and I'm considering a similar system
@raydike
@raydike 5 жыл бұрын
Yes it tries to keep position (or speed) so has good torque.
@hansstahl1887
@hansstahl1887 5 жыл бұрын
@@raydike so the PID loop is controlling speed not position, as in if you tell it to have zero speed it tries to hold its position. Position is simply kept track of independent of the PID loop? Code would look like: if position < 100 , PID speed = 10, else PID speed = 0. This is interesting as other PID implementations are trying to use the position value for the PID loop which doesn't seem to work very well...
@raydike
@raydike 5 жыл бұрын
@@hansstahl1887 Actually the system is trying to hold position. Bij incrementing or decrementing the position periodically you create speed control.
@quannguyen-lw3gq
@quannguyen-lw3gq 3 жыл бұрын
@@raydike hi, i want to ask about your pid speed control. You have temp/500 (your old pid control) equal setpoint. i want ask if you know rpm of motor and pulses per revolution can you calculate the exact divisor (500 in this case)? Is the result depend on the time it take to execute the main loop function?
@raydike
@raydike 3 жыл бұрын
@@quannguyen-lw3gq Hi, the position is incremented every time timer 1 is giving an interrupt so is independent of loop time. If you know the gear reduction of your gearbox and the resolution of your encoder you should be able to work out the output rpm.
@omkarjoshi6252
@omkarjoshi6252 5 жыл бұрын
hey can i control it directly from arduino rather than using that thing ?
@raydike
@raydike 5 жыл бұрын
I guess by 'that thing' you mean the H-bridge? The answer is no, you will blow up your arduino if you try.
@omkarjoshi6252
@omkarjoshi6252 5 жыл бұрын
@@raydike not h-bridge the regulator one ?
@raydike
@raydike 5 жыл бұрын
You mean the potentiometer? yes you can modify the program to receive for example serial position commands. Best use the updated software with interrupts
@omkarjoshi6252
@omkarjoshi6252 5 жыл бұрын
@@raydike can you share me code if possible ? It would be great
@alexngo326
@alexngo326 5 жыл бұрын
hi ray Can i control more than one position of this program ?because i saw many example just control for one position if i want to change the controlled position at different time, how can i do? is it setting more encoderpos and timer? cause the different time 'for different position control?
@raydike
@raydike 5 жыл бұрын
I made a new, interrupt driven version: kzbin.info/www/bejne/jJzZgGuibpqFetE this will be easier to modify for your needs