hi, ineed this code work on pic by making input/output proportional to rpm 800-2000 thank you

Thread Starter

huida_lymya

Joined Jul 23, 2018
25
C:
#include<math.h>
#include<stdio.h>
main()
{
   /* prints a logarithmic vertical axis (abcissa) */
   int step[]={7,4,3,3,3,2,2,2,1,1};
   int label[]={800,1000,1300,1400,1500,1600,1700,1800,1900,2000};
   int i, j;
   for (j = 0; j < 10; ++j)
   {
     printf("\n%4d +",label[j]);
     for (i = 0;i < step[j]; ++i)
     printf("\n  | ");
   }
}
 
Last edited by a moderator:

Thread Starter

huida_lymya

Joined Jul 23, 2018
25
Where did this code come from - it would help to understand the intention.
What do you want to use as the display?
Hi,how are you,i hope you doing well, thank you in advance about code i gave it from book talk about frequency response measure the scale by logarithmic ,i need to make proportional rpm in put and the out put scale applied to solenoid power shift hydraulic pump swash exponent read engine rpm and applied magnetude scale into solenoid please help me
 

AlbertHall

Joined Jun 4, 2014
12,345
I can do PIC code but I have no idea what "the out put scale applied to solenoid power shift hydraulic pump swash exponent read engine rpm and applied magnetude scale into solenoid" means - sorry.
 

danadak

Joined Mar 10, 2018
4,057
Just a suggestion, commenting code, may seem tedious, is the responsible thing
to do in design. It not only helps the author but the engineers, techs, that must
support it over the product lifetime. Commenting is an excellent habit to develop.

Regards, Dana.
 

spinnaker

Joined Oct 29, 2009
7,830
C:
#include<math.h>
#include<stdio.h>
main()
{
   /* prints a logarithmic vertical axis (abcissa) */
   int step[]={7,4,3,3,3,2,2,2,1,1};
   int label[]={800,1000,1300,1400,1500,1600,1700,1800,1900,2000};
   int i, j;
   for (j = 0; j < 10; ++j)
   {
     printf("\n%4d +",label[j]);
     for (i = 0;i < step[j]; ++i)
     printf("\n  | ");
   }
}

Your code does nothing but print an array. What do you expect it to do???

Hi,i mean distance and step
Huh?? :confused:
 

AlbertHall

Joined Jun 4, 2014
12,345
It's no good talking to me about 'power match between engine and hydraulic pump'. If you can describe the inputs and outputs to the PIC and what process the PIC should do we might get somewhere.

So there is a frequency input to the PIC?
What is the proportional output?
A frequency?
A PWM signal?
A DC voltage or current?
 

Thread Starter

huida_lymya

Joined Jul 23, 2018
25
I can do PIC code but I have no idea what "the out put scale applied to solenoid power shift hydraulic pump swash exponent read engine rpm and applied magnetude scale into solenoid" means - sorry.
HI, I can do PIC code but I have no idea what "the out put scale applied to solenoid power shift hydraulic pump swash exponent read engine rpm and applied magnetude scale into solenoid.
the output scale like: at800rpm=555ma,at1000,1300,1400,1500=450ma,at1600,1700,1800,=290ma,at1900=250ma,at2000=215ma the amp reduce proportional to input frequency of engine rpm,state out one =555ma ,state out two=450ma from1000 to1500 rpm state out three=290ma from1600 to 1800,state out four=250ma1900 and state out five=215ma,at2000 rpm thank you
 

Thread Starter

huida_lymya

Joined Jul 23, 2018
25
It's no good talking to me about 'power match between engine and hydraulic pump'. If you can describe the inputs and outputs to the PIC and what process the PIC should do we might get somewhere.

So there is a frequency input to the PIC?
What is the proportional output?
A frequency?
A PWM signal?
A DC voltage or current?
the out put is current
 

Thread Starter

huida_lymya

Joined Jul 23, 2018
25

AlbertHall

Joined Jun 4, 2014
12,345
the dc volt is 24 when we loaded to solenoid 17 ohms drop to about 12v look like amp less
So this is the solenoid that we need to control the current through.
It could be connected two ways:
1. One end of the solenoid is connected to the +24V supply and the other end is connected to the controller.
2. On end of the solenoid is connected to ground and the other end connects to the +24V.

Which way is your solenoid connected?
 

Thread Starter

huida_lymya

Joined Jul 23, 2018
25

Thread Starter

huida_lymya

Joined Jul 23, 2018
25
So this is the solenoid that we need to control the current through.
It could be connected two ways:
1. One end of the solenoid is connected to the +24V supply and the other end is connected to the controller.
2. On end of the solenoid is connected to ground and the other end connects to the +24V.

Which way is your solenoid connected?
solenoid connected one is ground by resistor and the other to collector of transistor then controller
 

Thread Starter

huida_lymya

Joined Jul 23, 2018
25
It's no good talking to me about 'power match between engine and hydraulic pump'. If you can describe the inputs and outputs to the PIC and what process the PIC should do we might get somewhere.

So there is a frequency input to the PIC?
What is the proportional output?
A frequency?
A PWM signal?
A DC voltage or current?
Hi, I am very sorry so the answer is frequency response &modulation just like that
 

AlbertHall

Joined Jun 4, 2014
12,345
At 800 rpm the current should be 555mA.

How accurate do these currents need to be?
500mA to 600mA?
550mA to 560mA?
554mA to 556mA?
 

Thread Starter

huida_lymya

Joined Jul 23, 2018
25
Last edited by a moderator:
Top