this code is for inverted pendulum balancer. it is based on two-loop PID controller. One controller is for Angle and another one is for velocity.

Dependencies:   HCSR04 L298HBridge mbed

Committer:
dudu941014
Date:
Fri Aug 25 21:25:46 2017 +0000
Revision:
1:ce626b794a6c
Parent:
0:489498e8dae5
this code is for inverted pendulum balancer. it is based on two-loop PID controller. One controller is for Angle and another one is for velocity.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dudu941014 0:489498e8dae5 1 #include "mbed.h"
dudu941014 0:489498e8dae5 2 #include "hcsr04.h"
dudu941014 0:489498e8dae5 3
dudu941014 0:489498e8dae5 4 extern HCSR04 usensor;
dudu941014 0:489498e8dae5 5 extern float home;
dudu941014 0:489498e8dae5 6 extern float offset;
dudu941014 0:489498e8dae5 7 extern float distance;
dudu941014 0:489498e8dae5 8
dudu941014 0:489498e8dae5 9
dudu941014 0:489498e8dae5 10 void get_distance(void);