- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I would like command a DC motor with regulation PID.
I ave:
1 motor dc 0 to 35V for 0 to 3000 rpm. I command with PWM.
1 tachimeter 0 to 5 v for 0 to 3000 rpm.
I think enter at the ADC with 0-5V and i use the digital value to change a compare value.
I find the tutorial Lab 1 to 4.
For PWM and change the value of compare it's ok.
When i try to copy past the C command for get value of adc they don't work.
Can you help me.
I work with PSoC 4 CY8CKIT-049 4xxx and the tutorial is for psoc 5.
Thank
Fabrice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Copy & paste will not help you because the underlying hardware is different from PSoC4 to PSoC5. Instead open a sequencing ADC example for a PSoC4, get it to work and copy that into your motor controller project.
Take care for your 35V interface to the motor, keep in mind to use some freewheeling diodes. Take care that no voltage on any pin exceeds th limit of VDD which, when using the USB, is set to 5V on a Prototyping Kit.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank for your answer.
Don't worry, i use a H-bridge with optocoupler by security. The command of optocoupler are 5V and the h-bridge ave 35V with diode-freewhile (diode de roue libre).
Ave you a exemple or similar programme for convert a analogue value to digital and use this one in pwm compare value for my psoc?
Thank
Fabrice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attached is an ap note on a PID, in this case a temp controller, but principles
are same. It was done in PSOC 1. Useful as reference only as HW in PSOC 1
quite different than PSOC 3/4/5LP.
Motor drive loves creating a lot of transients so split grounds between PSOC and
motor driver H Bridge very importent. If you have problems use a DSO, set trigger
to Vtrig >= Vdd + .5 and also Vtrig <= Vss - .5, timebase normal mode (not auto) and
go looking for transients on ALL psoc pins.
The code to control PWM is very simple. First set PWM up (GUI configurator) for the
switching freq you want, period, and set compare value to 1/2 the period value. Then
start pwm with its start API and use the write compare API (in datasheet) to control
the PW, duty cycle. There are several examples in Creator, one controling LED brightness
for example, that you can look at if necessary.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some other projects/ref material -
http://www.cypress.com/?rID=2638 AN2197 - Stepper Motor Driver for Smart Gauges
http://www.element14.com/community/docs/DOC-47984/l/cypress-an2229--application-note-on-psoc-1-motor... AN2229 Motor Control-Multi-Functional Stepping Motor Driver
http://www.element14.com/community/docs/DOC-47938/l/cypress-an41949--application-note-for-psoc-1-ste... AN41949 - Application Note for PSoC 1 Stepper Motor Controller
http://www.cypress.com/?rID=68670 AN75813 - H Bridge Based Motor Drive Protection Using PSoC® 3
http://www.cypress.com/?rID=3983 Obsolete Motor Control Reference Material and Project
Here there are 2 projects in PSOC 4 controlling motors -
PSOC 4 element14.com
|
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank all for your answers.
I look the informations.
Fabrice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome!
Dana.