noobgm.blogg.se

Robotc arduino
Robotc arduino












robotc arduino
  1. ROBOTC ARDUINO HOW TO
  2. ROBOTC ARDUINO CODE

The only problem I can think of is that it takes time for the motors to turn off and in that time the interrupts are wreaking havoc. For example instead of while(left_counter != right_counter) I've even done while ((left_counter - right_counter) > Certain_Range

ROBOTC ARDUINO CODE

Now sometimes the code gets stuck in one of the while loops. Great precision is not needed for this challenge therefore, limited tracking. Challenge: Creating a sketch that will allow the bot to travel in a straight line for some distance, turnaround and travel back to the start point.

ROBOTC ARDUINO HOW TO

Hobbyist Situation: Good hardware/electronics skills, just learning how to program. Now theoretically the chassis should go in a straight line but it doesn't and performs weird stuff. Project: Arduino robot with motors equipped with hall effect quadrature encoders. So I made a simple program that keeps a check on these encoder readings and when the difference exceeds a certain value it shuts off one motor until the values don't become equal and then turn on that motor. And when one motor is faster that certain reading should be more.

robotc arduino

Now theoretically when the chassis moves straight both readings should be exactly the same (I've checked - They are!). I connected Arduino Uno with the chassis and made a simple program to just count the numbers of signals (in simple terms) from each of the encoder motors. Other microcontrollers and single board computers.Now I have a simple chassis with two wheels which are powered by encoder motors.Microcontrollers, FPGA & Single Board Computers.A la Carte(ALC) Custom PCB Design Services.How to get Technical Assistance from a Technical Support Moderator.Thank you for any advice or direction you may provide. It seems to me the concepts set out by the RobotC code offers the perfect solution. I have spent many hours on trying to come up with a way to get the bot to travel in a straight line using some aspect of PID that is not overly complex for this relatively simple task. It uses integers only and math that does not result in floats. If the motors moved at exactly the same speed, this value would be 0.Īnother important aspect of the RobotC straight line code is it does not use floats or other data types that consume large amounts of microprocessor resources. Negative if slave has to slow down, positive if it has to speed up. My limited programming experience/skills do not allow me to simply translate RobotC to an Arduino sketch C which I am currently learning.Īs explained at the above web page the difference between the master encoder and the slave encoder ticks can be used to determine error. This concept was presented at the web page below which uses RobotC for programming. In this situation Error = speed_Master - speed_Slave However, as expected, the bot cannot travel in straight line.Ĭoncept: Keep it simple by having one motor serve as the speed master and the other as a speed slave, where the master motor speed is held constant and the slave motor speed is varied so as to match the master motor speed. Great precision is not needed for this challenge therefore, limited tracking (drift) back and forth across the straight line path is acceptable.Ĭurrent situation: The bot has been tested and it goes forward, backwards, turns etc. Hobbyist Situation: Good hardware/electronics skills, just learning how to program.Ĭhallenge: Creating a sketch that will allow the bot to travel in a straight line for some distance, turnaround and travel back to the start point. Project: Arduino robot with motors equipped with hall effect quadrature encoders.














Robotc arduino