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Ай бұрын
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Ай бұрын
@@raydike Thanks, kind of you to reply. I'll have a try👍
@estudiobrutto2 ай бұрын
J adore, c est ou ca ?
@raydike2 ай бұрын
Le long de la Loire à Beaugency
@thierrythibault70942 ай бұрын
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
@raydike2 ай бұрын
Oui c'est une version carburateur
@dalgrian4 ай бұрын
Very interesting!
@woldecosgrove5 ай бұрын
Hello Ray both program cant work at all, motor is not moving at all ! Why ?
@woldecosgrove5 ай бұрын
Hello Ray, i finally get it works motor is running,, but unable to control speed via PoT, could you advise ?
@woldecosgrove5 ай бұрын
hello i rey to duplicate this work, but compile error couldn't find this <PinChangeInt.h> could you help ??
@vanceblosser21556 ай бұрын
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.
@amann8157 ай бұрын
nic sir good work
@Rammstein568 ай бұрын
That is a very, very early version of the legend❤ J'adore
@ganeshpingle-r3n9 ай бұрын
Please🙏
@ganeshpingle-r3n9 ай бұрын
Please
@ganeshpingle-r3n9 ай бұрын
But j have some question can you help me...
@ganeshpingle-r3n9 ай бұрын
Grate video sir
@jashugg9 ай бұрын
She runs very nicely on top gear, is that direct or overdrive?
@raydike9 ай бұрын
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.
@Rammstein568 ай бұрын
Yacco huile de ricine for the bronze gears, like some vintage Ferrari gear boxes. Actually Enzo had a metallic grey 40r.
@roblox5413 Жыл бұрын
Circuit please
@raydike Жыл бұрын
at the website of Thomas Kim you can find the instructions on how to build this.
@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 Жыл бұрын
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.
@mateogermanorjuelagalvez38202 жыл бұрын
hello I would like to know, what is the engine reference?
@kifahzaidan45052 жыл бұрын
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
@kifahzaidan45052 жыл бұрын
THANKS A LOT CAN YOU PLEASE POST VIDEO FOR THE (CONTROLLING OF DC MOTOR 'ACTUATOR ' PROGRAMABLE POSITION WITH MEMORY BUTTONS USING ARDUINO. BEST
@farazjankhattak57192 жыл бұрын
where the enable pin of l298 is connected with arduino?
@raydike2 жыл бұрын
enable pin is connected to +5v
@sandovaltrejocarlos38682 жыл бұрын
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?
@raydike2 жыл бұрын
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.
@keshavkushwah47503 жыл бұрын
Can you please help me to make a code for dmx stapper motor with encoder
@mouseminer29783 жыл бұрын
This is amazing. Is it possible to use encoder instead of 10k pot?
@mehmetcannzam15793 жыл бұрын
where is pcb ?
@alexanderkokotkin45023 жыл бұрын
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?
@gagalsarjana61383 жыл бұрын
Readi
@mernamohamed16823 жыл бұрын
what's the type of dc motor ?
@adnansarfaraz66103 жыл бұрын
how we can control with two dc motors plz share code for two motors
@oigencyofficial90384 жыл бұрын
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_944 жыл бұрын
why interrupts are needed when implementing PID on uC?
@keesreedijk76134 жыл бұрын
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.
@sankyppp4 жыл бұрын
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
@keesreedijk76134 жыл бұрын
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.
@sankyppp4 жыл бұрын
@@keesreedijk7613 Thanks for the reply.
@sinanali45644 жыл бұрын
What's the function of potentiometer in this?
@raydike4 жыл бұрын
It's the thing I'm turning in the video, it provides an input signal for position or speed
@hamidou51264 жыл бұрын
Thanks for your work bro but we want to know how did you do for getting a model of system ? ( transfer function )
@mehmetcannzam15793 жыл бұрын
PID CONTROL
@willy73464 жыл бұрын
Good Project. how to set degrees of dc motor 0-180? Like servo code (0 , 1023 , 0, 180) on your arduino code?
@raydike4 жыл бұрын
Output angle depends on the encoder resolution and the gearbox. If you know those then not too hard to calculate.
@jakkrapatkobkratok14364 жыл бұрын
hello , Can you share circuit schematic? and code?! to [email protected]
@jakkrapatkobkratok14364 жыл бұрын
I can do as you teach, but I can't.
@Mr.ultron8794 жыл бұрын
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.
@keesreedijk76134 жыл бұрын
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/
@jakkrapatkobkratok14364 жыл бұрын
I have followed all of you, but the motor is not working.
@raydike4 жыл бұрын
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.
@jakkrapatkobkratok14364 жыл бұрын
@@raydike Can you make a video tutorial?
@gerardoramirez94504 жыл бұрын
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
@raydike4 жыл бұрын
yes proportional to encoder resolution.
@shermeentajammal3524 жыл бұрын
what is model of ur dc motor and is it with encoder
@raydike4 жыл бұрын
Bühler motor with optical encoder
@sadettinbalcan17694 жыл бұрын
Hi, How can ı see the degree of position and rpm of speed on the Serial screen ?
@sadettinbalcan17694 жыл бұрын
Do your PID and pinExchange libraries work on Arduino Mega2560?
@raydike4 жыл бұрын
@@sadettinbalcan1769 yes
@raydike4 жыл бұрын
add some serial commands to the code.. degrees and rpm depends on motor, encoder and gearbox, you will have to do some calculations
@chanakyakulkarni53334 жыл бұрын
Which motor are you using Does it come with encoder intact???
@raydike4 жыл бұрын
Yes it does. Type of motor visible end of the video
@sudheerdunna56334 жыл бұрын
What are the other components we shall use in the absence of motor encoder ??
@raydike4 жыл бұрын
You need some sort of position feedback, a potentiometer could work but you will have to modify the code.
@sudheerdunna56334 жыл бұрын
Why does encoder input controlled with 2.7k resister along with 5v source before feeding it to arduino. Is it because of encoder specifications ??
@raydike4 жыл бұрын
Yes the encoder has open collector outputs so need pull up resistors
@mrbloodbane41294 жыл бұрын
@@raydike is that for every encoder or just yours
@keesreedijk76134 жыл бұрын
@@mrbloodbane4129 Depends on the encoder but most require pull-up resistors
@mrbloodbane41294 жыл бұрын
@@keesreedijk7613 thank you
@sunitamahato92305 жыл бұрын
please sir send details of this project
@raydike5 жыл бұрын
It's all in the description
@JoaoVictor-ir3yu5 жыл бұрын
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-ir3yu5 жыл бұрын
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)
@raydike5 жыл бұрын
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-ir3yu5 жыл бұрын
@@raydike Thank you so much for answering me, I will try to do that
@rhudithomas75825 жыл бұрын
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.
@hansstahl18875 жыл бұрын
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
@raydike5 жыл бұрын
Yes it tries to keep position (or speed) so has good torque.
@hansstahl18875 жыл бұрын
@@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...
@raydike5 жыл бұрын
@@hansstahl1887 Actually the system is trying to hold position. Bij incrementing or decrementing the position periodically you create speed control.
@quannguyen-lw3gq3 жыл бұрын
@@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?
@raydike3 жыл бұрын
@@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.
@omkarjoshi62525 жыл бұрын
hey can i control it directly from arduino rather than using that thing ?
@raydike5 жыл бұрын
I guess by 'that thing' you mean the H-bridge? The answer is no, you will blow up your arduino if you try.
@omkarjoshi62525 жыл бұрын
@@raydike not h-bridge the regulator one ?
@raydike5 жыл бұрын
You mean the potentiometer? yes you can modify the program to receive for example serial position commands. Best use the updated software with interrupts
@omkarjoshi62525 жыл бұрын
@@raydike can you share me code if possible ? It would be great
@alexngo3265 жыл бұрын
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?
@raydike5 жыл бұрын
I made a new, interrupt driven version: kzbin.info/www/bejne/jJzZgGuibpqFetE this will be easier to modify for your needs