Arduino project - Your Arduino Balancing Robot (YABR) - Part 3 - explaining the code

preview_player
Показать описание
In this video I explain the main loop of the balancing robot program.

Arduino Balancing Robot Part 1

Arduino Balancing Robot Part 2

My video about PID controllers for quadcopters

MPU-6050 IMU accelerometer and gyro fusion part 1

MPU-6050 IMU accelerometer and gyro fusion part 2
Рекомендации по теме
Комментарии
Автор

Great video as always! You must be the only guy in the world who really make true engineering with Arduino... Both in coding and physics, it's pretty cool, congrats ;)

IncroyablesExperiences
Автор

Hey Joop, I found that system looks smoother (especially on low speeds) when I use 'left_motor = 5000/(pid_output_left);' (same for right) instead of piece of code with '405 - (1/(pid_output_left + 9)) * 5500; ... 400-pid_output_left etc'. I was confused about 405, 9, 5500 and figured out that it is better to use pid output as frequency (which is linear function of speed!) instead of pulse length (which is non-linear). So, after that we have freq like 5..400, and calculate pulse length=(1/freq)*1000 miliseconds, and step count: pulse_length/(20 microseconds). 20 microseconds is period of interrupt. In other words, it is 5000/pid_output_left.

Why it is not 50000? it should be 50000, but we need extra speed, so we just use 10x faster, 5000.

heis
Автор

I am curious what the 400 means in the code.

benjaminmclaws
Автор

It would be really interested if you could make a video about sending video from a camera with an arduino and a wifi chip or Bluetooth.

CreativeProductionzz
Автор

great video, unfortunately for those of us not looking to copy and paste his code, some parts specially the mathematics is left unexplained.

EdwinFairchild
Автор

Sorry Joop, I appreciate your work and your very good explanation but the schematic here in your Part 3 - YABR-Video(3:56min) is NOT the same like the schematic in your web-site...! Here is the "FAULT"-PIN connected and at the schematic in your web-site the FAULT-PIN is NOT connected ! Wich one should I use ? web-site schematic don't work, connections are checked many times....current is set to 150mA....MPU-value is about motors do not move(NEMA17) . Now I'm not shure if I followed the "incomplet" schematic or the bigger Steppers are the reason for not I will try the

zxrheinzi
Автор

Hi, I was just wondering how to use the code you just want the bot to stand and not use a remote. say move forward from within the code. Its for a project I'm doing. I'm fine with it all except I'm not sure how to separate the controller pid code from the rest. Thanks

eamonnculliton
Автор

Hi Joop
First of all I would like to thank you, this is brilliant, I built one. But, Can I ask if it is possible to change the 2.4ghz transceiver  to a normal hobby R/C transmitter/receiver,  
Instead of the nunchuck   and if so how ?, I am new to code and not very good
Thank You

phil
Автор

Hi. this was not exclaimed in the description. if(!(received_byte & B00001100)){ as the nunchuck is not sending this. Anybody...

plymouthrovadventures.
Автор

whats this guys profession, how can i be like him like knowing all this stuff about microprocessors and electronics; should i apply for embedded systems jobs or i dont know who does that white good companies, aerospace companies. Can anyone help?

ahmetpehlivan
Автор

in my robot the moving forward and backward works fine...but when turning its shaking....why is that?

manishamalshanrajapaksha
Автор

Hi i Like all you videos. :-)
But i have a quistin.
I like to use BL but my BT app can only send karakter, like a "a" "b" "c" and so one, how do i convert them to bit.??

And also what do the line.
if(!(received_byte & B00001100)){ //Slowly reduce the setpoint to zero if no foreward or backward command is given
if(pid_setpoint > 0.5)pid_setpoint -=0.05; //If the PID setpoint is larger then 0.5 reduce the setpoint with 0.05 every loop
else if(pid_setpoint < -0.5)pid_setpoint +=0.05; //If the PID setpoint is smaller then -0.5 increase the setpoint with 0.05 every loop
else pid_setpoint = 0; //If the PID setpoint is smaller then 0.5 or larger then -0.5 set the setpoint to 0
}

You skip this part :-)

JyskMaker
Автор

Hello, Can I substitute the Pro Mini in the robot for a Nano without making any software changes?
Thanks.

steve
Автор

Hi Joop. So I ended up building the robot a little modified in terms of the structure but almost similar. I have not place the battery yet at the top (so it is not top heavy) as I am testing the robot using an external power supply. What I have noticed is while the robot balances, it seems to be running forward continuously. How can i prevent this from happening? One more thing I have noticed is that the hardware calibration value for the MPU6050 keeps changing every time I run the hardware test code. Any idea why?

ryanruthrhona
Автор

Good job, this is one of the best arduino videos I've ever seen.

lexDeLaCruz
Автор

bro please help me i am facing some problems with my project can i contact you, please

osamamahmoud
Автор

sir.... why the angle is always increase (I copied your code and follow all your step.)

kj
Автор

Electronic stuff has partly arrived, rest is in transit from China. I have made the frame from PMMA yesterday with the lasercutter at Hafven, the maker space in Hannover. Thanks for the teaching!

KarstenFuhst
Автор

Really a incredible work. Will try make it. Have ordered parts. Till now all other discriptions give me less information. Great job.

OptasiaD
Автор

hi! I've found some parameters were not declared in the code. e.g. TWBR, TCCR2A, TCCR2B, any reason? thanks.

nicshan