My class mates and I have been given the task to design, assemble and control a ball on beam system. Basically we are meant to design a system which balanced a ball on a beam at a position we INPUT. As feedback we are using a resistive wire set-up.
My concern is, how to integrate the feedback into the system, that is, if we want it to balance at say position x, how do I integrate the feedback? I worked on a project using the Arduino last year and I can get around the programming. I figured having a resistance wire with voltage feedback I would use the ADC on the Arduino to convert it to digital resolution.
If the beam is 40cm and I want the ball to settle at 30cm, the full resolution for 40cm would be that of 1028 bits and that for 30cm would be 771 bits (75% of 1028 bits) Would the program have to be something such as;
If feedback < 771 increment +ve to 771
If feedback > 771 increment -ve to 771
I hope I am making sense, I think I am on the right track but I would like to confirm with you guys!